PageRenderTime 125ms CodeModel.GetById 29ms RepoModel.GetById 1ms app.codeStats 1ms

/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml

https://bitbucket.org/fkengun/porthadoop
XML | 11215 lines | 10681 code | 467 blank | 67 comment | 0 complexity | 5c5b365cdf367264187eac2ff63d5650 MD5 | raw file
Possible License(s): Apache-2.0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet type="text/xsl" href="testConf.xsl"?>
  3. <!--
  4. Licensed to the Apache Software Foundation (ASF) under one or more
  5. contributor license agreements. See the NOTICE file distributed with
  6. this work for additional information regarding copyright ownership.
  7. The ASF licenses this file to You under the Apache License, Version 2.0
  8. (the "License"); you may not use this file except in compliance with
  9. the License. You may obtain a copy of the License at
  10. http://www.apache.org/licenses/LICENSE-2.0
  11. Unless required by applicable law or agreed to in writing, software
  12. distributed under the License is distributed on an "AS IS" BASIS,
  13. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. See the License for the specific language governing permissions and
  15. limitations under the License.
  16. -->
  17. <configuration>
  18. <!-- Normal mode is test. To run just the commands and dump the output
  19. to the log, set it to nocompare -->
  20. <mode>test</mode>
  21. <!-- Comparator types:
  22. ExactComparator
  23. SubstringComparator
  24. RegexpComparator
  25. TokenComparator
  26. -->
  27. <tests>
  28. <!-- Tests for ls -->
  29. <test> <!-- TESTED -->
  30. <description>ls: file using absolute path</description>
  31. <test-commands>
  32. <command>-fs NAMENODE -touchz /file1</command>
  33. <command>-fs NAMENODE -ls /file1</command>
  34. </test-commands>
  35. <cleanup-commands>
  36. <command>-fs NAMENODE -rm /file1</command>
  37. </cleanup-commands>
  38. <comparators>
  39. <comparator>
  40. <type>RegexpComparator</type>
  41. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file1</expected-output>
  42. </comparator>
  43. </comparators>
  44. </test>
  45. <test> <!-- TESTED -->
  46. <description>ls: file using relative path</description>
  47. <test-commands>
  48. <command>-fs NAMENODE -mkdir -p dir</command>
  49. <command>-fs NAMENODE -touchz file1</command>
  50. <command>-fs NAMENODE -ls file1</command>
  51. </test-commands>
  52. <cleanup-commands>
  53. <command>-fs NAMENODE -rm file1</command>
  54. </cleanup-commands>
  55. <comparators>
  56. <comparator>
  57. <type>RegexpComparator</type>
  58. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file1</expected-output>
  59. </comparator>
  60. </comparators>
  61. </test>
  62. <test> <!-- TESTED -->
  63. <description>ls: files using globbing</description>
  64. <test-commands>
  65. <command>-fs NAMENODE -mkdir -p dir</command>
  66. <command>-fs NAMENODE -touchz file1</command>
  67. <command>-fs NAMENODE -touchz file2</command>
  68. <command>-fs NAMENODE -touchz file3</command>
  69. <command>-fs NAMENODE -touchz file4</command>
  70. <command>-fs NAMENODE -ls file*</command>
  71. </test-commands>
  72. <cleanup-commands>
  73. <command>-fs NAMENODE -rm -r /user</command>
  74. </cleanup-commands>
  75. <comparators>
  76. <comparator>
  77. <type>RegexpComparator</type>
  78. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file1</expected-output>
  79. </comparator>
  80. <comparator>
  81. <type>RegexpComparator</type>
  82. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file2</expected-output>
  83. </comparator>
  84. <comparator>
  85. <type>RegexpComparator</type>
  86. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file3</expected-output>
  87. </comparator>
  88. <comparator>
  89. <type>RegexpComparator</type>
  90. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file4</expected-output>
  91. </comparator>
  92. </comparators>
  93. </test>
  94. <test> <!-- TESTED -->
  95. <description>ls: directory using absolute path</description>
  96. <test-commands>
  97. <command>-fs NAMENODE -mkdir /dir1</command>
  98. <command>-fs NAMENODE -ls /</command>
  99. </test-commands>
  100. <cleanup-commands>
  101. <command>-fs NAMENODE -rm -r /dir1</command>
  102. </cleanup-commands>
  103. <comparators>
  104. <comparator>
  105. <type>RegexpComparator</type>
  106. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir1</expected-output>
  107. </comparator>
  108. </comparators>
  109. </test>
  110. <test> <!-- TESTED -->
  111. <description>ls: directory using relative path</description>
  112. <test-commands>
  113. <command>-fs NAMENODE -mkdir -p dir1</command>
  114. <command>-fs NAMENODE -ls </command>
  115. </test-commands>
  116. <cleanup-commands>
  117. <command>-fs NAMENODE -rm -r dir1</command>
  118. </cleanup-commands>
  119. <comparators>
  120. <comparator>
  121. <type>RegexpComparator</type>
  122. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir1</expected-output>
  123. </comparator>
  124. </comparators>
  125. </test>
  126. <test> <!-- TESTED -->
  127. <description>ls: directory using globbing</description>
  128. <test-commands>
  129. <command>-fs NAMENODE -mkdir -p dir1</command>
  130. <command>-fs NAMENODE -mkdir -p dir2</command>
  131. <command>-fs NAMENODE -mkdir -p dir3</command>
  132. <command>-fs NAMENODE -mkdir -p dir4</command>
  133. <command>-fs NAMENODE -ls </command>
  134. </test-commands>
  135. <cleanup-commands>
  136. <command>-fs NAMENODE -rm -r /user</command>
  137. </cleanup-commands>
  138. <comparators>
  139. <comparator>
  140. <type>RegexpComparator</type>
  141. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir1</expected-output>
  142. </comparator>
  143. <comparator>
  144. <type>RegexpComparator</type>
  145. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2</expected-output>
  146. </comparator>
  147. <comparator>
  148. <type>RegexpComparator</type>
  149. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir3</expected-output>
  150. </comparator>
  151. <comparator>
  152. <type>RegexpComparator</type>
  153. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir4</expected-output>
  154. </comparator>
  155. </comparators>
  156. </test>
  157. <test> <!-- TESTED -->
  158. <description>ls: file/directory that does not exist in /</description>
  159. <test-commands>
  160. <command>-fs NAMENODE -ls /file1</command>
  161. </test-commands>
  162. <cleanup-commands>
  163. </cleanup-commands>
  164. <comparators>
  165. <comparator>
  166. <type>RegexpComparator</type>
  167. <expected-output>^ls: `/file1': No such file or directory</expected-output>
  168. </comparator>
  169. </comparators>
  170. </test>
  171. <test> <!-- TESTED -->
  172. <description>ls: file/directory that does not exist in home directory (/user/username)</description>
  173. <test-commands>
  174. <command>-fs NAMENODE -ls /user</command>
  175. </test-commands>
  176. <cleanup-commands>
  177. </cleanup-commands>
  178. <comparators>
  179. <comparator>
  180. <type>RegexpComparator</type>
  181. <expected-output>^ls: `/user': No such file or directory</expected-output>
  182. </comparator>
  183. </comparators>
  184. </test>
  185. <test> <!-- TESTED -->
  186. <description>ls: Non-URI input file at Namenode's path</description>
  187. <test-commands>
  188. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  189. <command>-fs NAMENODE -ls NAMENODE/file1</command>
  190. </test-commands>
  191. <cleanup-commands>
  192. <command>-fs NAMENODE -rm NAMENODE/file1</command>
  193. </cleanup-commands>
  194. <comparators>
  195. <comparator>
  196. <type>RegexpComparator</type>
  197. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file1</expected-output>
  198. </comparator>
  199. </comparators>
  200. </test>
  201. <test> <!-- TESTED -->
  202. <description>ls: file at hdfs:// path</description>
  203. <test-commands>
  204. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  205. <command>-fs NAMENODE -ls hdfs:///file1</command>
  206. </test-commands>
  207. <cleanup-commands>
  208. <command>-fs NAMENODE -rm hdfs:///file1</command>
  209. </cleanup-commands>
  210. <comparators>
  211. <comparator>
  212. <type>RegexpComparator</type>
  213. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file1</expected-output>
  214. </comparator>
  215. </comparators>
  216. </test>
  217. <test> <!-- TESTED -->
  218. <description>ls: Non-URI input file at Namenode's path using globing</description>
  219. <test-commands>
  220. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  221. <command>-fs NAMENODE -touchz NAMENODE/file2</command>
  222. <command>-fs NAMENODE -touchz NAMENODE/file3</command>
  223. <command>-fs NAMENODE -ls NAMENODE/file*</command>
  224. </test-commands>
  225. <cleanup-commands>
  226. <command>-fs NAMENODE -rm NAMENODE/file*</command>
  227. </cleanup-commands>
  228. <comparators>
  229. <comparator>
  230. <type>RegexpComparator</type>
  231. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file1</expected-output>
  232. </comparator>
  233. <comparator>
  234. <type>RegexpComparator</type>
  235. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file2</expected-output>
  236. </comparator>
  237. <comparator>
  238. <type>RegexpComparator</type>
  239. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file3</expected-output>
  240. </comparator>
  241. </comparators>
  242. </test>
  243. <test> <!-- TESTED -->
  244. <description>ls: file at hdfs:// path using globing</description>
  245. <test-commands>
  246. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  247. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  248. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  249. <command>-fs NAMENODE -ls hdfs:///file*</command>
  250. </test-commands>
  251. <cleanup-commands>
  252. <command>-fs NAMENODE -rm hdfs:///file*</command>
  253. </cleanup-commands>
  254. <comparators>
  255. <comparator>
  256. <type>RegexpComparator</type>
  257. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file1</expected-output>
  258. </comparator>
  259. <comparator>
  260. <type>RegexpComparator</type>
  261. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file2</expected-output>
  262. </comparator>
  263. <comparator>
  264. <type>RegexpComparator</type>
  265. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file3</expected-output>
  266. </comparator>
  267. </comparators>
  268. </test>
  269. <test> <!-- TESTED -->
  270. <description>ls: Non-URI input dir at Namenode's path</description>
  271. <test-commands>
  272. <command>-fs NAMENODE -mkdir -p NAMENODE/user/dir1</command>
  273. <command>-fs NAMENODE -ls hdfs:///user/</command>
  274. </test-commands>
  275. <cleanup-commands>
  276. <command>-fs NAMENODE -rm hdfs:///user/dir1</command>
  277. </cleanup-commands>
  278. <comparators>
  279. <comparator>
  280. <type>RegexpComparator</type>
  281. <expected-output>Found [0-9] items</expected-output>
  282. </comparator>
  283. <comparator>
  284. <type>RegexpComparator</type>
  285. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///user/dir1</expected-output>
  286. </comparator>
  287. </comparators>
  288. </test>
  289. <test> <!-- TESTED -->
  290. <description>ls: dir at hdfs:// path</description>
  291. <test-commands>
  292. <command>-fs NAMENODE -mkdir -p hdfs:///user/dir1</command>
  293. <command>-fs NAMENODE -ls hdfs:///user/</command>
  294. </test-commands>
  295. <cleanup-commands>
  296. <command>-fs NAMENODE -rm hdfs:///user/dir1</command>
  297. </cleanup-commands>
  298. <comparators>
  299. <comparator>
  300. <type>RegexpComparator</type>
  301. <expected-output>Found [0-9] items</expected-output>
  302. </comparator>
  303. <comparator>
  304. <type>RegexpComparator</type>
  305. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///user/dir1</expected-output>
  306. </comparator>
  307. </comparators>
  308. </test>
  309. <test> <!-- TESTED -->
  310. <description>ls: Non-URI input dir at Namenode's path using globing</description>
  311. <test-commands>
  312. <command>-fs NAMENODE -mkdir -p NAMENODE/user/dir1</command>
  313. <command>-fs NAMENODE -mkdir -p NAMENODE/user/dir2</command>
  314. <command>-fs NAMENODE -mkdir -p NAMENODE/user/dir3</command>
  315. <command>-fs NAMENODE -ls hdfs:///user/</command>
  316. </test-commands>
  317. <cleanup-commands>
  318. <command>-fs NAMENODE -rm hdfs:///user/dir*</command>
  319. </cleanup-commands>
  320. <comparators>
  321. <comparator>
  322. <type>RegexpComparator</type>
  323. <expected-output>Found [0-9] items</expected-output>
  324. </comparator>
  325. <comparator>
  326. <type>RegexpComparator</type>
  327. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///user/dir1</expected-output>
  328. </comparator>
  329. <comparator>
  330. <type>RegexpComparator</type>
  331. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///user/dir2</expected-output>
  332. </comparator>
  333. <comparator>
  334. <type>RegexpComparator</type>
  335. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///user/dir3</expected-output>
  336. </comparator>
  337. </comparators>
  338. </test>
  339. <test> <!-- TESTED -->
  340. <description>ls: dir at hdfs:// path using globing</description>
  341. <test-commands>
  342. <command>-fs NAMENODE -mkdir -p hdfs:///user/dir1</command>
  343. <command>-fs NAMENODE -mkdir -p hdfs:///user/dir2</command>
  344. <command>-fs NAMENODE -mkdir -p hdfs:///user/dir3</command>
  345. <command>-fs NAMENODE -ls hdfs:///user/</command>
  346. </test-commands>
  347. <cleanup-commands>
  348. <command>-fs NAMENODE -rm hdfs:///user/dir*</command>
  349. </cleanup-commands>
  350. <comparators>
  351. <comparator>
  352. <type>RegexpComparator</type>
  353. <expected-output>Found [0-9] items</expected-output>
  354. </comparator>
  355. <comparator>
  356. <type>RegexpComparator</type>
  357. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///user/dir1</expected-output>
  358. </comparator>
  359. <comparator>
  360. <type>RegexpComparator</type>
  361. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///user/dir2</expected-output>
  362. </comparator>
  363. <comparator>
  364. <type>RegexpComparator</type>
  365. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///user/dir3</expected-output>
  366. </comparator>
  367. </comparators>
  368. </test>
  369. <test> <!-- TESTED -->
  370. <description>ls: non-existent file/directory at hdfs:// path </description>
  371. <test-commands>
  372. <command>-fs NAMENODE -ls hdfs:///file1</command>
  373. </test-commands>
  374. <cleanup-commands>
  375. <!-- no cleanup -->
  376. </cleanup-commands>
  377. <comparators>
  378. <comparator>
  379. <type>RegexpComparator</type>
  380. <expected-output>^ls: `hdfs:///file1': No such file or directory</expected-output>
  381. </comparator>
  382. </comparators>
  383. </test>
  384. <test> <!-- TESTED -->
  385. <description>ls: non-existent file/directory in Namenode's path </description>
  386. <test-commands>
  387. <command>-fs NAMENODE -ls NAMENODE/file1</command>
  388. </test-commands>
  389. <cleanup-commands>
  390. <!-- no cleanup -->
  391. </cleanup-commands>
  392. <comparators>
  393. <comparator>
  394. <type>RegexpComparator</type>
  395. <expected-output>^ls: `hdfs://\w+[-.a-z0-9]*:[0-9]+/file1': No such file or directory</expected-output>
  396. </comparator>
  397. </comparators>
  398. </test>
  399. <test> <!-- TESTED -->
  400. <description>ls: whitespaces in an absolute path to a file</description>
  401. <test-commands>
  402. <command>-fs NAMENODE -mkdir -p "/a path with/whitespaces in directories"</command>
  403. <command>-fs NAMENODE -touchz "/a path with/whitespaces in directories/and file names"</command>
  404. <command>-fs NAMENODE -ls "/a path with/whitespaces in directories"</command>
  405. </test-commands>
  406. <cleanup-commands>
  407. <command>-fs NAMENODE -rm -r "/a path with"</command>
  408. </cleanup-commands>
  409. <comparators>
  410. <comparator>
  411. <type>RegexpComparator</type>
  412. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/a path with/whitespaces in directories/and file names</expected-output>
  413. </comparator>
  414. </comparators>
  415. </test>
  416. <test> <!-- TESTED -->
  417. <description>ls: whitespaces in a relative path to a file</description>
  418. <test-commands>
  419. <command>-fs NAMENODE -mkdir -p "a path with/whitespaces in directories"</command>
  420. <command>-fs NAMENODE -touchz "a path with/whitespaces in directories/and file names"</command>
  421. <command>-fs NAMENODE -ls "a path with/whitespaces in directories"</command>
  422. </test-commands>
  423. <cleanup-commands>
  424. <command>-fs NAMENODE -rm -r "a path with"</command>
  425. </cleanup-commands>
  426. <comparators>
  427. <comparator>
  428. <type>RegexpComparator</type>
  429. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*a path with/whitespaces in directories/and file names</expected-output>
  430. </comparator>
  431. </comparators>
  432. </test>
  433. <test> <!-- TESTED -->
  434. <description>ls: whitespaces in a scheme-qualified path to a file</description>
  435. <test-commands>
  436. <command>-fs NAMENODE -mkdir -p "NAMENODE/a path with/whitespaces in directories"</command>
  437. <command>-fs NAMENODE -touchz "NAMENODE/a path with/whitespaces in directories/and file names"</command>
  438. <command>-fs NAMENODE -ls "NAMENODE/a path with/whitespaces in directories"</command>
  439. </test-commands>
  440. <cleanup-commands>
  441. <command>-fs NAMENODE -rm -r "NAMENODE/a path with"</command>
  442. </cleanup-commands>
  443. <comparators>
  444. <comparator>
  445. <type>RegexpComparator</type>
  446. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/a path with/whitespaces in directories/and file names</expected-output>
  447. </comparator>
  448. </comparators>
  449. </test>
  450. <test> <!-- TESTED -->
  451. <description>ls: whitespaces in an absolute path to a file, using globbing</description>
  452. <test-commands>
  453. <command>-fs NAMENODE -mkdir -p "/a path with/whitespaces in directories"</command>
  454. <command>-fs NAMENODE -touchz "/a path with/whitespaces in directories/and file names"</command>
  455. <command>-fs NAMENODE -touchz "/a path with/whitespaces in directories/and file names 2"</command>
  456. <command>-fs NAMENODE -ls "/a*/w*"</command>
  457. </test-commands>
  458. <cleanup-commands>
  459. <command>-fs NAMENODE -rm -r "/a path with"</command>
  460. </cleanup-commands>
  461. <comparators>
  462. <comparator>
  463. <type>TokenComparator</type>
  464. <expected-output>Found 2 items</expected-output>
  465. </comparator>
  466. <comparator>
  467. <type>RegexpComparator</type>
  468. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/a path with/whitespaces in directories/and file names</expected-output>
  469. </comparator>
  470. <comparator>
  471. <type>RegexpComparator</type>
  472. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/a path with/whitespaces in directories/and file names 2</expected-output>
  473. </comparator>
  474. </comparators>
  475. </test>
  476. <test> <!-- TESTED -->
  477. <description>ls: whitespaces in a relative path to a file, using globbing</description>
  478. <test-commands>
  479. <command>-fs NAMENODE -mkdir -p "a path with/whitespaces in directories"</command>
  480. <command>-fs NAMENODE -touchz "a path with/whitespaces in directories/and file names"</command>
  481. <command>-fs NAMENODE -touchz "a path with/whitespaces in directories/and file names 2"</command>
  482. <command>-fs NAMENODE -ls "a*/w*"</command>
  483. </test-commands>
  484. <cleanup-commands>
  485. <command>-fs NAMENODE -rm -r "a path with"</command>
  486. </cleanup-commands>
  487. <comparators>
  488. <comparator>
  489. <type>TokenComparator</type>
  490. <expected-output>Found 2 items</expected-output>
  491. </comparator>
  492. <comparator>
  493. <type>RegexpComparator</type>
  494. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*a path with/whitespaces in directories/and file names</expected-output>
  495. </comparator>
  496. <comparator>
  497. <type>RegexpComparator</type>
  498. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*a path with/whitespaces in directories/and file names 2</expected-output>
  499. </comparator>
  500. </comparators>
  501. </test>
  502. <test> <!-- TESTED -->
  503. <description>ls: whitespaces in a scheme-qualified path to a file, using globbing</description>
  504. <test-commands>
  505. <command>-fs NAMENODE -mkdir -p "NAMENODE/a path with/whitespaces in directories"</command>
  506. <command>-fs NAMENODE -touchz "NAMENODE/a path with/whitespaces in directories/and file names"</command>
  507. <command>-fs NAMENODE -touchz "NAMENODE/a path with/whitespaces in directories/and file names 2"</command>
  508. <command>-fs NAMENODE -ls "NAMENODE/a*/w*"</command>
  509. </test-commands>
  510. <cleanup-commands>
  511. <command>-fs NAMENODE -rm -r "NAMENODE/a path with"</command>
  512. </cleanup-commands>
  513. <comparators>
  514. <comparator>
  515. <type>TokenComparator</type>
  516. <expected-output>Found 2 items</expected-output>
  517. </comparator>
  518. <comparator>
  519. <type>RegexpComparator</type>
  520. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/a path with/whitespaces in directories/and file names</expected-output>
  521. </comparator>
  522. <comparator>
  523. <type>RegexpComparator</type>
  524. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/a path with/whitespaces in directories/and file names 2</expected-output>
  525. </comparator>
  526. </comparators>
  527. </test>
  528. <!-- Tests for ls -R -->
  529. <test> <!-- TESTED -->
  530. <description>ls: files/directories using absolute path</description>
  531. <test-commands>
  532. <command>-fs NAMENODE -mkdir /dir0</command>
  533. <command>-fs NAMENODE -mkdir /dir0/dir1</command>
  534. <command>-fs NAMENODE -mkdir /dir0/dir1/dir1</command>
  535. <command>-fs NAMENODE -mkdir /dir0/dir1/dir2</command>
  536. <command>-fs NAMENODE -mkdir /dir0/dir2</command>
  537. <command>-fs NAMENODE -mkdir /dir0/dir2/dir1</command>
  538. <command>-fs NAMENODE -mkdir /dir0/dir2/dir2</command>
  539. <command>-fs NAMENODE -touchz /dir0/file0</command>
  540. <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
  541. <command>-fs NAMENODE -touchz /dir0/dir1/file2</command>
  542. <command>-fs NAMENODE -touchz /dir0/dir2/file1</command>
  543. <command>-fs NAMENODE -touchz /dir0/dir2/file2</command>
  544. <command>-fs NAMENODE -touchz /dir0/dir1/dir1/file1</command>
  545. <command>-fs NAMENODE -touchz /dir0/dir1/dir1/file2</command>
  546. <command>-fs NAMENODE -touchz /dir0/dir2/dir2/file1</command>
  547. <command>-fs NAMENODE -touchz /dir0/dir2/dir2/file2</command>
  548. <command>-fs NAMENODE -ls -R /dir0</command>
  549. </test-commands>
  550. <cleanup-commands>
  551. <command>-fs NAMENODE -rm -r /dir0</command>
  552. </cleanup-commands>
  553. <comparators>
  554. <comparator>
  555. <type>RegexpComparator</type>
  556. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1</expected-output>
  557. </comparator>
  558. <comparator>
  559. <type>RegexpComparator</type>
  560. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir2</expected-output>
  561. </comparator>
  562. <comparator>
  563. <type>RegexpComparator</type>
  564. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/dir1</expected-output>
  565. </comparator>
  566. <comparator>
  567. <type>RegexpComparator</type>
  568. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/dir2</expected-output>
  569. </comparator>
  570. <comparator>
  571. <type>RegexpComparator</type>
  572. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir2/dir1</expected-output>
  573. </comparator>
  574. <comparator>
  575. <type>RegexpComparator</type>
  576. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir2/dir2</expected-output>
  577. </comparator>
  578. <comparator>
  579. <type>RegexpComparator</type>
  580. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file0</expected-output>
  581. </comparator>
  582. <comparator>
  583. <type>RegexpComparator</type>
  584. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file1</expected-output>
  585. </comparator>
  586. <comparator>
  587. <type>RegexpComparator</type>
  588. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file2</expected-output>
  589. </comparator>
  590. <comparator>
  591. <type>RegexpComparator</type>
  592. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir2/file1</expected-output>
  593. </comparator>
  594. <comparator>
  595. <type>RegexpComparator</type>
  596. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir2/file2</expected-output>
  597. </comparator>
  598. <comparator>
  599. <type>RegexpComparator</type>
  600. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/dir1/file1</expected-output>
  601. </comparator>
  602. <comparator>
  603. <type>RegexpComparator</type>
  604. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/dir1/file2</expected-output>
  605. </comparator>
  606. <comparator>
  607. <type>RegexpComparator</type>
  608. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir2/dir2/file1</expected-output>
  609. </comparator>
  610. <comparator>
  611. <type>RegexpComparator</type>
  612. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir2/dir2/file2</expected-output>
  613. </comparator>
  614. </comparators>
  615. </test>
  616. <test> <!-- TESTED -->
  617. <description>ls: files/directories using relative path</description>
  618. <test-commands>
  619. <command>-fs NAMENODE -mkdir -p dir0</command>
  620. <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
  621. <command>-fs NAMENODE -mkdir -p dir0/dir1/dir1</command>
  622. <command>-fs NAMENODE -mkdir -p dir0/dir1/dir2</command>
  623. <command>-fs NAMENODE -mkdir -p dir0/dir2</command>
  624. <command>-fs NAMENODE -mkdir -p dir0/dir2/dir1</command>
  625. <command>-fs NAMENODE -mkdir -p dir0/dir2/dir2</command>
  626. <command>-fs NAMENODE -touchz dir0/file0</command>
  627. <command>-fs NAMENODE -touchz dir0/dir1/file1</command>
  628. <command>-fs NAMENODE -touchz dir0/dir1/file2</command>
  629. <command>-fs NAMENODE -touchz dir0/dir2/file1</command>
  630. <command>-fs NAMENODE -touchz dir0/dir2/file2</command>
  631. <command>-fs NAMENODE -touchz dir0/dir1/dir1/file1</command>
  632. <command>-fs NAMENODE -touchz dir0/dir1/dir1/file2</command>
  633. <command>-fs NAMENODE -touchz dir0/dir2/dir2/file1</command>
  634. <command>-fs NAMENODE -touchz dir0/dir2/dir2/file2</command>
  635. <command>-fs NAMENODE -ls -R dir0</command>
  636. </test-commands>
  637. <cleanup-commands>
  638. <command>-fs NAMENODE -rm -r /user</command>
  639. </cleanup-commands>
  640. <comparators>
  641. <comparator>
  642. <type>RegexpComparator</type>
  643. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1</expected-output>
  644. </comparator>
  645. <comparator>
  646. <type>RegexpComparator</type>
  647. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir2</expected-output>
  648. </comparator>
  649. <comparator>
  650. <type>RegexpComparator</type>
  651. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/dir1</expected-output>
  652. </comparator>
  653. <comparator>
  654. <type>RegexpComparator</type>
  655. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/dir2</expected-output>
  656. </comparator>
  657. <comparator>
  658. <type>RegexpComparator</type>
  659. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir2/dir1</expected-output>
  660. </comparator>
  661. <comparator>
  662. <type>RegexpComparator</type>
  663. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir2/dir2</expected-output>
  664. </comparator>
  665. <comparator>
  666. <type>RegexpComparator</type>
  667. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/file0</expected-output>
  668. </comparator>
  669. <comparator>
  670. <type>RegexpComparator</type>
  671. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file1</expected-output>
  672. </comparator>
  673. <comparator>
  674. <type>RegexpComparator</type>
  675. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file2</expected-output>
  676. </comparator>
  677. <comparator>
  678. <type>RegexpComparator</type>
  679. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir2/file1</expected-output>
  680. </comparator>
  681. <comparator>
  682. <type>RegexpComparator</type>
  683. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir2/file2</expected-output>
  684. </comparator>
  685. <comparator>
  686. <type>RegexpComparator</type>
  687. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/dir1/file1</expected-output>
  688. </comparator>
  689. <comparator>
  690. <type>RegexpComparator</type>
  691. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/dir1/file2</expected-output>
  692. </comparator>
  693. <comparator>
  694. <type>RegexpComparator</type>
  695. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir2/dir2/file1</expected-output>
  696. </comparator>
  697. <comparator>
  698. <type>RegexpComparator</type>
  699. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir2/dir2/file2</expected-output>
  700. </comparator>
  701. </comparators>
  702. </test>
  703. <test> <!-- TESTED -->
  704. <description>ls: files/directories using globbing</description>
  705. <test-commands>
  706. <command>-fs NAMENODE -mkdir -p dir0</command>
  707. <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
  708. <command>-fs NAMENODE -mkdir -p dir0/dir1/dir1</command>
  709. <command>-fs NAMENODE -mkdir -p dir0/dir1/dir2</command>
  710. <command>-fs NAMENODE -mkdir -p dir0/dir2</command>
  711. <command>-fs NAMENODE -mkdir -p dir0/dir2/dir1</command>
  712. <command>-fs NAMENODE -mkdir -p dir0/dir2/dir2</command>
  713. <command>-fs NAMENODE -touchz dir0/file0</command>
  714. <command>-fs NAMENODE -touchz dir0/dir1/file1</command>
  715. <command>-fs NAMENODE -touchz dir0/dir1/file2</command>
  716. <command>-fs NAMENODE -touchz dir0/dir2/file1</command>
  717. <command>-fs NAMENODE -touchz dir0/dir2/file2</command>
  718. <command>-fs NAMENODE -touchz dir0/dir1/dir1/file1</command>
  719. <command>-fs NAMENODE -touchz dir0/dir1/dir1/file2</command>
  720. <command>-fs NAMENODE -touchz dir0/dir2/dir2/file1</command>
  721. <command>-fs NAMENODE -touchz dir0/dir2/dir2/file2</command>
  722. <command>-fs NAMENODE -ls -R dir0/*</command>
  723. </test-commands>
  724. <cleanup-commands>
  725. <command>-fs NAMENODE -rm -r /user</command>
  726. </cleanup-commands>
  727. <comparators>
  728. <!-- JIRA?
  729. <comparator>
  730. <type>RegexpComparator</type>
  731. <expected-output>^/user/[a-zA-z0-9]*/dir0/dir1</expected-output>
  732. </comparator>
  733. <comparator>
  734. <type>RegexpComparator</type>
  735. <expected-output>^/user/[a-zA-z0-9]*/dir0/dir2</expected-output>
  736. </comparator>
  737. -->
  738. <comparator>
  739. <type>RegexpComparator</type>
  740. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/dir1</expected-output>
  741. </comparator>
  742. <comparator>
  743. <type>RegexpComparator</type>
  744. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/dir2</expected-output>
  745. </comparator>
  746. <comparator>
  747. <type>RegexpComparator</type>
  748. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir2/dir1</expected-output>
  749. </comparator>
  750. <comparator>
  751. <type>RegexpComparator</type>
  752. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir2/dir2</expected-output>
  753. </comparator>
  754. <comparator>
  755. <type>RegexpComparator</type>
  756. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/file0</expected-output>
  757. </comparator>
  758. <comparator>
  759. <type>RegexpComparator</type>
  760. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file1</expected-output>
  761. </comparator>
  762. <comparator>
  763. <type>RegexpComparator</type>
  764. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file2</expected-output>
  765. </comparator>
  766. <comparator>
  767. <type>RegexpComparator</type>
  768. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir2/file1</expected-output>
  769. </comparator>
  770. <comparator>
  771. <type>RegexpComparator</type>
  772. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir2/file2</expected-output>
  773. </comparator>
  774. <comparator>
  775. <type>RegexpComparator</type>
  776. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/dir1/file1</expected-output>
  777. </comparator>
  778. <comparator>
  779. <type>RegexpComparator</type>
  780. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/dir1/file2</expected-output>
  781. </comparator>
  782. <comparator>
  783. <type>RegexpComparator</type>
  784. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir2/dir2/file1</expected-output>
  785. </comparator>
  786. <comparator>
  787. <type>RegexpComparator</type>
  788. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir2/dir2/file2</expected-output>
  789. </comparator>
  790. </comparators>
  791. </test>
  792. <test> <!-- TESTED -->
  793. <description>ls: file/directory that does not exist in /</description>
  794. <test-commands>
  795. <command>-fs NAMENODE -ls -R /file1</command>
  796. </test-commands>
  797. <cleanup-commands>
  798. </cleanup-commands>
  799. <comparators>
  800. <comparator>
  801. <type>RegexpComparator</type>
  802. <expected-output>^ls: `/file1': No such file or directory</expected-output>
  803. </comparator>
  804. </comparators>
  805. </test>
  806. <test> <!-- TESTED -->
  807. <description>ls: file/directory that does not exist in home directory (/user/username)</description>
  808. <test-commands>
  809. <command>-fs NAMENODE -ls -R /user</command>
  810. </test-commands>
  811. <cleanup-commands>
  812. </cleanup-commands>
  813. <comparators>
  814. <comparator>
  815. <type>RegexpComparator</type>
  816. <expected-output>^ls: `/user': No such file or directory</expected-output>
  817. </comparator>
  818. </comparators>
  819. </test>
  820. <test> <!-- TESTED -->
  821. <description>ls: dir at hdfs:// path</description>
  822. <test-commands>
  823. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  824. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
  825. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  826. <command>-fs NAMENODE -touchz hdfs:///dir0/file1</command>
  827. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file1</command>
  828. <command>-fs NAMENODE -ls -R hdfs:///</command>
  829. </test-commands>
  830. <cleanup-commands>
  831. <command>-fs NAMENODE -rm hdfs:///dir0</command>
  832. <command>-fs NAMENODE -rm hdfs:///file1</command>
  833. </cleanup-commands>
  834. <comparators>
  835. <comparator>
  836. <type>RegexpComparator</type>
  837. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0</expected-output>
  838. </comparator>
  839. <comparator>
  840. <type>RegexpComparator</type>
  841. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1</expected-output>
  842. </comparator>
  843. <comparator>
  844. <type>RegexpComparator</type>
  845. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file1</expected-output>
  846. </comparator>
  847. <comparator>
  848. <type>RegexpComparator</type>
  849. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file1</expected-output>
  850. </comparator>
  851. <comparator>
  852. <type>RegexpComparator</type>
  853. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file1</expected-output>
  854. </comparator>
  855. </comparators>
  856. </test>
  857. <test> <!-- TESTED -->
  858. <description>ls: files/directories in hdfs:// path using globbing</description>
  859. <test-commands>
  860. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  861. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
  862. <command>-fs NAMENODE -touchz hdfs:///dir0/file1</command>
  863. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file1</command>
  864. <command>-fs NAMENODE -ls -R hdfs:///dir0/*</command>
  865. </test-commands>
  866. <cleanup-commands>
  867. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  868. </cleanup-commands>
  869. <comparators>
  870. <comparator>
  871. <type>RegexpComparator</type>
  872. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file1</expected-output>
  873. </comparator>
  874. <comparator>
  875. <type>RegexpComparator</type>
  876. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file1</expected-output>
  877. </comparator>
  878. </comparators>
  879. </test>
  880. <test> <!-- TESTED -->
  881. <description>ls: Non-existent file/directory in hdfs:// path</description>
  882. <test-commands>
  883. <command>-fs NAMENODE -ls -R hdfs:///file1</command>
  884. </test-commands>
  885. <cleanup-commands>
  886. </cleanup-commands>
  887. <comparators>
  888. <comparator>
  889. <type>RegexpComparator</type>
  890. <expected-output>^ls: `hdfs:///file1': No such file or directory</expected-output>
  891. </comparator>
  892. </comparators>
  893. </test>
  894. <test> <!-- TESTED -->
  895. <description>ls: dir at Namenode's path</description>
  896. <test-commands>
  897. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  898. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1</command>
  899. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  900. <command>-fs NAMENODE -touchz NAMENODE/dir0/file1</command>
  901. <command>-fs NAMENODE -touchz NAMENODE/dir0/dir1/file1</command>
  902. <command>-fs NAMENODE -ls -R NAMENODE/</command>
  903. </test-commands>
  904. <cleanup-commands>
  905. <command>-fs NAMENODE -rm hdfs:///dir0</command>
  906. <command>-fs NAMENODE -rm hdfs:///file1</command>
  907. </cleanup-commands>
  908. <comparators>
  909. <comparator>
  910. <type>RegexpComparator</type>
  911. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0</expected-output>
  912. </comparator>
  913. <comparator>
  914. <type>RegexpComparator</type>
  915. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/dir1</expected-output>
  916. </comparator>
  917. <comparator>
  918. <type>RegexpComparator</type>
  919. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file1</expected-output>
  920. </comparator>
  921. <comparator>
  922. <type>RegexpComparator</type>
  923. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/file1</expected-output>
  924. </comparator>
  925. <comparator>
  926. <type>RegexpComparator</type>
  927. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/dir1/file1</expected-output>
  928. </comparator>
  929. </comparators>
  930. </test>
  931. <test> <!-- TESTED -->
  932. <description>ls: Non-URI input files/directories in Namenode's path </description>
  933. <test-commands>
  934. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  935. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1</command>
  936. <command>-fs NAMENODE -touchz NAMENODE/dir0/file1</command>
  937. <command>-fs NAMENODE -touchz NAMENODE/dir0/dir1/file1</command>
  938. <command>-fs NAMENODE -ls -R NAMENODE/dir0/*</command>
  939. </test-commands>
  940. <cleanup-commands>
  941. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  942. </cleanup-commands>
  943. <comparators>
  944. <comparator>
  945. <type>RegexpComparator</type>
  946. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/file1</expected-output>
  947. </comparator>
  948. <comparator>
  949. <type>RegexpComparator</type>
  950. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/dir1/file1</expected-output>
  951. </comparator>
  952. </comparators>
  953. </test>
  954. <test> <!-- TESTED -->
  955. <description>ls: Non-URI input for non-existent file/directory in Namenode's path </description>
  956. <test-commands>
  957. <command>-fs NAMENODE -ls -R NAMENODE/file1</command>
  958. </test-commands>
  959. <cleanup-commands>
  960. </cleanup-commands>
  961. <comparators>
  962. <comparator>
  963. <type>RegexpComparator</type>
  964. <expected-output>^ls: `hdfs://\w+[-.a-z0-9]*:[0-9]+/file1': No such file or directory</expected-output>
  965. </comparator>
  966. </comparators>
  967. </test>
  968. <test> <!-- TESTED -->
  969. <description>ls: Negative test for quoted /*/* globbing </description>
  970. <windows>false</windows>
  971. <test-commands>
  972. <command>-fs NAMENODE -mkdir /dir0</command>
  973. <command>-fs NAMENODE -mkdir /dir0/dir1</command>
  974. <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
  975. <command>-fs NAMENODE -ls -R /\*/\*</command>
  976. </test-commands>
  977. <cleanup-commands>
  978. <command>-fs NAMENODE -rm -r /dir0</command>
  979. </cleanup-commands>
  980. <comparators>
  981. <comparator>
  982. <type>TokenComparator</type>
  983. <expected-output>ls: `/*/*': No such file or directory</expected-output>
  984. </comparator>
  985. </comparators>
  986. </test>
  987. <test> <!-- TESTED -->
  988. <description>ls: Test for quoted globbing </description>
  989. <windows>false</windows>
  990. <test-commands>
  991. <command>-fs NAMENODE -mkdir /dir0</command>
  992. <command>-fs NAMENODE -mkdir /dir0/\*</command>
  993. <command>-fs NAMENODE -touchz /dir0/\*/file</command>
  994. <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
  995. <command>-fs NAMENODE -ls -R /dir0/\*</command>
  996. </test-commands>
  997. <cleanup-commands>
  998. <command>-fs NAMENODE -rm -r /dir0</command>
  999. </cleanup-commands>
  1000. <comparators>
  1001. <comparator>
  1002. <type>RegexpComparator</type>
  1003. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/\*/file</expected-output>
  1004. </comparator>
  1005. </comparators>
  1006. </test>
  1007. <test> <!-- TESTED -->
  1008. <description>rm: Test for quoted globbing </description>
  1009. <windows>false</windows>
  1010. <test-commands>
  1011. <command>-fs NAMENODE -mkdir /dir0</command>
  1012. <command>-fs NAMENODE -mkdir /dir0/\*</command>
  1013. <command>-fs NAMENODE -touchz /dir0/\*/file</command>
  1014. <command>-fs NAMENODE -mkdir /dir0/dir1/</command>
  1015. <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
  1016. <command>-fs NAMENODE -rm -r /dir0/\*</command>
  1017. <command>-fs NAMENODE -ls -R /dir0</command>
  1018. </test-commands>
  1019. <cleanup-commands>
  1020. <command>-fs NAMENODE -rm -r /dir0</command>
  1021. </cleanup-commands>
  1022. <comparators>
  1023. <comparator>
  1024. <type>RegexpComparator</type>
  1025. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1</expected-output>
  1026. </comparator>
  1027. <comparator>
  1028. <type>RegexpComparator</type>
  1029. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file1</expected-output>
  1030. </comparator>
  1031. </comparators>
  1032. </test>
  1033. <!-- Tests for du -->
  1034. <test> <!-- TESTED -->
  1035. <description>du: file using absolute path</description>
  1036. <test-commands>
  1037. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /data15bytes</command>
  1038. <command>-fs NAMENODE -du /data15bytes</command>
  1039. </test-commands>
  1040. <cleanup-commands>
  1041. <command>-fs NAMENODE -rm /data15bytes</command>
  1042. </cleanup-commands>
  1043. <comparators>
  1044. <comparator>
  1045. <type>RegexpComparator</type>
  1046. <expected-output>^15\s+15\s+/data15bytes</expected-output>
  1047. </comparator>
  1048. </comparators>
  1049. </test>
  1050. <test> <!-- TESTED -->
  1051. <description>du: file using relative path</description>
  1052. <test-commands>
  1053. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  1054. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes data15bytesZZ</command>
  1055. <command>-fs NAMENODE -du data15bytesZZ</command>
  1056. </test-commands>
  1057. <cleanup-commands>
  1058. <command>-fs NAMENODE -rm data15bytesZZ</command>
  1059. </cleanup-commands>
  1060. <comparators>
  1061. <comparator>
  1062. <type>RegexpComparator</type>
  1063. <expected-output>^15\s+15\s+data15bytesZZ</expected-output>
  1064. </comparator>
  1065. </comparators>
  1066. </test>
  1067. <test> <!-- TESTED -->
  1068. <description>du: files using globbing</description>
  1069. <test-commands>
  1070. <command>-fs NAMENODE -mkdir -p CLITEST_DATA</command>
  1071. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes data15bytes</command>
  1072. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes data30bytes</command>
  1073. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes data60bytes</command>
  1074. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes data120bytes</command>
  1075. <command>-fs NAMENODE -du data*</command>
  1076. </test-commands>
  1077. <cleanup-commands>
  1078. <command>-fs NAMENODE -rm data*bytes</command>
  1079. </cleanup-commands>
  1080. <comparators>
  1081. <comparator>
  1082. <type>RegexpComparator</type>
  1083. <expected-output>^120\s+120\s+data120bytes</expected-output>
  1084. </comparator>
  1085. <comparator>
  1086. <type>RegexpComparator</type>
  1087. <expected-output>^15\s+15\s+data15bytes</expected-output>
  1088. </comparator>
  1089. <comparator>
  1090. <type>RegexpComparator</type>
  1091. <expected-output>^30\s+30\s+data30bytes</expected-output>
  1092. </comparator>
  1093. <comparator>
  1094. <type>RegexpComparator</type>
  1095. <expected-output>^60\s+60\s+data60bytes</expected-output>
  1096. </comparator>
  1097. </comparators>
  1098. </test>
  1099. <test> <!-- TESTED -->
  1100. <description>du: directory using absolute path</description>
  1101. <test-commands>
  1102. <command>-fs NAMENODE -mkdir /dir0</command>
  1103. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/data15bytes</command>
  1104. <command>-fs NAMENODE -du /dir0</command>
  1105. </test-commands>
  1106. <cleanup-commands>
  1107. <command>-fs NAMENODE -rm -r /dir0</command>
  1108. </cleanup-commands>
  1109. <comparators>
  1110. <comparator>
  1111. <type>RegexpComparator</type>
  1112. <expected-output>^15\s+15\s+/dir0/data15bytes</expected-output>
  1113. </comparator>
  1114. </comparators>
  1115. </test>
  1116. <test> <!-- TESTED -->
  1117. <description>du: directory using relative path</description>
  1118. <test-commands>
  1119. <command>-fs NAMENODE -mkdir -p dir0</command>
  1120. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes dir0/data15bytes</command>
  1121. <command>-fs NAMENODE -du dir0</command>
  1122. </test-commands>
  1123. <cleanup-commands>
  1124. <command>-fs NAMENODE -rm -r /user</command>
  1125. </cleanup-commands>
  1126. <comparators>
  1127. <comparator>
  1128. <type>RegexpComparator</type>
  1129. <expected-output>^15\s+15\s+dir0/data15bytes</expected-output>
  1130. </comparator>
  1131. </comparators>
  1132. </test>
  1133. <test> <!-- TESTED -->
  1134. <description>du: directory using globbing</description>
  1135. <test-commands>
  1136. <command>-fs NAMENODE -mkdir /dir0</command>
  1137. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/data15bytes</command>
  1138. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /dir0/data30bytes</command>
  1139. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /dir0/data60bytes</command>
  1140. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes /dir0/data120bytes</command>
  1141. <command>-fs NAMENODE -du /dir0/*</command>
  1142. </test-commands>
  1143. <cleanup-commands>
  1144. <command>-fs NAMENODE -rm -r /dir0</command>
  1145. </cleanup-commands>
  1146. <comparators>
  1147. <comparator>
  1148. <type>RegexpComparator</type>
  1149. <expected-output>^15( |\t)*15( |\t)*/dir0/data15bytes</expected-output>
  1150. </comparator>
  1151. <comparator>
  1152. <type>RegexpComparator</type>
  1153. <expected-output>^30( |\t)*30( |\t)*/dir0/data30bytes</expected-output>
  1154. </comparator>
  1155. <comparator>
  1156. <type>RegexpComparator</type>
  1157. <expected-output>^60( |\t)*60( |\t)*/dir0/data60bytes</expected-output>
  1158. </comparator>
  1159. <comparator>
  1160. <type>RegexpComparator</type>
  1161. <expected-output>^120( |\t)*120( |\t)*/dir0/data120bytes</expected-output>
  1162. </comparator>
  1163. </comparators>
  1164. </test>
  1165. <test> <!-- TESTED -->
  1166. <description>du: Test for hdfs:// path - file</description>
  1167. <test-commands>
  1168. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///data15bytes</command>
  1169. <command>-fs NAMENODE -du hdfs:///data15bytes</command>
  1170. </test-commands>
  1171. <cleanup-commands>
  1172. <command>-fs NAMENODE -rm hdfs:///data15bytes</command>
  1173. </cleanup-commands>
  1174. <comparators>
  1175. <comparator>
  1176. <type>RegexpComparator</type>
  1177. <expected-output>^15\s+15\s+hdfs:///data15bytes</expected-output>
  1178. </comparator>
  1179. </comparators>
  1180. </test>
  1181. <test> <!-- TESTED -->
  1182. <description>du: Test for hdfs:// path - files using globbing</description>
  1183. <test-commands>
  1184. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///data15bytes</command>
  1185. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes hdfs:///data30bytes</command>
  1186. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///data60bytes</command>
  1187. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes hdfs:///data120bytes</command>
  1188. <command>-fs NAMENODE -du hdfs:///data*</command>
  1189. </test-commands>
  1190. <cleanup-commands>
  1191. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  1192. </cleanup-commands>
  1193. <comparators>
  1194. <comparator>
  1195. <type>RegexpComparator</type>
  1196. <expected-output>^120\s+120\s+hdfs:///data120bytes</expected-output>
  1197. </comparator>
  1198. <comparator>
  1199. <type>RegexpComparator</type>
  1200. <expected-output>^15\s+15\s+hdfs:///data15bytes</expected-output>
  1201. </comparator>
  1202. <comparator>
  1203. <type>RegexpComparator</type>
  1204. <expected-output>^30\s+30\s+hdfs:///data30bytes</expected-output>
  1205. </comparator>
  1206. <comparator>
  1207. <type>RegexpComparator</type>
  1208. <expected-output>^60\s+60\s+hdfs:///data60bytes</expected-output>
  1209. </comparator>
  1210. </comparators>
  1211. </test>
  1212. <test> <!-- TESTED -->
  1213. <description>du: Test for hdfs:// path - directory</description>
  1214. <test-commands>
  1215. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  1216. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///dir0/data15bytes</command>
  1217. <command>-fs NAMENODE -du hdfs:///dir0</command>
  1218. </test-commands>
  1219. <cleanup-commands>
  1220. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  1221. </cleanup-commands>
  1222. <comparators>
  1223. <comparator>
  1224. <type>RegexpComparator</type>
  1225. <expected-output>^15\s+15\s+hdfs:///dir0/data15bytes</expected-output>
  1226. </comparator>
  1227. </comparators>
  1228. </test>
  1229. <test> <!-- TESTED -->
  1230. <description>duh: Test for hdfs:// path - directory</description>
  1231. <test-commands>
  1232. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  1233. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///dir0/data15bytes</command>
  1234. <command>-fs NAMENODE -put CLITEST_DATA/data1k hdfs:///dir0/data1k</command>
  1235. <command>-fs NAMENODE -du -h hdfs:///dir0</command>
  1236. </test-commands>
  1237. <cleanup-commands>
  1238. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  1239. </cleanup-commands>
  1240. <comparators>
  1241. <comparator>
  1242. <type>RegexpComparator</type>
  1243. <expected-output>^15\s+15\s+hdfs:///dir0/data15bytes</expected-output>
  1244. </comparator>
  1245. <comparator>
  1246. <type>RegexpComparator</type>
  1247. <expected-output>^1\.0 K\s+1\.0 K\s+hdfs:///dir0/data1k</expected-output>
  1248. </comparator>
  1249. </comparators>
  1250. </test>
  1251. <test> <!-- TESTED -->
  1252. <description>du: Test for hdfs:// path - directory using globbing</description>
  1253. <test-commands>
  1254. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  1255. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///dir0/data15bytes</command>
  1256. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes hdfs:///dir0/data30bytes</command>
  1257. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///dir0/data60bytes</command>
  1258. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes hdfs:///dir0/data120bytes</command>
  1259. <command>-fs NAMENODE -du hdfs:///dir0/*</command>
  1260. </test-commands>
  1261. <cleanup-commands>
  1262. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  1263. </cleanup-commands>
  1264. <comparators>
  1265. <comparator>
  1266. <type>RegexpComparator</type>
  1267. <expected-output>^15( |\t)*15( |\t)*hdfs:///dir0/data15bytes</expected-output>
  1268. </comparator>
  1269. <comparator>
  1270. <type>RegexpComparator</type>
  1271. <expected-output>^30( |\t)*30( |\t)*hdfs:///dir0/data30bytes</expected-output>
  1272. </comparator>
  1273. <comparator>
  1274. <type>RegexpComparator</type>
  1275. <expected-output>^60( |\t)*60( |\t)*hdfs:///dir0/data60bytes</expected-output>
  1276. </comparator>
  1277. <comparator>
  1278. <type>RegexpComparator</type>
  1279. <expected-output>^120( |\t)*120( |\t)*hdfs:///dir0/data120bytes</expected-output>
  1280. </comparator>
  1281. </comparators>
  1282. </test>
  1283. <test> <!-- TESTED -->
  1284. <description>du: Test for Namenode's path - file</description>
  1285. <test-commands>
  1286. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/data15bytes</command>
  1287. <command>-fs NAMENODE -du NAMENODE/data15bytes</command>
  1288. </test-commands>
  1289. <cleanup-commands>
  1290. <command>-fs NAMENODE -rm NAMENODE/data15bytes</command>
  1291. </cleanup-commands>
  1292. <comparators>
  1293. <comparator>
  1294. <type>RegexpComparator</type>
  1295. <expected-output>^15( |\t)*15( |\t)*NAMENODE/data15bytes</expected-output>
  1296. </comparator>
  1297. </comparators>
  1298. </test>
  1299. <test> <!-- TESTED -->
  1300. <description>du: Test for Namenode's path - files using globbing</description>
  1301. <test-commands>
  1302. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/data15bytes</command>
  1303. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes NAMENODE/data30bytes</command>
  1304. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes NAMENODE/data60bytes</command>
  1305. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes NAMENODE/data120bytes</command>
  1306. <command>-fs NAMENODE -du NAMENODE/data*</command>
  1307. </test-commands>
  1308. <cleanup-commands>
  1309. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  1310. </cleanup-commands>
  1311. <comparators>
  1312. <comparator>
  1313. <type>RegexpComparator</type>
  1314. <expected-output>^15( |\t)*15( |\t)*NAMENODE/data15bytes</expected-output>
  1315. </comparator>
  1316. <comparator>
  1317. <type>RegexpComparator</type>
  1318. <expected-output>^30( |\t)*30( |\t)*NAMENODE/data30bytes</expected-output>
  1319. </comparator>
  1320. <comparator>
  1321. <type>RegexpComparator</type>
  1322. <expected-output>^60( |\t)*60( |\t)*NAMENODE/data60bytes</expected-output>
  1323. </comparator>
  1324. <comparator>
  1325. <type>RegexpComparator</type>
  1326. <expected-output>^120( |\t)*120( |\t)*NAMENODE/data120bytes</expected-output>
  1327. </comparator>
  1328. </comparators>
  1329. </test>
  1330. <test> <!-- TESTED -->
  1331. <description>du: Test for Namenode's path - directory</description>
  1332. <test-commands>
  1333. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  1334. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/data15bytes</command>
  1335. <command>-fs NAMENODE -du NAMENODE/dir0</command>
  1336. </test-commands>
  1337. <cleanup-commands>
  1338. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  1339. </cleanup-commands>
  1340. <comparators>
  1341. <comparator>
  1342. <type>RegexpComparator</type>
  1343. <expected-output>^15( |\t)*15( |\t)*NAMENODE/dir0/data15bytes</expected-output>
  1344. </comparator>
  1345. </comparators>
  1346. </test>
  1347. <test> <!-- TESTED -->
  1348. <description>du: Test for Namenode's path - directory using globbing</description>
  1349. <test-commands>
  1350. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  1351. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/data15bytes</command>
  1352. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes NAMENODE/dir0/data30bytes</command>
  1353. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes NAMENODE/dir0/data60bytes</command>
  1354. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes NAMENODE/dir0/data120bytes</command>
  1355. <command>-fs NAMENODE -du NAMENODE/dir0/*</command>
  1356. </test-commands>
  1357. <cleanup-commands>
  1358. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  1359. </cleanup-commands>
  1360. <comparators>
  1361. <comparator>
  1362. <type>RegexpComparator</type>
  1363. <expected-output>^15( |\t)*15( |\t)*NAMENODE/dir0/data15bytes</expected-output>
  1364. </comparator>
  1365. <comparator>
  1366. <type>RegexpComparator</type>
  1367. <expected-output>^30( |\t)*30( |\t)*NAMENODE/dir0/data30bytes</expected-output>
  1368. </comparator>
  1369. <comparator>
  1370. <type>RegexpComparator</type>
  1371. <expected-output>^60( |\t)*60( |\t)*NAMENODE/dir0/data60bytes</expected-output>
  1372. </comparator>
  1373. <comparator>
  1374. <type>RegexpComparator</type>
  1375. <expected-output>^120( |\t)*120( |\t)*NAMENODE/dir0/data120bytes</expected-output>
  1376. </comparator>
  1377. </comparators>
  1378. </test>
  1379. <!-- Tests for dus -->
  1380. <test> <!-- TESTED -->
  1381. <description>dus: directories/files using absolute path</description>
  1382. <test-commands>
  1383. <command>-fs NAMENODE -mkdir /dir0</command>
  1384. <command>-fs NAMENODE -mkdir /dir0/dir1</command>
  1385. <command>-fs NAMENODE -mkdir /dir0/dir1/dir1</command>
  1386. <command>-fs NAMENODE -mkdir /dir0/dir1/dir2</command>
  1387. <command>-fs NAMENODE -mkdir /dir0/dir2</command>
  1388. <command>-fs NAMENODE -mkdir /dir0/dir2/dir1</command>
  1389. <command>-fs NAMENODE -mkdir /dir0/dir2/dir2</command>
  1390. <command>-fs NAMENODE -touchz /dir0/file0</command>
  1391. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/dir1/data15bytes</command>
  1392. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /dir0/dir1/data30bytes</command>
  1393. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/dir2/data15bytes</command>
  1394. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /dir0/dir2/data30bytes</command>
  1395. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /dir0/dir1/dir1/data60bytes</command>
  1396. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes /dir0/dir1/dir2/data120bytes</command>
  1397. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /dir0/dir2/dir1/data60bytes</command>
  1398. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes /dir0/dir2/dir2/data120bytes</command>
  1399. <command>-fs NAMENODE -du -s /dir0</command>
  1400. </test-commands>
  1401. <cleanup-commands>
  1402. <command>-fs NAMENODE -rm -r /dir0</command>
  1403. </cleanup-commands>
  1404. <comparators>
  1405. <comparator>
  1406. <type>RegexpComparator</type>
  1407. <expected-output>^450\s+450\s+/dir0</expected-output>
  1408. </comparator>
  1409. </comparators>
  1410. </test>
  1411. <test> <!-- TESTED -->
  1412. <description>dus: directories/files using relative path</description>
  1413. <test-commands>
  1414. <command>-fs NAMENODE -mkdir -p dir0</command>
  1415. <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
  1416. <command>-fs NAMENODE -mkdir -p dir0/dir1/dir1</command>
  1417. <command>-fs NAMENODE -mkdir -p dir0/dir1/dir2</command>
  1418. <command>-fs NAMENODE -mkdir -p dir0/dir2</command>
  1419. <command>-fs NAMENODE -mkdir -p dir0/dir2/dir1</command>
  1420. <command>-fs NAMENODE -mkdir -p dir0/dir2/dir2</command>
  1421. <command>-fs NAMENODE -touchz dir0/file0</command>
  1422. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes dir0/dir1/data15bytes</command>
  1423. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes dir0/dir1/data30bytes</command>
  1424. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes dir0/dir2/data15bytes</command>
  1425. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes dir0/dir2/data30bytes</command>
  1426. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes dir0/dir1/dir1/data60bytes</command>
  1427. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes dir0/dir1/dir2/data120bytes</command>
  1428. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes dir0/dir2/dir1/data60bytes</command>
  1429. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes dir0/dir2/dir2/data120bytes</command>
  1430. <command>-fs NAMENODE -du -s dir0</command>
  1431. </test-commands>
  1432. <cleanup-commands>
  1433. <command>-fs NAMENODE -rm -r /user</command>
  1434. </cleanup-commands>
  1435. <comparators>
  1436. <comparator>
  1437. <type>RegexpComparator</type>
  1438. <expected-output>^450\s+450\s+dir0</expected-output>
  1439. </comparator>
  1440. </comparators>
  1441. </test>
  1442. <test> <!-- TESTED -->
  1443. <description>dus: directories/files using globbing</description>
  1444. <test-commands>
  1445. <command>-fs NAMENODE -mkdir /dir0</command>
  1446. <command>-fs NAMENODE -mkdir /dir0/dir1</command>
  1447. <command>-fs NAMENODE -mkdir /dir0/dir1/dir1</command>
  1448. <command>-fs NAMENODE -mkdir /dir0/dir1/dir2</command>
  1449. <command>-fs NAMENODE -mkdir /dir0/dir2</command>
  1450. <command>-fs NAMENODE -mkdir /dir0/dir2/dir1</command>
  1451. <command>-fs NAMENODE -mkdir /dir0/dir2/dir2</command>
  1452. <command>-fs NAMENODE -touchz /dir0/file0</command>
  1453. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/dir1/data15bytes</command>
  1454. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /dir0/dir1/data30bytes</command>
  1455. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/dir2/data15bytes</command>
  1456. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /dir0/dir2/data30bytes</command>
  1457. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /dir0/dir1/dir1/data60bytes</command>
  1458. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes /dir0/dir1/dir2/data120bytes</command>
  1459. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /dir0/dir2/dir1/data60bytes</command>
  1460. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes /dir0/dir2/dir2/data120bytes</command>
  1461. <command>-fs NAMENODE -mkdir /donotcountdir0</command>
  1462. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /donotcountdir0/data15bytes</command>
  1463. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /donotcountdir0/data15bytes</command>
  1464. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /donotcountdir0/data15bytes</command>
  1465. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /donotcountdir0/data15bytes</command>
  1466. <command>-fs NAMENODE -du -s /dir*</command>
  1467. </test-commands>
  1468. <cleanup-commands>
  1469. <command>-fs NAMENODE -rm -r /dir0</command>
  1470. <command>-fs NAMENODE -rm -r /donotcountdir0</command>
  1471. </cleanup-commands>
  1472. <comparators>
  1473. <comparator>
  1474. <type>RegexpComparator</type>
  1475. <expected-output>^450\s+450\s+/dir0</expected-output>
  1476. </comparator>
  1477. </comparators>
  1478. </test>
  1479. <!-- Tests for dus -->
  1480. <test> <!-- TESTED -->
  1481. <description>dus: Test for hdfs:// path - directories/files</description>
  1482. <test-commands>
  1483. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  1484. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
  1485. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1/dir1</command>
  1486. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1/dir2</command>
  1487. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir2</command>
  1488. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir2/dir1</command>
  1489. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir2/dir2</command>
  1490. <command>-fs NAMENODE -touchz hdfs:///dir0/file0</command>
  1491. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///dir0/dir1/data15bytes</command>
  1492. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes hdfs:///dir0/dir1/data30bytes</command>
  1493. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///dir0/dir2/data15bytes</command>
  1494. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes hdfs:///dir0/dir2/data30bytes</command>
  1495. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///dir0/dir1/dir1/data60bytes</command>
  1496. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes hdfs:///dir0/dir1/dir2/data120bytes</command>
  1497. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///dir0/dir2/dir1/data60bytes</command>
  1498. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes hdfs:///dir0/dir2/dir2/data120bytes</command>
  1499. <command>-fs NAMENODE -du -s hdfs:///dir0</command>
  1500. </test-commands>
  1501. <cleanup-commands>
  1502. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  1503. </cleanup-commands>
  1504. <comparators>
  1505. <comparator>
  1506. <type>RegexpComparator</type>
  1507. <expected-output>^450\s+450\s+hdfs:///dir0</expected-output>
  1508. </comparator>
  1509. </comparators>
  1510. </test>
  1511. <test> <!-- TESTED -->
  1512. <description>dus: Test for hdfs:// path - directories/files using globbing</description>
  1513. <test-commands>
  1514. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  1515. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
  1516. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1/dir1</command>
  1517. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1/dir2</command>
  1518. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir2</command>
  1519. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir2/dir1</command>
  1520. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir2/dir2</command>
  1521. <command>-fs NAMENODE -touchz hdfs:///dir0/file0</command>
  1522. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///dir0/dir1/data15bytes</command>
  1523. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes hdfs:///dir0/dir1/data30bytes</command>
  1524. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///dir0/dir2/data15bytes</command>
  1525. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes hdfs:///dir0/dir2/data30bytes</command>
  1526. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///dir0/dir1/dir1/data60bytes</command>
  1527. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes hdfs:///dir0/dir1/dir2/data120bytes</command>
  1528. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///dir0/dir2/dir1/data60bytes</command>
  1529. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes hdfs:///dir0/dir2/dir2/data120bytes</command>
  1530. <command>-fs NAMENODE -mkdir /donotcountdir0</command>
  1531. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///donotcountdir0/data15bytes</command>
  1532. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///donotcountdir0/data15bytes</command>
  1533. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///donotcountdir0/data15bytes</command>
  1534. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///donotcountdir0/data15bytes</command>
  1535. <command>-fs NAMENODE -du -s hdfs:///dir*</command>
  1536. </test-commands>
  1537. <cleanup-commands>
  1538. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  1539. <command>-fs NAMENODE -rm -r hdfs:///donotcountdir0</command>
  1540. </cleanup-commands>
  1541. <comparators>
  1542. <comparator>
  1543. <type>RegexpComparator</type>
  1544. <expected-output>^450\s+450\s+hdfs:///dir0</expected-output>
  1545. </comparator>
  1546. </comparators>
  1547. </test>
  1548. <test> <!-- TESTED -->
  1549. <description>dus: Test for Namenode's path - directories/files</description>
  1550. <test-commands>
  1551. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  1552. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1</command>
  1553. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1/dir1</command>
  1554. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1/dir2</command>
  1555. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir2</command>
  1556. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir2/dir1</command>
  1557. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir2/dir2</command>
  1558. <command>-fs NAMENODE -touchz NAMENODE/dir0/file0</command>
  1559. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/dir1/data15bytes</command>
  1560. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes NAMENODE/dir0/dir1/data30bytes</command>
  1561. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/dir2/data15bytes</command>
  1562. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes NAMENODE/dir0/dir2/data30bytes</command>
  1563. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes NAMENODE/dir0/dir1/dir1/data60bytes</command>
  1564. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes NAMENODE/dir0/dir1/dir2/data120bytes</command>
  1565. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes NAMENODE/dir0/dir2/dir1/data60bytes</command>
  1566. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes NAMENODE/dir0/dir2/dir2/data120bytes</command>
  1567. <command>-fs NAMENODE -du -s NAMENODE/dir0</command>
  1568. </test-commands>
  1569. <cleanup-commands>
  1570. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  1571. </cleanup-commands>
  1572. <comparators>
  1573. <comparator>
  1574. <type>RegexpComparator</type>
  1575. <expected-output>^450\s+450\s+NAMENODE/dir0</expected-output>
  1576. </comparator>
  1577. </comparators>
  1578. </test>
  1579. <test> <!-- TESTED -->
  1580. <description>dus: Test for Namenode's path - directories/files using globbing</description>
  1581. <test-commands>
  1582. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  1583. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1</command>
  1584. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1/dir1</command>
  1585. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1/dir2</command>
  1586. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir2</command>
  1587. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir2/dir1</command>
  1588. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir2/dir2</command>
  1589. <command>-fs NAMENODE -touchz NAMENODE/dir0/file0</command>
  1590. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/dir1/data15bytes</command>
  1591. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes NAMENODE/dir0/dir1/data30bytes</command>
  1592. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/dir2/data15bytes</command>
  1593. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes NAMENODE/dir0/dir2/data30bytes</command>
  1594. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes NAMENODE/dir0/dir1/dir1/data60bytes</command>
  1595. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes NAMENODE/dir0/dir1/dir2/data120bytes</command>
  1596. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes NAMENODE/dir0/dir2/dir1/data60bytes</command>
  1597. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes NAMENODE/dir0/dir2/dir2/data120bytes</command>
  1598. <command>-fs NAMENODE -mkdir NAMENODE/donotcountdir0</command>
  1599. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/donotcountdir0/data15bytes</command>
  1600. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/donotcountdir0/data15bytes</command>
  1601. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/donotcountdir0/data15bytes</command>
  1602. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/donotcountdir0/data15bytes</command>
  1603. <command>-fs NAMENODE -du -s NAMENODE/dir*</command>
  1604. </test-commands>
  1605. <cleanup-commands>
  1606. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  1607. <command>-fs NAMENODE -rm -r NAMENODE/donotcountdir0</command>
  1608. </cleanup-commands>
  1609. <comparators>
  1610. <comparator>
  1611. <type>RegexpComparator</type>
  1612. <expected-output>^450\s+450\s+NAMENODE/dir0</expected-output>
  1613. </comparator>
  1614. </comparators>
  1615. </test>
  1616. <!-- Tests for mv -->
  1617. <test> <!-- TESTED -->
  1618. <description>mv: file (absolute path) to file (absolute path)</description>
  1619. <test-commands>
  1620. <command>-fs NAMENODE -touchz /file1</command>
  1621. <command>-fs NAMENODE -mv /file1 /file2</command>
  1622. <command>-fs NAMENODE -ls /file*</command>
  1623. </test-commands>
  1624. <cleanup-commands>
  1625. <command>-fs NAMENODE -rm /file2</command>
  1626. </cleanup-commands>:
  1627. <comparators>
  1628. <comparator>
  1629. <type>RegexpComparator</type>
  1630. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file2</expected-output>
  1631. </comparator>
  1632. <comparator>
  1633. <type>RegexpComparator</type>
  1634. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file[^1]</expected-output>
  1635. </comparator>
  1636. </comparators>
  1637. </test>
  1638. <test> <!-- TESTED -->
  1639. <description>mv: file (absolute path) to file (relative path)</description>
  1640. <test-commands>
  1641. <command>-fs NAMENODE -touchz /file1</command>
  1642. <command>-fs NAMENODE -mv /file1 file2</command>
  1643. </test-commands>
  1644. <cleanup-commands>
  1645. <command>-fs NAMENODE -rm -r /file1</command>
  1646. </cleanup-commands>
  1647. <comparators>
  1648. <comparator>
  1649. <type>RegexpComparator</type>
  1650. <expected-output>^mv: `file2': No such file or directory</expected-output>
  1651. </comparator>
  1652. </comparators>
  1653. </test>
  1654. <test> <!-- TESTED -->
  1655. <description>mv: file (absolute path) to directory (absolute path); keep the same name at the destination</description>
  1656. <test-commands>
  1657. <command>-fs NAMENODE -touchz /file1</command>
  1658. <command>-fs NAMENODE -mkdir /dir0</command>
  1659. <command>-fs NAMENODE -mv /file1 /dir0</command>
  1660. <command>-fs NAMENODE -ls -R /dir0</command>
  1661. </test-commands>
  1662. <cleanup-commands>
  1663. <command>-fs NAMENODE -rm -r /dir0</command>
  1664. </cleanup-commands>
  1665. <comparators>
  1666. <comparator>
  1667. <type>RegexpComparator</type>
  1668. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file1</expected-output>
  1669. </comparator>
  1670. </comparators>
  1671. </test>
  1672. <test> <!-- TESTED -->
  1673. <description>mv: file (absolute path) to directory (absolute path); keep the same name at the destination [ TIED to previous test ]</description>
  1674. <test-commands>
  1675. <command>-fs NAMENODE -ls /file1</command>
  1676. </test-commands>
  1677. <cleanup-commands>
  1678. </cleanup-commands>
  1679. <comparators>
  1680. <comparator>
  1681. <type>TokenComparator</type>
  1682. <expected-output>ls: `/file1': No such file or directory</expected-output>
  1683. </comparator>
  1684. </comparators>
  1685. </test>
  1686. <test> <!-- TESTED -->
  1687. <description>mv: file (absolute path) to directory (absolute path); change the name at the destination</description>
  1688. <test-commands>
  1689. <command>-fs NAMENODE -touchz /file1</command>
  1690. <command>-fs NAMENODE -mkdir /dir0</command>
  1691. <command>-fs NAMENODE -mv /file1 /dir0/file2</command>
  1692. <command>-fs NAMENODE -ls /dir0</command>
  1693. </test-commands>
  1694. <cleanup-commands>
  1695. <command>-fs NAMENODE -rm -r /dir0</command>
  1696. </cleanup-commands>
  1697. <comparators>
  1698. <comparator>
  1699. <type>RegexpComparator</type>
  1700. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file2</expected-output>
  1701. </comparator>
  1702. </comparators>
  1703. </test>
  1704. <test> <!-- TESTED -->
  1705. <description>mv: file (absolute path) to directory (absolute path); change the name at the destination [ TIED to previous test ]</description>
  1706. <test-commands>
  1707. <command>-fs NAMENODE -ls /file1</command>
  1708. </test-commands>
  1709. <cleanup-commands>
  1710. </cleanup-commands>
  1711. <comparators>
  1712. <comparator>
  1713. <type>TokenComparator</type>
  1714. <expected-output>ls: `/file1': No such file or directory</expected-output>
  1715. </comparator>
  1716. </comparators>
  1717. </test>
  1718. <test> <!-- TESTED -->
  1719. <description>mv: files (absolute path) to directory (absolute path) using globbing</description>
  1720. <test-commands>
  1721. <command>-fs NAMENODE -touchz /file1</command>
  1722. <command>-fs NAMENODE -touchz /file2</command>
  1723. <command>-fs NAMENODE -touchz /file3</command>
  1724. <command>-fs NAMENODE -touchz /file4</command>
  1725. <command>-fs NAMENODE -mkdir /dir0</command>
  1726. <command>-fs NAMENODE -mv /file* /dir0</command>
  1727. <command>-fs NAMENODE -ls -R /*</command>
  1728. </test-commands>
  1729. <cleanup-commands>
  1730. <command>-fs NAMENODE -rm -r /dir0</command>
  1731. </cleanup-commands>
  1732. <comparators>
  1733. <comparator>
  1734. <type>RegexpComparator</type>
  1735. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file1</expected-output>
  1736. </comparator>
  1737. <comparator>
  1738. <type>RegexpComparator</type>
  1739. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file2</expected-output>
  1740. </comparator>
  1741. <comparator>
  1742. <type>RegexpComparator</type>
  1743. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file3</expected-output>
  1744. </comparator>
  1745. <comparator>
  1746. <type>RegexpComparator</type>
  1747. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file4</expected-output>
  1748. </comparator>
  1749. </comparators>
  1750. </test>
  1751. <test> <!-- TESTED -->
  1752. <description>mv: files (absolute path) to directory (absolute path) using globbing [ TIED to previous test ]</description>
  1753. <test-commands>
  1754. <command>-fs NAMENODE -ls /file*</command>
  1755. </test-commands>
  1756. <cleanup-commands>
  1757. </cleanup-commands>
  1758. <comparators>
  1759. <comparator>
  1760. <type>TokenComparator</type>
  1761. <expected-output>ls: `/file*': No such file or directory</expected-output>
  1762. </comparator>
  1763. </comparators>
  1764. </test>
  1765. <test> <!-- TESTED -->
  1766. <description>mv: file (relative) to file (relative)</description>
  1767. <test-commands>
  1768. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  1769. <command>-fs NAMENODE -touchz file1</command>
  1770. <command>-fs NAMENODE -mv file1 file2</command>
  1771. <command>-fs NAMENODE -ls file*</command>
  1772. </test-commands>
  1773. <cleanup-commands>
  1774. <command>-fs NAMENODE -rm /user</command>
  1775. </cleanup-commands>
  1776. <comparators>
  1777. <comparator>
  1778. <type>RegexpComparator</type>
  1779. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file2</expected-output>
  1780. </comparator>
  1781. <comparator>
  1782. <type>RegexpComparator</type>
  1783. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file[^1]</expected-output>
  1784. </comparator>
  1785. </comparators>
  1786. </test>
  1787. <test> <!-- TESTED -->
  1788. <description>mv: moving file to file(rename in for hdfs:// path) </description>
  1789. <test-commands>
  1790. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  1791. <command>-fs NAMENODE -mv hdfs:///file1 hdfs:///file2</command>
  1792. <command>-fs NAMENODE -ls hdfs:///file*</command>
  1793. </test-commands>
  1794. <cleanup-commands>
  1795. <command>-fs NAMENODE -rm hdfs:///file2</command>
  1796. </cleanup-commands>:
  1797. <comparators>
  1798. <comparator>
  1799. <type>RegexpComparator</type>
  1800. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file2</expected-output>
  1801. </comparator>
  1802. <comparator>
  1803. <type>RegexpComparator</type>
  1804. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file[^1]</expected-output>
  1805. </comparator>
  1806. </comparators>
  1807. </test>
  1808. <test> <!-- TESTED -->
  1809. <description>mv: moving file to directory (keep the same name at the destination) in hdfs:// path - </description>
  1810. <test-commands>
  1811. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  1812. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  1813. <command>-fs NAMENODE -mv hdfs:///file1 hdfs:///dir0</command>
  1814. <command>-fs NAMENODE -ls -R hdfs:///dir0</command>
  1815. </test-commands>
  1816. <cleanup-commands>
  1817. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  1818. </cleanup-commands>
  1819. <comparators>
  1820. <comparator>
  1821. <type>RegexpComparator</type>
  1822. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file1</expected-output>
  1823. </comparator>
  1824. </comparators>
  1825. </test>
  1826. <test> <!-- TESTED -->
  1827. <description>mv: moving files to directory in hdfs:// path - [ TIED to previous test ]</description>
  1828. <test-commands>
  1829. <command>-fs NAMENODE -ls hdfs:///file*</command>
  1830. </test-commands>
  1831. <cleanup-commands>
  1832. </cleanup-commands>
  1833. <comparators>
  1834. <comparator>
  1835. <type>TokenComparator</type>
  1836. <expected-output>ls: `hdfs:///file*': No such file or directory</expected-output>
  1837. </comparator>
  1838. </comparators>
  1839. </test>
  1840. <test> <!-- TESTED -->
  1841. <description>mv: moving file that does not exist in hdfs:// path </description>
  1842. <test-commands>
  1843. <command>-fs NAMENODE -mv hdfs:///file1 hdfs:///file2</command>
  1844. </test-commands>
  1845. <cleanup-commands>
  1846. </cleanup-commands>
  1847. <comparators>
  1848. <comparator>
  1849. <type>TokenComparator</type>
  1850. <expected-output>mv: `hdfs:///file1': No such file or directory</expected-output>
  1851. </comparator>
  1852. </comparators>
  1853. </test>
  1854. <test> <!-- TESTED -->
  1855. <description>mv: moving file to directory (different name at the destination) in hdfs:// path </description>
  1856. <test-commands>
  1857. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  1858. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  1859. <command>-fs NAMENODE -mv hdfs:///file1 hdfs:///dir0/file2</command>
  1860. <command>-fs NAMENODE -ls hdfs:///dir0</command>
  1861. </test-commands>
  1862. <cleanup-commands>
  1863. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  1864. </cleanup-commands>
  1865. <comparators>
  1866. <comparator>
  1867. <type>RegexpComparator</type>
  1868. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file2</expected-output>
  1869. </comparator>
  1870. </comparators>
  1871. </test>
  1872. <test> <!-- TESTED -->
  1873. <description>mv: moving file to directory (different name at the destination) in hdfs:// path [ TIED to previous test ]</description>
  1874. <test-commands>
  1875. <command>-fs NAMENODE -ls hdfs:///file1</command>
  1876. </test-commands>
  1877. <cleanup-commands>
  1878. </cleanup-commands>
  1879. <comparators>
  1880. <comparator>
  1881. <type>TokenComparator</type>
  1882. <expected-output>ls: `hdfs:///file1': No such file or directory</expected-output>
  1883. </comparator>
  1884. </comparators>
  1885. </test>
  1886. <test> <!-- TESTED -->
  1887. <description>mv: moving group of files to directory using globbing in hdfs:// path - </description>
  1888. <test-commands>
  1889. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  1890. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  1891. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  1892. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  1893. <command>-fs NAMENODE -mv hdfs:///file* hdfs:///dir0</command>
  1894. <command>-fs NAMENODE -ls -R hdfs:///*</command>
  1895. </test-commands>
  1896. <cleanup-commands>
  1897. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  1898. </cleanup-commands>
  1899. <comparators>
  1900. <comparator>
  1901. <type>RegexpComparator</type>
  1902. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file1</expected-output>
  1903. </comparator>
  1904. <comparator>
  1905. <type>RegexpComparator</type>
  1906. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file2</expected-output>
  1907. </comparator>
  1908. <comparator>
  1909. <type>RegexpComparator</type>
  1910. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file3</expected-output>
  1911. </comparator>
  1912. </comparators>
  1913. </test>
  1914. <test> <!-- TESTED -->
  1915. <description>mv: moving files to directory using globbing in hdfs:// [ TIED to previous test ]</description>
  1916. <test-commands>
  1917. <command>-fs NAMENODE -ls hdfs:///file*</command>
  1918. </test-commands>
  1919. <cleanup-commands>
  1920. </cleanup-commands>
  1921. <comparators>
  1922. <comparator>
  1923. <type>TokenComparator</type>
  1924. <expected-output>ls: `hdfs:///file*': No such file or directory</expected-output>
  1925. </comparator>
  1926. </comparators>
  1927. </test>
  1928. <test> <!-- TESTED -->
  1929. <description>mv: moving file to file(rename) in Namenode's path - </description>
  1930. <test-commands>
  1931. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  1932. <command>-fs NAMENODE -mv NAMENODE/file1 NAMENODE/file2</command>
  1933. <command>-fs NAMENODE -ls NAMENODE/file*</command>
  1934. </test-commands>
  1935. <cleanup-commands>
  1936. <command>-fs NAMENODE -rm NAMENODE/file2</command>
  1937. </cleanup-commands>:
  1938. <comparators>
  1939. <comparator>
  1940. <type>RegexpComparator</type>
  1941. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file2</expected-output>
  1942. </comparator>
  1943. <comparator>
  1944. <type>RegexpComparator</type>
  1945. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file[^1]</expected-output>
  1946. </comparator>
  1947. </comparators>
  1948. </test>
  1949. <test> <!-- TESTED -->
  1950. <description>mv: moving file to directory (keep the same name at the destination) in Namenode's path </description>
  1951. <test-commands>
  1952. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  1953. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  1954. <command>-fs NAMENODE -mv NAMENODE/file1 NAMENODE/dir0</command>
  1955. <command>-fs NAMENODE -ls -R NAMENODE/dir0</command>
  1956. </test-commands>
  1957. <cleanup-commands>
  1958. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  1959. </cleanup-commands>
  1960. <comparators>
  1961. <comparator>
  1962. <type>RegexpComparator</type>
  1963. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/file1</expected-output>
  1964. </comparator>
  1965. </comparators>
  1966. </test>
  1967. <test> <!-- TESTED -->
  1968. <description>mv: moving files to directory in Namenode's path - [ TIED to previous test ]</description>
  1969. <test-commands>
  1970. <command>-fs NAMENODE -ls NAMENODE/file1</command>
  1971. </test-commands>
  1972. <cleanup-commands>
  1973. </cleanup-commands>
  1974. <comparators>
  1975. <comparator>
  1976. <type>RegexpComparator</type>
  1977. <expected-output>^ls: `hdfs://\w+[-.a-z0-9]*:[0-9]+/file1': No such file or directory</expected-output>
  1978. </comparator>
  1979. </comparators>
  1980. </test>
  1981. <test> <!-- TESTED -->
  1982. <description>mv: moving file that does not exist in Namenode's path </description>
  1983. <test-commands>
  1984. <command>-fs NAMENODE -mv NAMENODE/file1 NAMENODE/file2</command>
  1985. </test-commands>
  1986. <cleanup-commands>
  1987. </cleanup-commands>
  1988. <comparators>
  1989. <comparator>
  1990. <type>RegexpComparator</type>
  1991. <expected-output>^mv: `hdfs://\w+[-.a-z0-9]*:[0-9]+/file1': No such file or directory</expected-output>
  1992. </comparator>
  1993. </comparators>
  1994. </test>
  1995. <test> <!-- TESTED -->
  1996. <description>mv: moving file to directory (different name at the destination) in Namenode's path </description>
  1997. <test-commands>
  1998. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  1999. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  2000. <command>-fs NAMENODE -mv NAMENODE/file1 NAMENODE/dir0/file2</command>
  2001. <command>-fs NAMENODE -ls NAMENODE/dir0</command>
  2002. </test-commands>
  2003. <cleanup-commands>
  2004. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  2005. </cleanup-commands>
  2006. <comparators>
  2007. <comparator>
  2008. <type>RegexpComparator</type>
  2009. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/file2</expected-output>
  2010. </comparator>
  2011. </comparators>
  2012. </test>
  2013. <test> <!-- TESTED -->
  2014. <description>mv: moving file to directory (different name at the destination) in Namenode's path [ TIED to previous test ]</description>
  2015. <test-commands>
  2016. <command>-fs NAMENODE -ls NAMENODE/file1</command>
  2017. </test-commands>
  2018. <cleanup-commands>
  2019. </cleanup-commands>
  2020. <comparators>
  2021. <comparator>
  2022. <type>RegexpComparator</type>
  2023. <expected-output>^ls: `NAMENODE/file1': No such file or directory</expected-output>
  2024. </comparator>
  2025. </comparators>
  2026. </test>
  2027. <test> <!-- TESTED -->
  2028. <description>mv: moving group of files to directory using globbing in Namenode's path </description>
  2029. <test-commands>
  2030. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  2031. <command>-fs NAMENODE -touchz NAMENODE/file2</command>
  2032. <command>-fs NAMENODE -touchz NAMENODE/file3</command>
  2033. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  2034. <command>-fs NAMENODE -mv NAMENODE/file* NAMENODE/dir0</command>
  2035. <command>-fs NAMENODE -ls -R NAMENODE/*</command>
  2036. </test-commands>
  2037. <cleanup-commands>
  2038. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  2039. </cleanup-commands>
  2040. <comparators>
  2041. <comparator>
  2042. <type>RegexpComparator</type>
  2043. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/file1</expected-output>
  2044. </comparator>
  2045. <comparator>
  2046. <type>RegexpComparator</type>
  2047. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/file2</expected-output>
  2048. </comparator>
  2049. <comparator>
  2050. <type>RegexpComparator</type>
  2051. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/file3</expected-output>
  2052. </comparator>
  2053. </comparators>
  2054. </test>
  2055. <test> <!-- TESTED -->
  2056. <description>mv: moving files to directory using globbing in Namenode's path [ TIED to previous test ]</description>
  2057. <test-commands>
  2058. <command>-fs NAMENODE -ls NAMENODE/file*</command>
  2059. </test-commands>
  2060. <cleanup-commands>
  2061. </cleanup-commands>
  2062. <comparators>
  2063. <comparator>
  2064. <type>RegexpComparator</type>
  2065. <expected-output>^ls: `hdfs://\w+[-.a-z0-9]*:[0-9]+/file\*': No such file or directory</expected-output>
  2066. </comparator>
  2067. </comparators>
  2068. </test>
  2069. <test> <!-- TESTED -->
  2070. <description>mv: moving directory to directory in hdfs:// path </description>
  2071. <test-commands>
  2072. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  2073. <command>-fs NAMENODE -mkdir hdfs:///dir1</command>
  2074. <command>-fs NAMENODE -touchz hdfs:///dir0/file1</command>
  2075. <command>-fs NAMENODE -mv hdfs:///dir0 hdfs:///dir1</command>
  2076. <command>-fs NAMENODE -ls -R hdfs:///dir1</command>
  2077. </test-commands>
  2078. <cleanup-commands>
  2079. <command>-fs NAMENODE -rm hdfs:///dir1</command>
  2080. </cleanup-commands>
  2081. <comparators>
  2082. <comparator>
  2083. <type>RegexpComparator</type>
  2084. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir1/dir0</expected-output>
  2085. </comparator>
  2086. <comparator>
  2087. <type>RegexpComparator</type>
  2088. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir1/dir0/file1</expected-output>
  2089. </comparator>
  2090. </comparators>
  2091. </test>
  2092. <test> <!-- TESTED -->
  2093. <description>mv: moving directory to directory in Namenode's path </description>
  2094. <test-commands>
  2095. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  2096. <command>-fs NAMENODE -mkdir NAMENODE/dir1</command>
  2097. <command>-fs NAMENODE -touchz NAMENODE/dir0/file1</command>
  2098. <command>-fs NAMENODE -mv NAMENODE/dir0 NAMENODE/dir1</command>
  2099. <command>-fs NAMENODE -ls -R NAMENODE/dir1</command>
  2100. </test-commands>
  2101. <cleanup-commands>
  2102. <command>-fs NAMENODE -rm NAMENODE/dir1</command>
  2103. </cleanup-commands>
  2104. <comparators>
  2105. <comparator>
  2106. <type>RegexpComparator</type>
  2107. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir1/dir0</expected-output>
  2108. </comparator>
  2109. <comparator>
  2110. <type>RegexpComparator</type>
  2111. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir1/dir0/file1</expected-output>
  2112. </comparator>
  2113. </comparators>
  2114. </test>
  2115. <!-- Tests for cp-->
  2116. <test> <!-- TESTED -->
  2117. <description>cp: file (absolute path) to file (absolute path)</description>
  2118. <test-commands>
  2119. <command>-fs NAMENODE -touchz /file1</command>
  2120. <command>-fs NAMENODE -cp /file1 /file2</command>
  2121. <command>-fs NAMENODE -ls /file*</command>
  2122. </test-commands>
  2123. <cleanup-commands>
  2124. <command>-fs NAMENODE -rm /file*</command>
  2125. </cleanup-commands>:
  2126. <comparators>
  2127. <comparator>
  2128. <type>RegexpComparator</type>
  2129. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file1</expected-output>
  2130. </comparator>
  2131. <comparator>
  2132. <type>RegexpComparator</type>
  2133. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file2</expected-output>
  2134. </comparator>
  2135. </comparators>
  2136. </test>
  2137. <test> <!-- TESTED -->
  2138. <description>cp: file (absolute path) to file (relative path)</description>
  2139. <test-commands>
  2140. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  2141. <command>-fs NAMENODE -touchz /file1</command>
  2142. <command>-fs NAMENODE -cp /file1 file2</command>
  2143. <command>-fs NAMENODE -ls /file1 file2</command>
  2144. </test-commands>
  2145. <cleanup-commands>
  2146. <command>-fs NAMENODE -rm -r /file1 file2</command>
  2147. </cleanup-commands>
  2148. <comparators>
  2149. <comparator>
  2150. <type>RegexpComparator</type>
  2151. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file1</expected-output>
  2152. </comparator>
  2153. <comparator>
  2154. <type>RegexpComparator</type>
  2155. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file2</expected-output>
  2156. </comparator>
  2157. </comparators>
  2158. </test>
  2159. <test> <!-- TESTED -->
  2160. <description>cp: file (relative path) to file (absolute path)</description>
  2161. <test-commands>
  2162. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  2163. <command>-fs NAMENODE -touchz file1</command>
  2164. <command>-fs NAMENODE -cp file1 /file2</command>
  2165. <command>-fs NAMENODE -ls file1 /file2</command>
  2166. </test-commands>
  2167. <cleanup-commands>
  2168. <command>-fs NAMENODE -rm -r file1 /file2</command>
  2169. </cleanup-commands>
  2170. <comparators>
  2171. <comparator>
  2172. <type>RegexpComparator</type>
  2173. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file1</expected-output>
  2174. </comparator>
  2175. <comparator>
  2176. <type>RegexpComparator</type>
  2177. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file2</expected-output>
  2178. </comparator>
  2179. </comparators>
  2180. </test>
  2181. <test> <!-- TESTED -->
  2182. <description>cp: file (relative path) to file (relative path)</description>
  2183. <test-commands>
  2184. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  2185. <command>-fs NAMENODE -touchz file1</command>
  2186. <command>-fs NAMENODE -cp file1 file2</command>
  2187. <command>-fs NAMENODE -ls file1 file2</command>
  2188. </test-commands>
  2189. <cleanup-commands>
  2190. <command>-fs NAMENODE -rm -r file1 file2</command>
  2191. </cleanup-commands>
  2192. <comparators>
  2193. <comparator>
  2194. <type>RegexpComparator</type>
  2195. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file1</expected-output>
  2196. </comparator>
  2197. <comparator>
  2198. <type>RegexpComparator</type>
  2199. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file2</expected-output>
  2200. </comparator>
  2201. </comparators>
  2202. </test>
  2203. <test> <!-- TESTED -->
  2204. <description>cp: file (absolute path) to directory (absolute path); keep the same name at the destination</description>
  2205. <test-commands>
  2206. <command>-fs NAMENODE -touchz /file1</command>
  2207. <command>-fs NAMENODE -mkdir /dir0</command>
  2208. <command>-fs NAMENODE -cp /file1 /dir0</command>
  2209. <command>-fs NAMENODE -ls /file1 /dir0</command>
  2210. </test-commands>
  2211. <cleanup-commands>
  2212. <command>-fs NAMENODE -rm -r /dir0</command>
  2213. </cleanup-commands>
  2214. <comparators>
  2215. <comparator>
  2216. <type>RegexpComparator</type>
  2217. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file1</expected-output>
  2218. </comparator>
  2219. <comparator>
  2220. <type>RegexpComparator</type>
  2221. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file1</expected-output>
  2222. </comparator>
  2223. </comparators>
  2224. </test>
  2225. <test> <!-- TESTED -->
  2226. <description>cp: file (absolute path) to directory (absolute path); change the name at the destination</description>
  2227. <test-commands>
  2228. <command>-fs NAMENODE -touchz /file1</command>
  2229. <command>-fs NAMENODE -mkdir /dir0</command>
  2230. <command>-fs NAMENODE -cp /file1 /dir0/file2</command>
  2231. <command>-fs NAMENODE -ls /file1 /dir0</command>
  2232. </test-commands>
  2233. <cleanup-commands>
  2234. <command>-fs NAMENODE -rm -r /dir0</command>
  2235. </cleanup-commands>
  2236. <comparators>
  2237. <comparator>
  2238. <type>RegexpComparator</type>
  2239. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file1</expected-output>
  2240. </comparator>
  2241. <comparator>
  2242. <type>RegexpComparator</type>
  2243. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file2</expected-output>
  2244. </comparator>
  2245. </comparators>
  2246. </test>
  2247. <test> <!-- TESTED -->
  2248. <description>cp: files to directory (absolute path) using globbing</description>
  2249. <test-commands>
  2250. <command>-fs NAMENODE -touchz /file1</command>
  2251. <command>-fs NAMENODE -touchz /file2</command>
  2252. <command>-fs NAMENODE -touchz /file3</command>
  2253. <command>-fs NAMENODE -touchz /file4</command>
  2254. <command>-fs NAMENODE -mkdir /dir0</command>
  2255. <command>-fs NAMENODE -cp /file* /dir0</command>
  2256. <command>-fs NAMENODE -ls -R /*</command>
  2257. </test-commands>
  2258. <cleanup-commands>
  2259. <command>-fs NAMENODE -rm -r /dir0</command>
  2260. </cleanup-commands>
  2261. <comparators>
  2262. <comparator>
  2263. <type>RegexpComparator</type>
  2264. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file1</expected-output>
  2265. </comparator>
  2266. <comparator>
  2267. <type>RegexpComparator</type>
  2268. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file2</expected-output>
  2269. </comparator>
  2270. <comparator>
  2271. <type>RegexpComparator</type>
  2272. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file3</expected-output>
  2273. </comparator>
  2274. <comparator>
  2275. <type>RegexpComparator</type>
  2276. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file4</expected-output>
  2277. </comparator>
  2278. <comparator>
  2279. <type>RegexpComparator</type>
  2280. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file1</expected-output>
  2281. </comparator>
  2282. <comparator>
  2283. <type>RegexpComparator</type>
  2284. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file2</expected-output>
  2285. </comparator>
  2286. <comparator>
  2287. <type>RegexpComparator</type>
  2288. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file3</expected-output>
  2289. </comparator>
  2290. <comparator>
  2291. <type>RegexpComparator</type>
  2292. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file4</expected-output>
  2293. </comparator>
  2294. </comparators>
  2295. </test>
  2296. <test> <!-- TESTED -->
  2297. <description>cp: files to directory (absolute path) without globbing</description>
  2298. <test-commands>
  2299. <command>-fs NAMENODE -touchz /file1</command>
  2300. <command>-fs NAMENODE -touchz /file2</command>
  2301. <command>-fs NAMENODE -touchz /file3</command>
  2302. <command>-fs NAMENODE -touchz /file4</command>
  2303. <command>-fs NAMENODE -mkdir /dir0</command>
  2304. <command>-fs NAMENODE -cp /file1 /file2 /file3 /file4 /dir0</command>
  2305. <command>-fs NAMENODE -ls -R /*</command>
  2306. </test-commands>
  2307. <cleanup-commands>
  2308. <command>-fs NAMENODE -rm -r /dir0 /file*</command>
  2309. </cleanup-commands>
  2310. <comparators>
  2311. <comparator>
  2312. <type>RegexpComparator</type>
  2313. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file1</expected-output>
  2314. </comparator>
  2315. <comparator>
  2316. <type>RegexpComparator</type>
  2317. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file2</expected-output>
  2318. </comparator>
  2319. <comparator>
  2320. <type>RegexpComparator</type>
  2321. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file3</expected-output>
  2322. </comparator>
  2323. <comparator>
  2324. <type>RegexpComparator</type>
  2325. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file4</expected-output>
  2326. </comparator>
  2327. <comparator>
  2328. <type>RegexpComparator</type>
  2329. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file1</expected-output>
  2330. </comparator>
  2331. <comparator>
  2332. <type>RegexpComparator</type>
  2333. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file2</expected-output>
  2334. </comparator>
  2335. <comparator>
  2336. <type>RegexpComparator</type>
  2337. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file3</expected-output>
  2338. </comparator>
  2339. <comparator>
  2340. <type>RegexpComparator</type>
  2341. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file4</expected-output>
  2342. </comparator>
  2343. </comparators>
  2344. </test>
  2345. <test> <!-- TESTED -->
  2346. <description>cp: copying non existent file (absolute path)</description>
  2347. <test-commands>
  2348. <command>-fs NAMENODE -cp /file /file1</command>
  2349. </test-commands>
  2350. <cleanup-commands>
  2351. <command>-fs NAMENODE -rm -r /user</command>
  2352. </cleanup-commands>:
  2353. <comparators>
  2354. <comparator>
  2355. <type>RegexpComparator</type>
  2356. <expected-output>^cp: `/file': No such file or directory</expected-output>
  2357. </comparator>
  2358. </comparators>
  2359. </test>
  2360. <test> <!-- TESTED -->
  2361. <description>cp: copying non existent file (relative path)</description>
  2362. <test-commands>
  2363. <command>-fs NAMENODE -cp touchz test</command>
  2364. <command>-fs NAMENODE -cp file1 file2</command>
  2365. </test-commands>
  2366. <cleanup-commands>
  2367. <command>-fs NAMENODE -rm -r /user</command>
  2368. </cleanup-commands>:
  2369. <comparators>
  2370. <comparator>
  2371. <type>RegexpComparator</type>
  2372. <expected-output>^cp: `file2': No such file or directory</expected-output>
  2373. </comparator>
  2374. </comparators>
  2375. </test>
  2376. <test> <!-- TESTED -->
  2377. <description>cp: files to an existent file using globbing</description>
  2378. <test-commands>
  2379. <command>-fs NAMENODE -touchz /file1</command>
  2380. <command>-fs NAMENODE -touchz /file2</command>
  2381. <command>-fs NAMENODE -touchz /file3</command>
  2382. <command>-fs NAMENODE -touchz /file4</command>
  2383. <command>-fs NAMENODE -touchz /file5</command>
  2384. <command>-fs NAMENODE -cp /file* /file5</command>
  2385. </test-commands>
  2386. <cleanup-commands>
  2387. <command>-fs NAMENODE -rm -r /user</command>
  2388. </cleanup-commands>
  2389. <comparators>
  2390. <comparator>
  2391. <type>RegexpComparator</type>
  2392. <expected-output>^cp: `/file5': Is not a directory</expected-output>
  2393. </comparator>
  2394. </comparators>
  2395. </test>
  2396. <test> <!-- TESTED -->
  2397. <description>cp: files to an existent file without globbing</description>
  2398. <test-commands>
  2399. <command>-fs NAMENODE -touchz /file1</command>
  2400. <command>-fs NAMENODE -touchz /file2</command>
  2401. <command>-fs NAMENODE -touchz /file3</command>
  2402. <command>-fs NAMENODE -touchz /file4</command>
  2403. <command>-fs NAMENODE -touchz /file5</command>
  2404. <command>-fs NAMENODE -cp /file1 /file2 /file3 /file4 /file5</command>
  2405. </test-commands>
  2406. <cleanup-commands>
  2407. <command>-fs NAMENODE -rm -r /user</command>
  2408. </cleanup-commands>
  2409. <comparators>
  2410. <comparator>
  2411. <type>RegexpComparator</type>
  2412. <expected-output>^cp: `/file5': Is not a directory</expected-output>
  2413. </comparator>
  2414. </comparators>
  2415. </test>
  2416. <test> <!-- TESTED -->
  2417. <description>cp: files to a non existent directory using globbing</description>
  2418. <test-commands>
  2419. <command>-fs NAMENODE -touchz /file1</command>
  2420. <command>-fs NAMENODE -touchz /file2</command>
  2421. <command>-fs NAMENODE -touchz /file3</command>
  2422. <command>-fs NAMENODE -touchz /file4</command>
  2423. <command>-fs NAMENODE -cp /file* dir</command>
  2424. </test-commands>
  2425. <cleanup-commands>
  2426. <command>-fs NAMENODE -rm -r /user</command>
  2427. </cleanup-commands>
  2428. <comparators>
  2429. <comparator>
  2430. <type>RegexpComparator</type>
  2431. <expected-output>^cp: `dir': No such file or directory</expected-output>
  2432. </comparator>
  2433. </comparators>
  2434. </test>
  2435. <test> <!-- TESTED -->
  2436. <description>cp: files to a non existent directory without globbing</description>
  2437. <test-commands>
  2438. <command>-fs NAMENODE -touchz /file1</command>
  2439. <command>-fs NAMENODE -touchz /file2</command>
  2440. <command>-fs NAMENODE -touchz /file3</command>
  2441. <command>-fs NAMENODE -touchz /file4</command>
  2442. <command>-fs NAMENODE -cp /file1 /file2 /file3 /file4 dir</command>
  2443. </test-commands>
  2444. <cleanup-commands>
  2445. <command>-fs NAMENODE -rm -r /user</command>
  2446. </cleanup-commands>
  2447. <comparators>
  2448. <comparator>
  2449. <type>RegexpComparator</type>
  2450. <expected-output>^cp: `dir': No such file or directory</expected-output>
  2451. </comparator>
  2452. </comparators>
  2453. </test>
  2454. <test> <!-- TESTED -->
  2455. <description>cp: file to file copy in hdfs:// path </description>
  2456. <test-commands>
  2457. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  2458. <command>-fs NAMENODE -cp hdfs:///file1 hdfs:///file2</command>
  2459. <command>-fs NAMENODE -ls hdfs:///file*</command>
  2460. </test-commands>
  2461. <cleanup-commands>
  2462. <command>-fs NAMENODE -rm hdfs:///file*</command>
  2463. </cleanup-commands>:
  2464. <comparators>
  2465. <comparator>
  2466. <type>RegexpComparator</type>
  2467. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file1</expected-output>
  2468. </comparator>
  2469. <comparator>
  2470. <type>RegexpComparator</type>
  2471. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file2</expected-output>
  2472. </comparator>
  2473. </comparators>
  2474. </test>
  2475. <test> <!-- TESTED -->
  2476. <description>cp: file to directory copy (same name at the destination) in hdfs:// path</description>
  2477. <test-commands>
  2478. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  2479. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  2480. <command>-fs NAMENODE -cp hdfs:///file1 hdfs:///dir0</command>
  2481. <command>-fs NAMENODE -ls hdfs:///file1 hdfs:///dir0</command>
  2482. </test-commands>
  2483. <cleanup-commands>
  2484. <command>-fs NAMENODE -rm -r hdfs:///dir0/ hdfs://file1</command>
  2485. </cleanup-commands>
  2486. <comparators>
  2487. <comparator>
  2488. <type>RegexpComparator</type>
  2489. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file1</expected-output>
  2490. </comparator>
  2491. <comparator>
  2492. <type>RegexpComparator</type>
  2493. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file1</expected-output>
  2494. </comparator>
  2495. </comparators>
  2496. </test>
  2497. <test> <!-- TESTED -->
  2498. <description>cp: file to directory (different name at the destination) in hdfs:// path </description>
  2499. <test-commands>
  2500. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  2501. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  2502. <command>-fs NAMENODE -cp hdfs:///file1 hdfs:///dir0/file2</command>
  2503. <command>-fs NAMENODE -ls hdfs:///file1 hdfs:///dir0</command>
  2504. </test-commands>
  2505. <cleanup-commands>
  2506. <command>-fs NAMENODE -rm -r hdfs:///dir0/</command>
  2507. </cleanup-commands>
  2508. <comparators>
  2509. <comparator>
  2510. <type>RegexpComparator</type>
  2511. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file1</expected-output>
  2512. </comparator>
  2513. <comparator>
  2514. <type>RegexpComparator</type>
  2515. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file2</expected-output>
  2516. </comparator>
  2517. </comparators>
  2518. </test>
  2519. <test> <!-- TESTED -->
  2520. <description>cp: files to directory using globbing in hdfs:// path</description>
  2521. <test-commands>
  2522. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  2523. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  2524. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  2525. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  2526. <command>-fs NAMENODE -cp hdfs:///file* hdfs:///dir0</command>
  2527. <command>-fs NAMENODE -ls -R hdfs:///*</command>
  2528. </test-commands>
  2529. <cleanup-commands>
  2530. <command>-fs NAMENODE -rm -r hdfs:///file*</command>
  2531. <command>-fs NAMENODE -rm -r hdfs:///dir0/</command>
  2532. </cleanup-commands>
  2533. <comparators>
  2534. <comparator>
  2535. <type>RegexpComparator</type>
  2536. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file1</expected-output>
  2537. </comparator>
  2538. <comparator>
  2539. <type>RegexpComparator</type>
  2540. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file2</expected-output>
  2541. </comparator>
  2542. <comparator>
  2543. <type>RegexpComparator</type>
  2544. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file3</expected-output>
  2545. </comparator>
  2546. <comparator>
  2547. <type>RegexpComparator</type>
  2548. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file1</expected-output>
  2549. </comparator>
  2550. <comparator>
  2551. <type>RegexpComparator</type>
  2552. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file2</expected-output>
  2553. </comparator>
  2554. <comparator>
  2555. <type>RegexpComparator</type>
  2556. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file3</expected-output>
  2557. </comparator>
  2558. </comparators>
  2559. </test>
  2560. <test> <!-- TESTED -->
  2561. <description>cp: files to directory in hdfs:// path without globbing</description>
  2562. <test-commands>
  2563. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  2564. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  2565. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  2566. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  2567. <command>-fs NAMENODE -cp hdfs:///file1 hdfs:///file2 hdfs:///file3 hdfs:///dir0</command>
  2568. <command>-fs NAMENODE -ls -R hdfs:///*</command>
  2569. </test-commands>
  2570. <cleanup-commands>
  2571. <command>-fs NAMENODE -rm -r hdfs:///file*</command>
  2572. <command>-fs NAMENODE -rm -r hdfs:///dir0/</command>
  2573. </cleanup-commands>
  2574. <comparators>
  2575. <comparator>
  2576. <type>RegexpComparator</type>
  2577. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file1</expected-output>
  2578. </comparator>
  2579. <comparator>
  2580. <type>RegexpComparator</type>
  2581. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file2</expected-output>
  2582. </comparator>
  2583. <comparator>
  2584. <type>RegexpComparator</type>
  2585. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file3</expected-output>
  2586. </comparator>
  2587. <comparator>
  2588. <type>RegexpComparator</type>
  2589. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file1</expected-output>
  2590. </comparator>
  2591. <comparator>
  2592. <type>RegexpComparator</type>
  2593. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file2</expected-output>
  2594. </comparator>
  2595. <comparator>
  2596. <type>RegexpComparator</type>
  2597. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file3</expected-output>
  2598. </comparator>
  2599. </comparators>
  2600. </test>
  2601. <test> <!-- TESTED -->
  2602. <description>cp: copying non existent file in hdfs:// path </description>
  2603. <test-commands>
  2604. <command>-fs NAMENODE -cp hdfs:///file hdfs:///file1</command>
  2605. </test-commands>
  2606. <cleanup-commands>
  2607. </cleanup-commands>:
  2608. <comparators>
  2609. <comparator>
  2610. <type>RegexpComparator</type>
  2611. <expected-output>^cp: `hdfs:///file': No such file or directory</expected-output>
  2612. </comparator>
  2613. </comparators>
  2614. </test>
  2615. <test> <!-- TESTED -->
  2616. <description>cp: copying files to an existent file in hdfs:// path using globbing</description>
  2617. <test-commands>
  2618. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  2619. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  2620. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  2621. <command>-fs NAMENODE -touchz hdfs:///file4</command>
  2622. <command>-fs NAMENODE -touchz hdfs:///file5</command>
  2623. <command>-fs NAMENODE -cp hdfs:///file* hdfs:///file5</command>
  2624. </test-commands>
  2625. <cleanup-commands>
  2626. <command>-fs NAMENODE -rm -r hdfs:///file*</command>
  2627. </cleanup-commands>
  2628. <comparators>
  2629. <comparator>
  2630. <type>RegexpComparator</type>
  2631. <expected-output>^cp: `hdfs:///file5': Is not a directory</expected-output>
  2632. </comparator>
  2633. </comparators>
  2634. </test>
  2635. <test> <!-- TESTED -->
  2636. <description>cp: copying files to an existent file in hdfs:// path without globbing</description>
  2637. <test-commands>
  2638. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  2639. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  2640. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  2641. <command>-fs NAMENODE -touchz hdfs:///file4</command>
  2642. <command>-fs NAMENODE -touchz hdfs:///file5</command>
  2643. <command>-fs NAMENODE -cp hdfs:///file1 hdfs:///file2 hdfs:///file3 hdfs:///file4 hdfs:///file5</command>
  2644. </test-commands>
  2645. <cleanup-commands>
  2646. <command>-fs NAMENODE -rm -r hdfs:///file*</command>
  2647. </cleanup-commands>
  2648. <comparators>
  2649. <comparator>
  2650. <type>RegexpComparator</type>
  2651. <expected-output>^cp: `hdfs:///file5': Is not a directory</expected-output>
  2652. </comparator>
  2653. </comparators>
  2654. </test>
  2655. <test> <!-- TESTED -->
  2656. <description>cp: copying files to a non existent directory in hdfs:// path using globbing</description>
  2657. <test-commands>
  2658. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  2659. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  2660. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  2661. <command>-fs NAMENODE -touchz hdfs:///file4</command>
  2662. <command>-fs NAMENODE -cp hdfs:///file* hdfs:///dir</command>
  2663. </test-commands>
  2664. <cleanup-commands>
  2665. <command>-fs NAMENODE -rm -r hdfs:///file*</command>
  2666. </cleanup-commands>
  2667. <comparators>
  2668. <comparator>
  2669. <type>RegexpComparator</type>
  2670. <expected-output>^cp: `hdfs:///dir': No such file or directory</expected-output>
  2671. </comparator>
  2672. </comparators>
  2673. </test>
  2674. <test> <!-- TESTED -->
  2675. <description>cp: copying files to a non existent directory in hdfs:// path without globbing</description>
  2676. <test-commands>
  2677. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  2678. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  2679. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  2680. <command>-fs NAMENODE -touchz hdfs:///file4</command>
  2681. <command>-fs NAMENODE -cp hdfs:///file1 hdfs:///file2 hdfs:///file3 hdfs:///file4 hdfs:///dir</command>
  2682. </test-commands>
  2683. <cleanup-commands>
  2684. <command>-fs NAMENODE -rm -r hdfs:///file*</command>
  2685. </cleanup-commands>
  2686. <comparators>
  2687. <comparator>
  2688. <type>RegexpComparator</type>
  2689. <expected-output>^cp: `hdfs:///dir': No such file or directory</expected-output>
  2690. </comparator>
  2691. </comparators>
  2692. </test>
  2693. <test> <!-- TESTED -->
  2694. <description>cp: copying non existent directory in hdfs:// path</description>
  2695. <test-commands>
  2696. <command>-fs NAMENODE -mkdir hdfs:///dir1</command>
  2697. <command>-fs NAMENODE -cp hdfs:///dir0 hdfs:///dir1</command>
  2698. </test-commands>
  2699. <cleanup-commands>
  2700. <command>-fs NAMNEODE -rm -r hdfs:///dir1</command>
  2701. </cleanup-commands>
  2702. <comparators>
  2703. <comparator>
  2704. <type>RegexpComparator</type>
  2705. <expected-output>^cp: `hdfs:///dir0': No such file or directory</expected-output>
  2706. </comparator>
  2707. </comparators>
  2708. </test>
  2709. <test> <!-- TESTED -->
  2710. <description>cp: putting file into an already existing destination with -f option(absolute path)</description>
  2711. <test-commands>
  2712. <command>-fs NAMENODE -mkdir /user</command> <!-- make sure user home dir exists -->
  2713. <command>-fs NAMENODE -touchz /user/file0</command>
  2714. <command>-fs NAMENODE -cp -f CLITEST_DATA/data120bytes /user/file0</command>
  2715. <command>-fs NAMENODE -cat /user/file0</command>
  2716. </test-commands>
  2717. <cleanup-commands>
  2718. <command>-fs NAMENODE -rm -r /user</command>
  2719. </cleanup-commands>
  2720. <comparators>
  2721. <comparator>
  2722. <type>RegexpComparator</type>
  2723. <expected-output>12345678901234</expected-output>
  2724. </comparator>
  2725. </comparators>
  2726. </test>
  2727. <test> <!-- TESTED -->
  2728. <description>cp: copying directory to directory in hdfs:// path</description>
  2729. <test-commands>
  2730. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  2731. <command>-fs NAMENODE -mkdir hdfs:///dir1</command>
  2732. <command>-fs NAMENODE -touchz hdfs:///dir0/file1</command>
  2733. <command>-fs NAMENODE -cp hdfs:///dir0 hdfs:///dir1</command>
  2734. <command>-fs NAMENODE -ls -R hdfs:///dir*</command>
  2735. </test-commands>
  2736. <cleanup-commands>
  2737. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  2738. </cleanup-commands>
  2739. <comparators>
  2740. <comparator>
  2741. <type>RegexpComparator</type>
  2742. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file1</expected-output>
  2743. </comparator>
  2744. <comparator>
  2745. <type>RegexpComparator</type>
  2746. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir1/dir0</expected-output>
  2747. </comparator>
  2748. <comparator>
  2749. <type>RegexpComparator</type>
  2750. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir1/dir0/file1</expected-output>
  2751. </comparator>
  2752. </comparators>
  2753. </test>
  2754. <test> <!-- TESTED -->
  2755. <description>cp: copying multiple directories to directory using globbing in hdfs:// path </description>
  2756. <test-commands>
  2757. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  2758. <command>-fs NAMENODE -mkdir hdfs:///dir1</command>
  2759. <command>-fs NAMENODE -mkdir hdfs:///dir2</command>
  2760. <command>-fs NAMENODE -mkdir hdfs:///dest</command>
  2761. <command>-fs NAMENODE -cp hdfs:///dir* hdfs:///dest</command>
  2762. <command>-fs NAMENODE -ls -R hdfs:///d*</command>
  2763. </test-commands>
  2764. <cleanup-commands>
  2765. <command>-fs NAMNEODE -rm -r hdfs:///d*</command>
  2766. </cleanup-commands>
  2767. <comparators>
  2768. <comparator>
  2769. <type>RegexpComparator</type>
  2770. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dest/dir0</expected-output>
  2771. </comparator>
  2772. <comparator>
  2773. <type>RegexpComparator</type>
  2774. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dest/dir1</expected-output>
  2775. </comparator>
  2776. <comparator>
  2777. <type>RegexpComparator</type>
  2778. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dest/dir2</expected-output>
  2779. </comparator>
  2780. </comparators>
  2781. </test>
  2782. <test> <!-- TESTED -->
  2783. <description>cp: copying multiple directories to directory in hdfs:// path without using globbing</description>
  2784. <test-commands>
  2785. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  2786. <command>-fs NAMENODE -mkdir hdfs:///dir1</command>
  2787. <command>-fs NAMENODE -mkdir hdfs:///dir2</command>
  2788. <command>-fs NAMENODE -mkdir hdfs:///dest</command>
  2789. <command>-fs NAMENODE -cp hdfs:///dir0 hdfs:///dir1 hdfs:///dir2 hdfs:///dest</command>
  2790. <command>-fs NAMENODE -ls -R hdfs:///d*</command>
  2791. </test-commands>
  2792. <cleanup-commands>
  2793. <command>-fs NAMNEODE -rm -r hdfs:///*</command>
  2794. </cleanup-commands>
  2795. <comparators>
  2796. <comparator>
  2797. <type>RegexpComparator</type>
  2798. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dest/dir0</expected-output>
  2799. </comparator>
  2800. <comparator>
  2801. <type>RegexpComparator</type>
  2802. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dest/dir1</expected-output>
  2803. </comparator>
  2804. <comparator>
  2805. <type>RegexpComparator</type>
  2806. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dest/dir2</expected-output>
  2807. </comparator>
  2808. </comparators>
  2809. </test>
  2810. <test> <!-- TESTED -->
  2811. <description>cp: file to file copy in Namenode's path </description>
  2812. <test-commands>
  2813. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  2814. <command>-fs NAMENODE -cp NAMENODE/file1 NAMENODE/file2</command>
  2815. <command>-fs NAMENODE -ls NAMENODE/file*</command>
  2816. </test-commands>
  2817. <cleanup-commands>
  2818. <command>-fs NAMENODE -rm NAMENODE/file*</command>
  2819. </cleanup-commands>:
  2820. <comparators>
  2821. <comparator>
  2822. <type>RegexpComparator</type>
  2823. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file1</expected-output>
  2824. </comparator>
  2825. <comparator>
  2826. <type>RegexpComparator</type>
  2827. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file2</expected-output>
  2828. </comparator>
  2829. </comparators>
  2830. </test>
  2831. <test> <!-- TESTED -->
  2832. <description>cp: file to directory copy (same name at the destination) in Namenode's path </description>
  2833. <test-commands>
  2834. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  2835. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  2836. <command>-fs NAMENODE -cp NAMENODE/file1 NAMENODE/dir0</command>
  2837. <command>-fs NAMENODE -ls NAMENODE/file1 NAMENODE/dir0</command>
  2838. </test-commands>
  2839. <cleanup-commands>
  2840. <command>-fs NAMENODE -rm -r NAMENODE/dir0/ NAMENODE/file1</command>
  2841. </cleanup-commands>
  2842. <comparators>
  2843. <comparator>
  2844. <type>RegexpComparator</type>
  2845. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file1</expected-output>
  2846. </comparator>
  2847. <comparator>
  2848. <type>RegexpComparator</type>
  2849. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/file1</expected-output>
  2850. </comparator>
  2851. </comparators>
  2852. </test>
  2853. <test> <!-- TESTED -->
  2854. <description>cp: file to directory (different name at the destination) in Namenode's path </description>
  2855. <test-commands>
  2856. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  2857. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  2858. <command>-fs NAMENODE -cp NAMENODE/file1 NAMENODE/dir0/file2</command>
  2859. <command>-fs NAMENODE -ls NAMENODE/file1 NAMENODE/dir0</command>
  2860. </test-commands>
  2861. <cleanup-commands>
  2862. <command>-fs NAMENODE -rm -r NAMENODE/dir0/</command>
  2863. </cleanup-commands>
  2864. <comparators>
  2865. <comparator>
  2866. <type>RegexpComparator</type>
  2867. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file1</expected-output>
  2868. </comparator>
  2869. <comparator>
  2870. <type>RegexpComparator</type>
  2871. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/file2</expected-output>
  2872. </comparator>
  2873. </comparators>
  2874. </test>
  2875. <test> <!-- TESTED -->
  2876. <description>cp: files to directory in Namenode's path using globbing</description>
  2877. <test-commands>
  2878. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  2879. <command>-fs NAMENODE -touchz NAMENODE/file2</command>
  2880. <command>-fs NAMENODE -touchz NAMENODE/file3</command>
  2881. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  2882. <command>-fs NAMENODE -cp NAMENODE/file* NAMENODE/dir0</command>
  2883. <command>-fs NAMENODE -ls -R NAMENODE/*</command>
  2884. </test-commands>
  2885. <cleanup-commands>
  2886. <command>-fs NAMENODE -rm -r NAMENODE/file*</command>
  2887. <command>-fs NAMENODE -rm -r NAMENODE/dir0/</command>
  2888. </cleanup-commands>
  2889. <comparators>
  2890. <comparator>
  2891. <type>RegexpComparator</type>
  2892. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file1</expected-output>
  2893. </comparator>
  2894. <comparator>
  2895. <type>RegexpComparator</type>
  2896. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file2</expected-output>
  2897. </comparator>
  2898. <comparator>
  2899. <type>RegexpComparator</type>
  2900. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file3</expected-output>
  2901. </comparator>
  2902. <comparator>
  2903. <type>RegexpComparator</type>
  2904. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/file1</expected-output>
  2905. </comparator>
  2906. <comparator>
  2907. <type>RegexpComparator</type>
  2908. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/file2</expected-output>
  2909. </comparator>
  2910. <comparator>
  2911. <type>RegexpComparator</type>
  2912. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/file3</expected-output>
  2913. </comparator>
  2914. </comparators>
  2915. </test>
  2916. <test> <!-- TESTED -->
  2917. <description>cp: files to directory in Namenode's path without globbing</description>
  2918. <test-commands>
  2919. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  2920. <command>-fs NAMENODE -touchz NAMENODE/file2</command>
  2921. <command>-fs NAMENODE -touchz NAMENODE/file3</command>
  2922. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  2923. <command>-fs NAMENODE -cp NAMENODE/file1 NAMENODE/file2 NAMENODE/file3 NAMENODE/dir0</command>
  2924. <command>-fs NAMENODE -ls -R NAMENODE/*</command>
  2925. </test-commands>
  2926. <cleanup-commands>
  2927. <command>-fs NAMENODE -rm -r NAMENODE/file*</command>
  2928. <command>-fs NAMENODE -rm -r NAMENODE/dir0/</command>
  2929. </cleanup-commands>
  2930. <comparators>
  2931. <comparator>
  2932. <type>RegexpComparator</type>
  2933. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file1</expected-output>
  2934. </comparator>
  2935. <comparator>
  2936. <type>RegexpComparator</type>
  2937. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file2</expected-output>
  2938. </comparator>
  2939. <comparator>
  2940. <type>RegexpComparator</type>
  2941. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file3</expected-output>
  2942. </comparator>
  2943. <comparator>
  2944. <type>RegexpComparator</type>
  2945. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/file1</expected-output>
  2946. </comparator>
  2947. <comparator>
  2948. <type>RegexpComparator</type>
  2949. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/file2</expected-output>
  2950. </comparator>
  2951. <comparator>
  2952. <type>RegexpComparator</type>
  2953. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/file3</expected-output>
  2954. </comparator>
  2955. </comparators>
  2956. </test>
  2957. <test> <!-- TESTED -->
  2958. <description>cp: copying non existent file in Namenode's path </description>
  2959. <test-commands>
  2960. <command>-fs NAMENODE -cp NAMENODE/file NAMENODE/file1</command>
  2961. </test-commands>
  2962. <cleanup-commands>
  2963. </cleanup-commands>:
  2964. <comparators>
  2965. <comparator>
  2966. <type>RegexpComparator</type>
  2967. <expected-output>^cp: `hdfs://\w+[-.a-z0-9]*:[0-9]+/file': No such file or directory</expected-output>
  2968. </comparator>
  2969. </comparators>
  2970. </test>
  2971. <test> <!-- TESTED -->
  2972. <description>cp: copying files to an existent file in Namenode's path using globbing</description>
  2973. <test-commands>
  2974. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  2975. <command>-fs NAMENODE -touchz NAMENODE/file2</command>
  2976. <command>-fs NAMENODE -touchz NAMENODE/file3</command>
  2977. <command>-fs NAMENODE -touchz NAMENODE/file4</command>
  2978. <command>-fs NAMENODE -touchz NAMENODE/file5</command>
  2979. <command>-fs NAMENODE -cp NAMENODE/file* NAMENODE/file5</command>
  2980. </test-commands>
  2981. <cleanup-commands>
  2982. <command>-fs NAMENODE -rm -r NAMENODE/file*</command>
  2983. </cleanup-commands>
  2984. <comparators>
  2985. <comparator>
  2986. <type>RegexpComparator</type>
  2987. <expected-output>^cp: `hdfs://\w+[-.a-z0-9]*:[0-9]+/file5': Is not a directory</expected-output>
  2988. </comparator>
  2989. </comparators>
  2990. </test>
  2991. <test> <!-- TESTED -->
  2992. <description>cp: copying files to an existent file in Namenode's path without globbing</description>
  2993. <test-commands>
  2994. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  2995. <command>-fs NAMENODE -touchz NAMENODE/file2</command>
  2996. <command>-fs NAMENODE -touchz NAMENODE/file3</command>
  2997. <command>-fs NAMENODE -touchz NAMENODE/file4</command>
  2998. <command>-fs NAMENODE -touchz NAMENODE/file5</command>
  2999. <command>-fs NAMENODE -cp NAMENODE/file1 NAMENODE/file2 NAMENODE/file3 NAMENODE/file4 NAMENODE/file5</command>
  3000. </test-commands>
  3001. <cleanup-commands>
  3002. <command>-fs NAMENODE -rm -r NAMENODE/file*</command>
  3003. </cleanup-commands>
  3004. <comparators>
  3005. <comparator>
  3006. <type>RegexpComparator</type>
  3007. <expected-output>^cp: `hdfs://\w+[-.a-z0-9]*:[0-9]+/file5': Is not a directory</expected-output>
  3008. </comparator>
  3009. </comparators>
  3010. </test>
  3011. <test> <!-- TESTED -->
  3012. <description>cp: copying files to a non existent directory in Namenode's path using globbing</description>
  3013. <test-commands>
  3014. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  3015. <command>-fs NAMENODE -touchz NAMENODE/file2</command>
  3016. <command>-fs NAMENODE -touchz NAMENODE/file3</command>
  3017. <command>-fs NAMENODE -touchz NAMENODE/file4</command>
  3018. <command>-fs NAMENODE -cp NAMENODE/file* NAMENODE/dir</command>
  3019. </test-commands>
  3020. <cleanup-commands>
  3021. <command>-fs NAMENODE -rm -r NAMENODE/file*</command>
  3022. </cleanup-commands>
  3023. <comparators>
  3024. <comparator>
  3025. <type>RegexpComparator</type>
  3026. <expected-output>^cp: `hdfs://\w+[-.a-z0-9]*:[0-9]+/dir': No such file or directory</expected-output>
  3027. </comparator>
  3028. </comparators>
  3029. </test>
  3030. <test> <!-- TESTED -->
  3031. <description>cp: copying files to a non existent directory in Namenode's path without globbing</description>
  3032. <test-commands>
  3033. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  3034. <command>-fs NAMENODE -touchz NAMENODE/file2</command>
  3035. <command>-fs NAMENODE -touchz NAMENODE/file3</command>
  3036. <command>-fs NAMENODE -touchz NAMENODE/file4</command>
  3037. <command>-fs NAMENODE -cp NAMENODE/file1 NAMENODE/file2 NAMENODE/file3 NAMENODE/file4 NAMENODE/dir</command>
  3038. </test-commands>
  3039. <cleanup-commands>
  3040. <command>-fs NAMENODE -rm -r NAMENODE/file*</command>
  3041. </cleanup-commands>
  3042. <comparators>
  3043. <comparator>
  3044. <type>RegexpComparator</type>
  3045. <expected-output>^cp: `hdfs://\w+[-.a-z0-9]*:[0-9]+/dir': No such file or directory</expected-output>
  3046. </comparator>
  3047. </comparators>
  3048. </test>
  3049. <test> <!-- TESTED -->
  3050. <description>cp: copying directory to directory in Namenode's path </description>
  3051. <test-commands>
  3052. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  3053. <command>-fs NAMENODE -mkdir NAMENODE/dir1</command>
  3054. <command>-fs NAMENODE -touchz NAMENODE/dir0/file1</command>
  3055. <command>-fs NAMENODE -cp NAMENODE/dir0 NAMENODE/dir1</command>
  3056. <command>-fs NAMENODE -ls -R NAMENODE/dir*</command>
  3057. </test-commands>
  3058. <cleanup-commands>
  3059. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  3060. </cleanup-commands>
  3061. <comparators>
  3062. <comparator>
  3063. <type>RegexpComparator</type>
  3064. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/file1</expected-output>
  3065. </comparator>
  3066. <comparator>
  3067. <type>RegexpComparator</type>
  3068. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir1/dir0</expected-output>
  3069. </comparator>
  3070. <comparator>
  3071. <type>RegexpComparator</type>
  3072. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir1/dir0/file1</expected-output>
  3073. </comparator>
  3074. </comparators>
  3075. </test>
  3076. <test> <!-- TESTED -->
  3077. <description>cp: copying multiple directories to directory in Namenode's path using globbing</description>
  3078. <test-commands>
  3079. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  3080. <command>-fs NAMENODE -mkdir NAMENODE/dir1</command>
  3081. <command>-fs NAMENODE -mkdir NAMENODE/dir2</command>
  3082. <command>-fs NAMENODE -mkdir NAMENODE/dest</command>
  3083. <command>-fs NAMENODE -cp NAMENODE/dir* NAMENODE/dest</command>
  3084. <command>-fs NAMENODE -ls -R NAMENODE/d*</command>
  3085. </test-commands>
  3086. <cleanup-commands>
  3087. <command>-fs NAMNEODE -rm -r NAMENODE/d*</command>
  3088. </cleanup-commands>
  3089. <comparators>
  3090. <comparator>
  3091. <type>RegexpComparator</type>
  3092. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dest/dir0</expected-output>
  3093. </comparator>
  3094. <comparator>
  3095. <type>RegexpComparator</type>
  3096. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dest/dir1</expected-output>
  3097. </comparator>
  3098. <comparator>
  3099. <type>RegexpComparator</type>
  3100. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dest/dir2</expected-output>
  3101. </comparator>
  3102. </comparators>
  3103. </test>
  3104. <test> <!-- TESTED -->
  3105. <description>cp: copying multiple directories to directory in Namenode's path without using globbing</description>
  3106. <test-commands>
  3107. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  3108. <command>-fs NAMENODE -mkdir NAMENODE/dir1</command>
  3109. <command>-fs NAMENODE -mkdir NAMENODE/dir2</command>
  3110. <command>-fs NAMENODE -mkdir NAMENODE/dest</command>
  3111. <command>-fs NAMENODE -cp NAMENODE/dir0 NAMENODE/dir1 NAMENODE/dir2 NAMENODE/dest</command>
  3112. <command>-fs NAMENODE -ls -R NAMENODE/d*</command>
  3113. </test-commands>
  3114. <cleanup-commands>
  3115. <command>-fs NAMNEODE -rm -r NAMENODE/*</command>
  3116. </cleanup-commands>
  3117. <comparators>
  3118. <comparator>
  3119. <type>RegexpComparator</type>
  3120. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dest/dir0</expected-output>
  3121. </comparator>
  3122. <comparator>
  3123. <type>RegexpComparator</type>
  3124. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dest/dir1</expected-output>
  3125. </comparator>
  3126. <comparator>
  3127. <type>RegexpComparator</type>
  3128. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dest/dir2</expected-output>
  3129. </comparator>
  3130. </comparators>
  3131. </test>
  3132. <!-- Tests for rm -->
  3133. <test> <!-- TESTED -->
  3134. <description>rm: removing a file (absolute path) </description>
  3135. <test-commands>
  3136. <command>-fs NAMENODE -mkdir /dir0</command>
  3137. <command>-fs NAMENODE -touchz /dir0/file0</command>
  3138. <command>-fs NAMENODE -rm /dir0/file0</command>
  3139. </test-commands>
  3140. <cleanup-commands>
  3141. <command>-fs NAMENODE -rm /user</command>
  3142. </cleanup-commands>
  3143. <comparators>
  3144. <comparator>
  3145. <type>RegexpComparator</type>
  3146. <expected-output>^Deleted /dir0/file0</expected-output>
  3147. </comparator>
  3148. </comparators>
  3149. </test>
  3150. <test> <!-- TESTED -->
  3151. <description>rm: removing a file (relative path) </description>
  3152. <test-commands>
  3153. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  3154. <command>-fs NAMENODE -touchz file0</command>
  3155. <command>-fs NAMENODE -rm file0</command>
  3156. </test-commands>
  3157. <cleanup-commands>
  3158. <command>-fs NAMENODE -rm /user</command>
  3159. </cleanup-commands>
  3160. <comparators>
  3161. <comparator>
  3162. <type>RegexpComparator</type>
  3163. <expected-output>^Deleted file0</expected-output>
  3164. </comparator>
  3165. </comparators>
  3166. </test>
  3167. <test> <!-- TESTED -->
  3168. <description>rm: removing files by globbing (absolute path) </description>
  3169. <test-commands>
  3170. <command>-fs NAMENODE -mkdir /dir0</command>
  3171. <command>-fs NAMENODE -touchz /dir0/file0</command>
  3172. <command>-fs NAMENODE -touchz /dir0/file1</command>
  3173. <command>-fs NAMENODE -touchz /dir0/file2</command>
  3174. <command>-fs NAMENODE -touchz /dir0/file3</command>
  3175. <command>-fs NAMENODE -rm /dir0/file*</command>
  3176. </test-commands>
  3177. <cleanup-commands>
  3178. <command>-fs NAMENODE -rm /user</command>
  3179. </cleanup-commands>
  3180. <comparators>
  3181. <comparator>
  3182. <type>RegexpComparator</type>
  3183. <expected-output>^Deleted /dir0/file0</expected-output>
  3184. </comparator>
  3185. <comparator>
  3186. <type>RegexpComparator</type>
  3187. <expected-output>^Deleted /dir0/file1</expected-output>
  3188. </comparator>
  3189. <comparator>
  3190. <type>RegexpComparator</type>
  3191. <expected-output>^Deleted /dir0/file2</expected-output>
  3192. </comparator>
  3193. <comparator>
  3194. <type>RegexpComparator</type>
  3195. <expected-output>^Deleted /dir0/file3</expected-output>
  3196. </comparator>
  3197. </comparators>
  3198. </test>
  3199. <test> <!-- TESTED -->
  3200. <description>rm: removing files by globbing (relative path) </description>
  3201. <test-commands>
  3202. <command>-fs NAMENODE -mkdir dir</command>
  3203. <command>-fs NAMENODE -touchz file0</command>
  3204. <command>-fs NAMENODE -touchz file1</command>
  3205. <command>-fs NAMENODE -touchz file2</command>
  3206. <command>-fs NAMENODE -touchz file3</command>
  3207. <command>-fs NAMENODE -rm file*</command>
  3208. </test-commands>
  3209. <cleanup-commands>
  3210. <command>-fs NAMENODE -rm /user</command>
  3211. </cleanup-commands>
  3212. <comparators>
  3213. <comparator>
  3214. <type>RegexpComparator</type>
  3215. <expected-output>^Deleted file0</expected-output>
  3216. </comparator>
  3217. <comparator>
  3218. <type>RegexpComparator</type>
  3219. <expected-output>^Deleted file1</expected-output>
  3220. </comparator>
  3221. <comparator>
  3222. <type>RegexpComparator</type>
  3223. <expected-output>^Deleted file2</expected-output>
  3224. </comparator>
  3225. <comparator>
  3226. <type>RegexpComparator</type>
  3227. <expected-output>^Deleted file3</expected-output>
  3228. </comparator>
  3229. </comparators>
  3230. </test>
  3231. <test> <!-- TESTED -->
  3232. <description>rm: removing a directory (absolute path) </description>
  3233. <test-commands>
  3234. <command>-fs NAMENODE mkdir /dir0</command>
  3235. <command>-fs NAMENODE -rm /dir0</command>
  3236. </test-commands>
  3237. <cleanup-commands>
  3238. <command>-fs NAMENODE -rm /user</command>
  3239. </cleanup-commands>
  3240. <comparators>
  3241. <comparator>
  3242. <type>RegexpComparator</type>
  3243. <expected-output>^rm: `/dir0': Is a directory</expected-output>
  3244. </comparator>
  3245. </comparators>
  3246. </test>
  3247. <test> <!-- TESTED -->
  3248. <description>rm: removing a directory (relative path) </description>
  3249. <test-commands>
  3250. <command>-fs NAMENODE mkdir -p dir0</command>
  3251. <command>-fs NAMENODE -rm dir0</command>
  3252. </test-commands>
  3253. <cleanup-commands>
  3254. <command>-fs NAMENODE -rm /user</command>
  3255. </cleanup-commands>
  3256. <comparators>
  3257. <comparator>
  3258. <type>RegexpComparator</type>
  3259. <expected-output>^rm: `dir0': No such file or directory</expected-output>
  3260. </comparator>
  3261. </comparators>
  3262. </test>
  3263. <test> <!-- TESTED -->
  3264. <description>rm: removing a nonexistent file (absolute path) </description>
  3265. <test-commands>
  3266. <command>-fs NAMENODE -rm /dir0/file0</command>
  3267. </test-commands>
  3268. <cleanup-commands>
  3269. <command>-fs NAMENODE -rm /user</command>
  3270. </cleanup-commands>
  3271. <comparators>
  3272. <comparator>
  3273. <type>RegexpComparator</type>
  3274. <expected-output>^rm: `/dir0/file0': No such file or directory</expected-output>
  3275. </comparator>
  3276. </comparators>
  3277. </test>
  3278. <test> <!-- TESTED -->
  3279. <description>rm: removing a nonexistent file (relative path) </description>
  3280. <test-commands>
  3281. <command>-fs NAMENODE -rm file0</command>
  3282. </test-commands>
  3283. <cleanup-commands>
  3284. <command>-fs NAMENODE -rm /user</command>
  3285. </cleanup-commands>
  3286. <comparators>
  3287. <comparator>
  3288. <type>RegexpComparator</type>
  3289. <expected-output>^rm: `file0': No such file or directory</expected-output>
  3290. </comparator>
  3291. </comparators>
  3292. </test>
  3293. <test> <!-- TESTED -->
  3294. <description>rm: removing a file in hdfs:// path </description>
  3295. <test-commands>
  3296. <command>-fs NAMENODE -touchz hdfs:///file0</command>
  3297. <command>-fs NAMENODE -rm hdfs:///file0</command>
  3298. </test-commands>
  3299. <cleanup-commands>
  3300. <command>-fs NAMENODE -rm hdfs:///*</command>
  3301. </cleanup-commands>
  3302. <comparators>
  3303. <comparator>
  3304. <type>RegexpComparator</type>
  3305. <expected-output>^Deleted hdfs:///file0</expected-output>
  3306. </comparator>
  3307. </comparators>
  3308. </test>
  3309. <test> <!-- TESTED -->
  3310. <description>rm: removing files by globbing in hdfs:// path </description>
  3311. <test-commands>
  3312. <command>-fs NAMENODE -touchz hdfs:///file0</command>
  3313. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  3314. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  3315. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  3316. <command>-fs NAMENODE -rm hdfs:///file*</command>
  3317. </test-commands>
  3318. <cleanup-commands>
  3319. <command>-fs NAMENODE -rm hdfs:///*</command>
  3320. </cleanup-commands>
  3321. <comparators>
  3322. <comparator>
  3323. <type>RegexpComparator</type>
  3324. <expected-output>^Deleted hdfs:///file0</expected-output>
  3325. </comparator>
  3326. <comparator>
  3327. <type>RegexpComparator</type>
  3328. <expected-output>^Deleted hdfs:///file1</expected-output>
  3329. </comparator>
  3330. <comparator>
  3331. <type>RegexpComparator</type>
  3332. <expected-output>^Deleted hdfs:///file2</expected-output>
  3333. </comparator>
  3334. <comparator>
  3335. <type>RegexpComparator</type>
  3336. <expected-output>^Deleted hdfs:///file3</expected-output>
  3337. </comparator>
  3338. </comparators>
  3339. </test>
  3340. <test> <!-- TESTED -->
  3341. <description>rm: removing a directory in hdfs:// path </description>
  3342. <test-commands>
  3343. <command>-fs NAMENODE mkdir hdfs:///dir0</command>
  3344. <command>-fs NAMENODE -rm hdfs:///dir0</command>
  3345. </test-commands>
  3346. <cleanup-commands>
  3347. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  3348. </cleanup-commands>
  3349. <comparators>
  3350. <comparator>
  3351. <type>RegexpComparator</type>
  3352. <expected-output>^rm: `hdfs:///dir0': Is a directory</expected-output>
  3353. </comparator>
  3354. </comparators>
  3355. </test>
  3356. <test> <!-- TESTED -->
  3357. <description>rm: removing a nonexistent file or dirctory in hdfs:// path </description>
  3358. <test-commands>
  3359. <command>-fs NAMENODE -rm hdfs:///file0</command>
  3360. </test-commands>
  3361. <cleanup-commands>
  3362. <command>-fs NAMENODE -rm hdfs:///*</command>
  3363. </cleanup-commands>
  3364. <comparators>
  3365. <comparator>
  3366. <type>RegexpComparator</type>
  3367. <expected-output>^rm: `hdfs:///file0': No such file or directory</expected-output>
  3368. </comparator>
  3369. </comparators>
  3370. </test>
  3371. <test> <!-- TESTED -->
  3372. <description>rm: removing files without globbing in hdfs:// path </description>
  3373. <test-commands>
  3374. <command>-fs NAMENODE -touchz hdfs:///file0</command>
  3375. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  3376. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  3377. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  3378. <command>-fs NAMENODE -rm hdfs:///file0 hdfs:///file1 hdfs:///file2 hdfs:///file3</command>
  3379. </test-commands>
  3380. <cleanup-commands>
  3381. <command>-fs NAMENODE -rm hdfs:///*</command>
  3382. </cleanup-commands>
  3383. <comparators>
  3384. <comparator>
  3385. <type>RegexpComparator</type>
  3386. <expected-output>^Deleted hdfs:///file0</expected-output>
  3387. </comparator>
  3388. <comparator>
  3389. <type>RegexpComparator</type>
  3390. <expected-output>^Deleted hdfs:///file1</expected-output>
  3391. </comparator>
  3392. <comparator>
  3393. <type>RegexpComparator</type>
  3394. <expected-output>^Deleted hdfs:///file2</expected-output>
  3395. </comparator>
  3396. <comparator>
  3397. <type>RegexpComparator</type>
  3398. <expected-output>^Deleted hdfs:///file3</expected-output>
  3399. </comparator>
  3400. </comparators>
  3401. </test>
  3402. <test> <!-- TESTED -->
  3403. <description>rm: removing a file in Namenode's path </description>
  3404. <test-commands>
  3405. <command>-fs NAMENODE -touchz NAMENODE/file0</command>
  3406. <command>-fs NAMENODE -rm NAMENODE/file0</command>
  3407. </test-commands>
  3408. <cleanup-commands>
  3409. <command>-fs NAMENODE -rm NAMENODE/*</command>
  3410. </cleanup-commands>
  3411. <comparators>
  3412. <comparator>
  3413. <type>RegexpComparator</type>
  3414. <expected-output>^Deleted NAMENODE/file0</expected-output>
  3415. </comparator>
  3416. </comparators>
  3417. </test>
  3418. <test> <!-- TESTED -->
  3419. <description>rm: removing files by globbing in Namenode's path </description>
  3420. <test-commands>
  3421. <command>-fs NAMENODE -touchz NAMENODE/file0</command>
  3422. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  3423. <command>-fs NAMENODE -touchz NAMENODE/file2</command>
  3424. <command>-fs NAMENODE -touchz NAMENODE/file3</command>
  3425. <command>-fs NAMENODE -rm NAMENODE/file*</command>
  3426. </test-commands>
  3427. <cleanup-commands>
  3428. <command>-fs NAMENODE -rm NAMENODE/*</command>
  3429. </cleanup-commands>
  3430. <comparators>
  3431. <comparator>
  3432. <type>RegexpComparator</type>
  3433. <expected-output>^Deleted NAMENODE/file0</expected-output>
  3434. </comparator>
  3435. <comparator>
  3436. <type>RegexpComparator</type>
  3437. <expected-output>^Deleted NAMENODE/file1</expected-output>
  3438. </comparator>
  3439. <comparator>
  3440. <type>RegexpComparator</type>
  3441. <expected-output>^Deleted NAMENODE/file2</expected-output>
  3442. </comparator>
  3443. <comparator>
  3444. <type>RegexpComparator</type>
  3445. <expected-output>^Deleted NAMENODE/file3</expected-output>
  3446. </comparator>
  3447. </comparators>
  3448. </test>
  3449. <test> <!-- TESTED -->
  3450. <description>rm: removing a directory in Namenode's path </description>
  3451. <test-commands>
  3452. <command>-fs NAMENODE mkdir NAMENODE/dir0</command>
  3453. <command>-fs NAMENODE -rm NAMENODE/dir0</command>
  3454. </test-commands>
  3455. <cleanup-commands>
  3456. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  3457. </cleanup-commands>
  3458. <comparators>
  3459. <comparator>
  3460. <type>RegexpComparator</type>
  3461. <expected-output>rm: `NAMENODE/dir0': No such file or directory</expected-output>
  3462. </comparator>
  3463. </comparators>
  3464. </test>
  3465. <test> <!-- TESTED -->
  3466. <description>rm: removing a nonexistent file or directory in Namenode's path </description>
  3467. <test-commands>
  3468. <command>-fs NAMENODE -rm NAMENODE/file0</command>
  3469. </test-commands>
  3470. <cleanup-commands>
  3471. <command>-fs NAMENODE -rm NAMENODE/*</command>
  3472. </cleanup-commands>
  3473. <comparators>
  3474. <comparator>
  3475. <type>RegexpComparator</type>
  3476. <expected-output>^rm: `NAMENODE/file0': No such file or directory</expected-output>
  3477. </comparator>
  3478. </comparators>
  3479. </test>
  3480. <test> <!-- TESTED -->
  3481. <description>rm: Tremoving files without globbing in Namenode path </description>
  3482. <test-commands>
  3483. <command>-fs NAMENODE -touchz NAMENODE/file0</command>
  3484. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  3485. <command>-fs NAMENODE -touchz NAMENODE/file2</command>
  3486. <command>-fs NAMENODE -touchz NAMENODE/file3</command>
  3487. <command>-fs NAMENODE -rm NAMENODE/file0 NAMENODE/file1 NAMENODE/file2 NAMENODE/file3</command>
  3488. </test-commands>
  3489. <cleanup-commands>
  3490. <command>-fs NAMENODE -rm NAMENODE/*</command>
  3491. </cleanup-commands>
  3492. <comparators>
  3493. <comparator>
  3494. <type>RegexpComparator</type>
  3495. <expected-output>^Deleted NAMENODE/file0</expected-output>
  3496. </comparator>
  3497. <comparator>
  3498. <type>RegexpComparator</type>
  3499. <expected-output>^Deleted NAMENODE/file1</expected-output>
  3500. </comparator>
  3501. <comparator>
  3502. <type>RegexpComparator</type>
  3503. <expected-output>^Deleted NAMENODE/file2</expected-output>
  3504. </comparator>
  3505. <comparator>
  3506. <type>RegexpComparator</type>
  3507. <expected-output>^Deleted NAMENODE/file3</expected-output>
  3508. </comparator>
  3509. </comparators>
  3510. </test>
  3511. <!--Tests for rmr-->
  3512. <test> <!-- TESTED -->
  3513. <description>rm: removing a file (absolute path) </description>
  3514. <test-commands>
  3515. <command>-fs NAMENODE -mkdir /dir0</command>
  3516. <command>-fs NAMENODE -touchz /dir0/file0</command>
  3517. <command>-fs NAMENODE -rm -r /dir0/file0</command>
  3518. </test-commands>
  3519. <cleanup-commands>
  3520. <command>-fs NAMENODE -rm -r /user</command>
  3521. </cleanup-commands>
  3522. <comparators>
  3523. <comparator>
  3524. <type>RegexpComparator</type>
  3525. <expected-output>^Deleted /dir0/file0</expected-output>
  3526. </comparator>
  3527. </comparators>
  3528. </test>
  3529. <test> <!-- TESTED -->
  3530. <description>rm: removing a file (relative path) </description>
  3531. <test-commands>
  3532. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  3533. <command>-fs NAMENODE -touchz file0</command>
  3534. <command>-fs NAMENODE -rm -r file0</command>
  3535. </test-commands>
  3536. <cleanup-commands>
  3537. <command>-fs NAMENODE -rm -r /user</command>
  3538. </cleanup-commands>
  3539. <comparators>
  3540. <comparator>
  3541. <type>RegexpComparator</type>
  3542. <expected-output>^Deleted file0</expected-output>
  3543. </comparator>
  3544. </comparators>
  3545. </test>
  3546. <test> <!-- TESTED -->
  3547. <description>rm: removing a directory (absolute path) </description>
  3548. <test-commands>
  3549. <command>-fs NAMENODE -touchz /dir0</command>
  3550. <command>-fs NAMENODE -rm -r /dir0</command>
  3551. </test-commands>
  3552. <cleanup-commands>
  3553. <command>-fs NAMENODE -rm -r /user</command>
  3554. </cleanup-commands>
  3555. <comparators>
  3556. <comparator>
  3557. <type>RegexpComparator</type>
  3558. <expected-output>^Deleted /dir0</expected-output>
  3559. </comparator>
  3560. </comparators>
  3561. </test>
  3562. <test> <!-- TESTED -->
  3563. <description>rm: removing a directory (relative path) </description>
  3564. <test-commands>
  3565. <command>-fs NAMENODE -mkdir -p dir0</command>
  3566. <command>-fs NAMENODE -rm -r dir0</command>
  3567. </test-commands>
  3568. <cleanup-commands>
  3569. <command>-fs NAMENODE -rm -r /user</command>
  3570. </cleanup-commands>
  3571. <comparators>
  3572. <comparator>
  3573. <type>RegexpComparator</type>
  3574. <expected-output>^Deleted dir0</expected-output>
  3575. </comparator>
  3576. </comparators>
  3577. </test>
  3578. <test> <!-- TESTED -->
  3579. <description>rm: removing directories by globbing (absolute path) </description>
  3580. <test-commands>
  3581. <command>-fs NAMENODE -mkdir /dir0</command>
  3582. <command>-fs NAMENODE -mkdir /dir1</command>
  3583. <command>-fs NAMENODE -mkdir /dir2</command>
  3584. <command>-fs NAMENODE -mkdir /dir3</command>
  3585. <command>-fs NAMENODE -rm -r /dir*</command>
  3586. </test-commands>
  3587. <cleanup-commands>
  3588. <command>-fs NAMENODE -rm /user</command>
  3589. </cleanup-commands>
  3590. <comparators>
  3591. <comparator>
  3592. <type>RegexpComparator</type>
  3593. <expected-output>^Deleted /dir0</expected-output>
  3594. </comparator>
  3595. <comparator>
  3596. <type>RegexpComparator</type>
  3597. <expected-output>^Deleted /dir1</expected-output>
  3598. </comparator>
  3599. <comparator>
  3600. <type>RegexpComparator</type>
  3601. <expected-output>^Deleted /dir2</expected-output>
  3602. </comparator>
  3603. <comparator>
  3604. <type>RegexpComparator</type>
  3605. <expected-output>^Deleted /dir3</expected-output>
  3606. </comparator>
  3607. </comparators>
  3608. </test>
  3609. <test> <!-- TESTED -->
  3610. <description>rm: removing directories by globbing (relative path) </description>
  3611. <test-commands>
  3612. <command>-fs NAMENODE -mkdir -p dir0</command>
  3613. <command>-fs NAMENODE -mkdir -p dir1</command>
  3614. <command>-fs NAMENODE -mkdir -p dir2</command>
  3615. <command>-fs NAMENODE -mkdir -p dir3</command>
  3616. <command>-fs NAMENODE -rm -r dir*</command>
  3617. </test-commands>
  3618. <cleanup-commands>
  3619. <command>-fs NAMENODE -rm /user</command>
  3620. </cleanup-commands>
  3621. <comparators>
  3622. <comparator>
  3623. <type>RegexpComparator</type>
  3624. <expected-output>^Deleted dir0</expected-output>
  3625. </comparator>
  3626. <comparator>
  3627. <type>RegexpComparator</type>
  3628. <expected-output>^Deleted dir1</expected-output>
  3629. </comparator>
  3630. <comparator>
  3631. <type>RegexpComparator</type>
  3632. <expected-output>^Deleted dir2</expected-output>
  3633. </comparator>
  3634. <comparator>
  3635. <type>RegexpComparator</type>
  3636. <expected-output>^Deleted dir3</expected-output>
  3637. </comparator>
  3638. </comparators>
  3639. </test>
  3640. <test> <!--TESTED-->
  3641. <description>rm: removing a nonexistent file (absolute path) </description>
  3642. <test-commands>
  3643. <command>-fs NAMENODE -rm -r /dir0/file0</command>
  3644. </test-commands>
  3645. <cleanup-commands>
  3646. <command>-fs NAMENODE -rm -r /user</command>
  3647. </cleanup-commands>
  3648. <comparators>
  3649. <comparator>
  3650. <type>RegexpComparator</type>
  3651. <expected-output>^rm: `/dir0/file0': No such file or directory</expected-output>
  3652. </comparator>
  3653. </comparators>
  3654. </test>
  3655. <test> <!-- TESTED -->
  3656. <description>rm: removing a nonexistent file (relative path) </description>
  3657. <test-commands>
  3658. <command>-fs NAMENODE -rm -r file0</command>
  3659. </test-commands>
  3660. <cleanup-commands>
  3661. <command>-fs NAMENODE -rm -r /user</command>
  3662. </cleanup-commands>
  3663. <comparators>
  3664. <comparator>
  3665. <type>RegexpComparator</type>
  3666. <expected-output>^rm: `file0': No such file or directory</expected-output>
  3667. </comparator>
  3668. </comparators>
  3669. </test>
  3670. <test> <!-- TESTED -->
  3671. <description>rm: removing a file in hdfs:// path </description>
  3672. <test-commands>
  3673. <command>-fs NAMENODE -touchz hdfs:///file0</command>
  3674. <command>-fs NAMENODE -rm -r hdfs:///file0</command>
  3675. </test-commands>
  3676. <cleanup-commands>
  3677. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  3678. </cleanup-commands>
  3679. <comparators>
  3680. <comparator>
  3681. <type>RegexpComparator</type>
  3682. <expected-output>^Deleted hdfs:///file0</expected-output>
  3683. </comparator>
  3684. </comparators>
  3685. </test>
  3686. <test> <!-- TESTED -->
  3687. <description>rm: removing a directory in hdfs:// path </description>
  3688. <test-commands>
  3689. <command>-fs NAMENODE -touchz hdfs:///dir0</command>
  3690. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  3691. </test-commands>
  3692. <cleanup-commands>
  3693. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  3694. </cleanup-commands>
  3695. <comparators>
  3696. <comparator>
  3697. <type>RegexpComparator</type>
  3698. <expected-output>^Deleted hdfs:///dir0</expected-output>
  3699. </comparator>
  3700. </comparators>
  3701. </test>
  3702. <test> <!-- TESTED -->
  3703. <description>rm: removing directories by globbing in hdfs:// path </description>
  3704. <test-commands>
  3705. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  3706. <command>-fs NAMENODE -mkdir hdfs:///dir1</command>
  3707. <command>-fs NAMENODE -mkdir hdfs:///dir2</command>
  3708. <command>-fs NAMENODE -mkdir hdfs:///dir3</command>
  3709. <command>-fs NAMENODE -rm -r hdfs:///dir*</command>
  3710. </test-commands>
  3711. <cleanup-commands>
  3712. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  3713. </cleanup-commands>
  3714. <comparators>
  3715. <comparator>
  3716. <type>RegexpComparator</type>
  3717. <expected-output>^Deleted hdfs:///dir0</expected-output>
  3718. </comparator>
  3719. <comparator>
  3720. <type>RegexpComparator</type>
  3721. <expected-output>^Deleted hdfs:///dir1</expected-output>
  3722. </comparator>
  3723. <comparator>
  3724. <type>RegexpComparator</type>
  3725. <expected-output>^Deleted hdfs:///dir2</expected-output>
  3726. </comparator>
  3727. <comparator>
  3728. <type>RegexpComparator</type>
  3729. <expected-output>^Deleted hdfs:///dir3</expected-output>
  3730. </comparator>
  3731. </comparators>
  3732. </test>
  3733. <test> <!--TESTED-->
  3734. <description>rm: removing a nonexistent file or directory in hdfs:// path </description>
  3735. <test-commands>
  3736. <command>-fs NAMENODE -rm -r hdfs:///file0</command>
  3737. </test-commands>
  3738. <cleanup-commands>
  3739. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  3740. </cleanup-commands>
  3741. <comparators>
  3742. <comparator>
  3743. <type>RegexpComparator</type>
  3744. <expected-output>^rm: `hdfs:///file0': No such file or directory</expected-output>
  3745. </comparator>
  3746. </comparators>
  3747. </test>
  3748. <test> <!-- TESTED -->
  3749. <description>rm: removing directories without globbing in hdfs:// path </description>
  3750. <test-commands>
  3751. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  3752. <command>-fs NAMENODE -mkdir hdfs:///dir1</command>
  3753. <command>-fs NAMENODE -mkdir hdfs:///dir2</command>
  3754. <command>-fs NAMENODE -mkdir hdfs:///dir3</command>
  3755. <command>-fs NAMENODE -rm -r hdfs:///dir0 hdfs:///dir1 hdfs:///dir2 hdfs:///dir3</command>
  3756. </test-commands>
  3757. <cleanup-commands>
  3758. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  3759. </cleanup-commands>
  3760. <comparators>
  3761. <comparator>
  3762. <type>RegexpComparator</type>
  3763. <expected-output>^Deleted hdfs:///dir0</expected-output>
  3764. </comparator>
  3765. <comparator>
  3766. <type>RegexpComparator</type>
  3767. <expected-output>^Deleted hdfs:///dir1</expected-output>
  3768. </comparator>
  3769. <comparator>
  3770. <type>RegexpComparator</type>
  3771. <expected-output>^Deleted hdfs:///dir2</expected-output>
  3772. </comparator>
  3773. <comparator>
  3774. <type>RegexpComparator</type>
  3775. <expected-output>^Deleted hdfs:///dir3</expected-output>
  3776. </comparator>
  3777. </comparators>
  3778. </test>
  3779. <test> <!-- TESTED -->
  3780. <description>rm: Test for Namenode's path - removing a file</description>
  3781. <test-commands>
  3782. <command>-fs NAMENODE -touchz NAMENODE/file0</command>
  3783. <command>-fs NAMENODE -rm -r NAMENODE/file0</command>
  3784. </test-commands>
  3785. <cleanup-commands>
  3786. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  3787. </cleanup-commands>
  3788. <comparators>
  3789. <comparator>
  3790. <type>RegexpComparator</type>
  3791. <expected-output>^Deleted NAMENODE/file0</expected-output>
  3792. </comparator>
  3793. </comparators>
  3794. </test>
  3795. <test> <!-- TESTED -->
  3796. <description>rm: Test for Namenode's path - removing a directory</description>
  3797. <test-commands>
  3798. <command>-fs NAMENODE -touchz NAMENODE/dir0</command>
  3799. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  3800. </test-commands>
  3801. <cleanup-commands>
  3802. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  3803. </cleanup-commands>
  3804. <comparators>
  3805. <comparator>
  3806. <type>RegexpComparator</type>
  3807. <expected-output>^Deleted NAMENODE/dir0</expected-output>
  3808. </comparator>
  3809. </comparators>
  3810. </test>
  3811. <test> <!-- TESTED -->
  3812. <description>rm: removing directories by globbing in Namenode's path </description>
  3813. <test-commands>
  3814. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  3815. <command>-fs NAMENODE -mkdir NAMENODE/dir1</command>
  3816. <command>-fs NAMENODE -mkdir NAMENODE/dir2</command>
  3817. <command>-fs NAMENODE -mkdir NAMENODE/dir3</command>
  3818. <command>-fs NAMENODE -rm -r NAMENODE/dir*</command>
  3819. </test-commands>
  3820. <cleanup-commands>
  3821. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  3822. </cleanup-commands>
  3823. <comparators>
  3824. <comparator>
  3825. <type>RegexpComparator</type>
  3826. <expected-output>^Deleted NAMENODE/dir0</expected-output>
  3827. </comparator>
  3828. <comparator>
  3829. <type>RegexpComparator</type>
  3830. <expected-output>^Deleted NAMENODE/dir1</expected-output>
  3831. </comparator>
  3832. <comparator>
  3833. <type>RegexpComparator</type>
  3834. <expected-output>^Deleted NAMENODE/dir2</expected-output>
  3835. </comparator>
  3836. <comparator>
  3837. <type>RegexpComparator</type>
  3838. <expected-output>^Deleted NAMENODE/dir3</expected-output>
  3839. </comparator>
  3840. </comparators>
  3841. </test>
  3842. <test> <!--TESTED-->
  3843. <description>rm: removing a nonexistent file or directory in Namenode's path </description>
  3844. <test-commands>
  3845. <command>-fs NAMENODE -rm -r NAMENODE/file0</command>
  3846. </test-commands>
  3847. <cleanup-commands>
  3848. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  3849. </cleanup-commands>
  3850. <comparators>
  3851. <comparator>
  3852. <type>RegexpComparator</type>
  3853. <expected-output>^rm: `NAMENODE/file0': No such file or directory</expected-output>
  3854. </comparator>
  3855. </comparators>
  3856. </test>
  3857. <test> <!-- TESTED -->
  3858. <description>rm: removing directories without globbing in Namenode's path </description>
  3859. <test-commands>
  3860. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  3861. <command>-fs NAMENODE -mkdir NAMENODE/dir1</command>
  3862. <command>-fs NAMENODE -mkdir NAMENODE/dir2</command>
  3863. <command>-fs NAMENODE -mkdir NAMENODE/dir3</command>
  3864. <command>-fs NAMENODE -rm -r NAMENODE/dir0 NAMENODE/dir1 NAMENODE/dir2 NAMENODE/dir3</command>
  3865. </test-commands>
  3866. <cleanup-commands>
  3867. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  3868. </cleanup-commands>
  3869. <comparators>
  3870. <comparator>
  3871. <type>RegexpComparator</type>
  3872. <expected-output>^Deleted NAMENODE/dir0</expected-output>
  3873. </comparator>
  3874. <comparator>
  3875. <type>RegexpComparator</type>
  3876. <expected-output>^Deleted NAMENODE/dir1</expected-output>
  3877. </comparator>
  3878. <comparator>
  3879. <type>RegexpComparator</type>
  3880. <expected-output>^Deleted NAMENODE/dir2</expected-output>
  3881. </comparator>
  3882. <comparator>
  3883. <type>RegexpComparator</type>
  3884. <expected-output>^Deleted NAMENODE/dir3</expected-output>
  3885. </comparator>
  3886. </comparators>
  3887. </test>
  3888. <!-- Tests for expunge -->
  3889. <!-- Not yet implemented -->
  3890. <!-- Tests for put -->
  3891. <test> <!-- TESTED -->
  3892. <description>put: putting file into a file (absolute path)</description>
  3893. <test-commands>
  3894. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /data15bytes</command>
  3895. <command>-fs NAMENODE -du /data15bytes</command>
  3896. </test-commands>
  3897. <cleanup-commands>
  3898. <command>-fs NAMENODE -rm /data15bytes</command>
  3899. </cleanup-commands>
  3900. <comparators>
  3901. <comparator>
  3902. <type>RegexpComparator</type>
  3903. <expected-output>^15\s+15\s+/data15bytes</expected-output>
  3904. </comparator>
  3905. </comparators>
  3906. </test>
  3907. <test> <!-- TESTED -->
  3908. <description>put: putting file into a file (relative path)</description>
  3909. <test-commands>
  3910. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  3911. <command>-fs NAMENODE -touchz test</command>
  3912. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes data15bytes</command>
  3913. <command>-fs NAMENODE -du data15bytes</command>
  3914. </test-commands>
  3915. <cleanup-commands>
  3916. <command>-fs NAMENODE -rm -r /user</command>
  3917. </cleanup-commands>
  3918. <comparators>
  3919. <comparator>
  3920. <type>RegexpComparator</type>
  3921. <expected-output>^15\s+15\s+data15bytes</expected-output>
  3922. </comparator>
  3923. </comparators>
  3924. </test>
  3925. <test> <!-- TESTED -->
  3926. <description>put: putting file into a directory(absolute path)</description>
  3927. <test-commands>
  3928. <command>-fs NAMENODE -mkdir -p /dir0/dir1/data</command>
  3929. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/dir1/data</command> -->
  3930. <command>-fs NAMENODE -du /dir0/dir1/data</command>
  3931. </test-commands>
  3932. <cleanup-commands>
  3933. <command>-fs NAMENODE -rm -r /dir0</command>
  3934. </cleanup-commands>
  3935. <comparators>
  3936. <comparator>
  3937. <type>RegexpComparator</type>
  3938. <expected-output>^15\s+15\s+/dir0/dir1/data/data15bytes</expected-output>
  3939. </comparator>
  3940. </comparators>
  3941. </test>
  3942. <test> <!-- TESTED -->
  3943. <description>put: putting file into a directory(relative path)</description>
  3944. <test-commands>
  3945. <command>-fs NAMENODE -mkdir -p dir0/dir1/data</command>
  3946. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes dir0/dir1/data</command>
  3947. <command>-fs NAMENODE -du dir0/dir1/data</command>
  3948. </test-commands>
  3949. <cleanup-commands>
  3950. <command>-fs NAMENODE -rm -r /user</command>
  3951. </cleanup-commands>
  3952. <comparators>
  3953. <comparator>
  3954. <type>RegexpComparator</type>
  3955. <expected-output>^15\s+15\s+dir0/dir1/data/data15bytes</expected-output>
  3956. </comparator>
  3957. </comparators>
  3958. </test>
  3959. <test> <!-- TESTED -->
  3960. <description>put: putting many files into an existing directory(absolute path)</description>
  3961. <test-commands>
  3962. <command>-fs NAMENODE -mkdir /dir0</command>
  3963. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes CLITEST_DATA/data30bytes /dir0</command>
  3964. <command>-fs NAMENODE -du /dir0</command>
  3965. </test-commands>
  3966. <cleanup-commands>
  3967. <command>-fs NAMENODE -rm -r /user</command>
  3968. </cleanup-commands>
  3969. <comparators>
  3970. <comparator>
  3971. <type>RegexpComparator</type>
  3972. <expected-output>^15\s+15\s+/dir0/data15bytes</expected-output>
  3973. </comparator>
  3974. <comparator>
  3975. <type>RegexpComparator</type>
  3976. <expected-output>^30\s+30\s+/dir0/data30bytes</expected-output>
  3977. </comparator>
  3978. </comparators>
  3979. </test>
  3980. <test> <!-- TESTED -->
  3981. <description>put: putting many files into an existing directory(relative path)</description>
  3982. <test-commands>
  3983. <command>-fs NAMENODE -mkdir -p dir0</command>
  3984. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes CLITEST_DATA/data30bytes dir0</command>
  3985. <command>-fs NAMENODE -du dir0</command>
  3986. </test-commands>
  3987. <cleanup-commands>
  3988. <command>-fs NAMENODE -rm -r /user</command>
  3989. </cleanup-commands>
  3990. <comparators>
  3991. <comparator>
  3992. <type>RegexpComparator</type>
  3993. <expected-output>^15\s+15\s+dir0/data15bytes</expected-output>
  3994. </comparator>
  3995. <comparator>
  3996. <type>RegexpComparator</type>
  3997. <expected-output>^30\s+30\s+dir0/data30bytes</expected-output>
  3998. </comparator>
  3999. </comparators>
  4000. </test>
  4001. <test> <!-- TESTED -->
  4002. <description>put: putting non existent file(absolute path)</description>
  4003. <test-commands>
  4004. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  4005. <command>-fs NAMENODE -touchz test</command>
  4006. <command>-fs NAMENODE -put /user/wrongdata file</command>
  4007. </test-commands>
  4008. <cleanup-commands>
  4009. <command>-fs NAMENODE -rm -r /user</command>
  4010. </cleanup-commands>
  4011. <comparators>
  4012. <comparator>
  4013. <type>TokenComparator</type>
  4014. <expected-output>put: `/user/wrongdata': No such file or directory</expected-output>
  4015. </comparator>
  4016. </comparators>
  4017. </test>
  4018. <test> <!-- TESTED -->
  4019. <description>put: putting non existent file(relative path)</description>
  4020. <test-commands>
  4021. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  4022. <command>-fs NAMENODE -touchz test</command>
  4023. <command>-fs NAMENODE -put wrongdata file</command>
  4024. </test-commands>
  4025. <cleanup-commands>
  4026. <command>-fs NAMENODE -rm -r /user</command>
  4027. </cleanup-commands>
  4028. <comparators>
  4029. <comparator>
  4030. <type>TokenComparator</type>
  4031. <expected-output>put: `wrongdata': No such file or directory</expected-output>
  4032. </comparator>
  4033. </comparators>
  4034. </test>
  4035. <test> <!-- TESTED -->
  4036. <description>put: putting file into an already existing destination(absolute path)</description>
  4037. <test-commands>
  4038. <command>-fs NAMENODE -mkdir /user</command>
  4039. <command>-fs NAMENODE -touchz /user/file0</command>
  4040. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /user/file0</command>
  4041. </test-commands>
  4042. <cleanup-commands>
  4043. <command>-fs NAMENODE -rm -r /user</command>
  4044. </cleanup-commands>
  4045. <comparators>
  4046. <comparator>
  4047. <type>TokenComparator</type>
  4048. <expected-output>put: `/user/file0': File exists</expected-output>
  4049. </comparator>
  4050. </comparators>
  4051. </test>
  4052. <test> <!-- TESTED -->
  4053. <description>put: putting file into an already existing destination with -f option(absolute path)</description>
  4054. <test-commands>
  4055. <command>-fs NAMENODE -mkdir /user</command>
  4056. <command>-fs NAMENODE -touchz /user/file0</command>
  4057. <command>-fs NAMENODE -put -f CLITEST_DATA/data120bytes /user/file0</command>
  4058. <command>-fs NAMENODE -cat /user/file0</command>
  4059. </test-commands>
  4060. <cleanup-commands>
  4061. <command>-fs NAMENODE -rm -r /user</command>
  4062. </cleanup-commands>
  4063. <comparators>
  4064. <comparator>
  4065. <type>RegexpComparator</type>
  4066. <expected-output>12345678901234</expected-output>
  4067. </comparator>
  4068. </comparators>
  4069. </test>
  4070. <test> <!-- TESTED -->
  4071. <description>put: putting file into an already existing destination(relative path)</description>
  4072. <test-commands>
  4073. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  4074. <command>-fs NAMENODE -touchz file0</command>
  4075. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes file0</command>
  4076. </test-commands>
  4077. <cleanup-commands>
  4078. <command>-fs NAMENODE -rm -r /user</command>
  4079. </cleanup-commands>
  4080. <comparators>
  4081. <comparator>
  4082. <type>TokenComparator</type>
  4083. <expected-output>put: `file0': File exists</expected-output>
  4084. </comparator>
  4085. </comparators>
  4086. </test>
  4087. <test> <!-- TESTED -->
  4088. <description>put: putting many files into an existing file</description>
  4089. <test-commands>
  4090. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /data15bytes</command>
  4091. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /data30bytes</command>
  4092. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  4093. <command>-fs NAMENODE -touchz file0</command>
  4094. <command>-fs NAMENODE -put /data15bytes /data30bytes file0</command>
  4095. </test-commands>
  4096. <cleanup-commands>
  4097. <command>-fs NAMENODE -rm -r /user</command>
  4098. </cleanup-commands>
  4099. <comparators>
  4100. <comparator>
  4101. <type>RegexpComparator</type>
  4102. <expected-output>^put: `file0': Is not a directory</expected-output>
  4103. </comparator>
  4104. </comparators>
  4105. </test>
  4106. <test> <!-- TESTED -->
  4107. <description>put: putting many files into a non existent directory</description>
  4108. <test-commands>
  4109. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /data15bytes</command>
  4110. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /data30bytes</command>
  4111. <command>-fs NAMENODE -put /data15bytes /data30bytes wrongdir</command>
  4112. </test-commands>
  4113. <cleanup-commands>
  4114. <command>-fs NAMENODE -rm -r /user</command>
  4115. </cleanup-commands>
  4116. <comparators>
  4117. <comparator>
  4118. <type>RegexpComparator</type>
  4119. <expected-output>^put: `wrongdir': No such file or directory</expected-output>
  4120. </comparator>
  4121. </comparators>
  4122. </test>
  4123. <test> <!-- TESTED -->
  4124. <description>put: putting a local file into hdfs:// path </description>
  4125. <test-commands>
  4126. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///data15bytes</command>
  4127. <command>-fs NAMENODE -du hdfs:///data15bytes</command>
  4128. </test-commands>
  4129. <cleanup-commands>
  4130. <command>-fs NAMENODE -rm hdfs:///data15bytes</command>
  4131. </cleanup-commands>
  4132. <comparators>
  4133. <comparator>
  4134. <type>RegexpComparator</type>
  4135. <expected-output>^15\s+15\s+hdfs:///data15bytes</expected-output>
  4136. </comparator>
  4137. </comparators>
  4138. </test>
  4139. <test> <!-- TESTED -->
  4140. <description>put: putting file into a directory in hdfs:// path </description>
  4141. <test-commands>
  4142. <command>-fs NAMENODE -mkdir -p /dir1/data</command>
  4143. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///dir1/data</command>
  4144. <command>-fs NAMENODE -du hdfs:///dir1/data/</command>
  4145. </test-commands>
  4146. <cleanup-commands>
  4147. <command>-fs NAMENODE -rm -r hdfs:///dir1/data</command>
  4148. </cleanup-commands>
  4149. <comparators>
  4150. <comparator>
  4151. <type>RegexpComparator</type>
  4152. <expected-output>^15\s+15\s+hdfs:///dir1/data/data15bytes</expected-output>
  4153. </comparator>
  4154. </comparators>
  4155. </test>
  4156. <test> <!-- TESTED -->
  4157. <description>put: putting many local files into an existing directory in hdfs:// path </description>
  4158. <test-commands>
  4159. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  4160. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes CLITEST_DATA/data30bytes hdfs:///dir0</command>
  4161. <command>-fs NAMENODE -du hdfs:///dir0</command>
  4162. </test-commands>
  4163. <cleanup-commands>
  4164. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  4165. </cleanup-commands>
  4166. <comparators>
  4167. <comparator>
  4168. <type>RegexpComparator</type>
  4169. <expected-output>^15\s+15\s+hdfs:///dir0/data15bytes</expected-output>
  4170. </comparator>
  4171. <comparator>
  4172. <type>RegexpComparator</type>
  4173. <expected-output>^30\s+30\s+hdfs:///dir0/data30bytes</expected-output>
  4174. </comparator>
  4175. </comparators>
  4176. </test>
  4177. <test> <!-- TESTED -->
  4178. <description>put: putting non existent file in hdfs:// path </description>
  4179. <test-commands>
  4180. <command>-fs NAMENODE -put /user/wrongdata hdfs:///file</command>
  4181. </test-commands>
  4182. <cleanup-commands>
  4183. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  4184. </cleanup-commands>
  4185. <comparators>
  4186. <comparator>
  4187. <type>TokenComparator</type>
  4188. <expected-output>put: `/user/wrongdata': No such file or directory</expected-output>
  4189. </comparator>
  4190. </comparators>
  4191. </test>
  4192. <test> <!-- TESTED -->
  4193. <description>put: putting local file into an already existing destination in hdfs:// path </description>
  4194. <test-commands>
  4195. <command>-fs NAMENODE -mkdir hdfs:///user/</command>
  4196. <command>-fs NAMENODE -touchz hdfs:///user/file0</command>
  4197. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///user/file0</command>
  4198. </test-commands>
  4199. <cleanup-commands>
  4200. <command>-fs NAMENODE -rm -r hdfs:///user</command>
  4201. </cleanup-commands>
  4202. <comparators>
  4203. <comparator>
  4204. <type>TokenComparator</type>
  4205. <expected-output>put: `hdfs:///user/file0': File exists</expected-output>
  4206. </comparator>
  4207. </comparators>
  4208. </test>
  4209. <test> <!-- TESTED -->
  4210. <description>put: putting many local files into an existing file in hdfs:// path</description>
  4211. <test-commands>
  4212. <command>-fs NAMENODE -touchz hdfs:///file0</command>
  4213. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes CLITEST_DATA/data30bytes hdfs:///file0</command>
  4214. </test-commands>
  4215. <cleanup-commands>
  4216. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  4217. </cleanup-commands>
  4218. <comparators>
  4219. <comparator>
  4220. <type>RegexpComparator</type>
  4221. <expected-output>^put: `hdfs:///file0': Is not a directory</expected-output>
  4222. </comparator>
  4223. </comparators>
  4224. </test>
  4225. <test> <!-- TESTED -->
  4226. <description>put: putting file into a non existent directory in hdfs:// path </description>
  4227. <test-commands>
  4228. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes CLITEST_DATA/data30bytes hdfs:///wrongdir</command>
  4229. </test-commands>
  4230. <cleanup-commands>
  4231. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  4232. </cleanup-commands>
  4233. <comparators>
  4234. <comparator>
  4235. <type>RegexpComparator</type>
  4236. <expected-output>^put: `hdfs:///wrongdir': No such file or directory</expected-output>
  4237. </comparator>
  4238. </comparators>
  4239. </test>
  4240. <test> <!-- TESTED -->
  4241. <description>put: putting a local file into in Namenode's path </description>
  4242. <test-commands>
  4243. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/data15bytes</command>
  4244. <command>-fs NAMENODE -du NAMENODE/data15bytes</command>
  4245. </test-commands>
  4246. <cleanup-commands>
  4247. <command>-fs NAMENODE -rm NAMENODE/data15bytes</command>
  4248. </cleanup-commands>
  4249. <comparators>
  4250. <comparator>
  4251. <type>RegexpComparator</type>
  4252. <expected-output>^15\s+15\s+NAMENODE/data15bytes</expected-output>
  4253. </comparator>
  4254. </comparators>
  4255. </test>
  4256. <test> <!-- TESTED -->
  4257. <description>put: putting file into a directory in Namenode's path </description>
  4258. <test-commands>
  4259. <command>-fs NAMENODE -mkdir -p /dir1/data</command>
  4260. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir1/data</command>
  4261. <command>-fs NAMENODE -du NAMENODE/dir1/data</command>
  4262. </test-commands>
  4263. <cleanup-commands>
  4264. <command>-fs NAMENODE -rm -r NAMENODE/dir1/data</command>
  4265. </cleanup-commands>
  4266. <comparators>
  4267. <comparator>
  4268. <type>RegexpComparator</type>
  4269. <expected-output>^15\s+15\s+NAMENODE/dir1/data/data15bytes</expected-output>
  4270. </comparator>
  4271. </comparators>
  4272. </test>
  4273. <test> <!-- TESTED -->
  4274. <description>put: putting many local files into an existing directory in Namenode's path</description>
  4275. <test-commands>
  4276. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  4277. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes CLITEST_DATA/data30bytes NAMENODE/dir0</command>
  4278. <command>-fs NAMENODE -du NAMENODE/dir0</command>
  4279. </test-commands>
  4280. <cleanup-commands>
  4281. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  4282. </cleanup-commands>
  4283. <comparators>
  4284. <comparator>
  4285. <type>RegexpComparator</type>
  4286. <expected-output>^15\s+15\s+NAMENODE/dir0/data15bytes</expected-output>
  4287. </comparator>
  4288. <comparator>
  4289. <type>RegexpComparator</type>
  4290. <expected-output>^30\s+30\s+NAMENODE/dir0/data30bytes</expected-output>
  4291. </comparator>
  4292. </comparators>
  4293. </test>
  4294. <test> <!-- TESTED -->
  4295. <description>put: putting non existent file in Namenode's path </description>
  4296. <test-commands>
  4297. <command>-fs NAMENODE -put /user/wrongdata NAMENODE/file</command>
  4298. </test-commands>
  4299. <cleanup-commands>
  4300. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  4301. </cleanup-commands>
  4302. <comparators>
  4303. <comparator>
  4304. <type>RegexpComparator</type>
  4305. <expected-output>^put: `/user/wrongdata': No such file or directory</expected-output>
  4306. </comparator>
  4307. </comparators>
  4308. </test>
  4309. <test> <!-- TESTED -->
  4310. <description>put: putting local file into an already existing destination in Namenode's path</description>
  4311. <test-commands>
  4312. <command>-fs NAMENODE -mkdir NAMENODE/user/</command>
  4313. <command>-fs NAMENODE -touchz NAMENODE/user/file0</command>
  4314. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/user/file0</command>
  4315. </test-commands>
  4316. <cleanup-commands>
  4317. <command>-fs NAMENODE -rm -r NAMENODE/user</command>
  4318. </cleanup-commands>
  4319. <comparators>
  4320. <comparator>
  4321. <type>RegexpComparator</type>
  4322. <expected-output>^put: `hdfs://\w+[-.a-z0-9]*:[0-9]+/user/file0': File exists</expected-output>
  4323. </comparator>
  4324. </comparators>
  4325. </test>
  4326. <test> <!-- TESTED -->
  4327. <description>put: putting many local files into an existing file in Namenode's path </description>
  4328. <test-commands>
  4329. <command>-fs NAMENODE -touchz NAMENODE/file0</command>
  4330. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes CLITEST_DATA/data30bytes NAMENODE/file0</command>
  4331. </test-commands>
  4332. <cleanup-commands>
  4333. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  4334. </cleanup-commands>
  4335. <comparators>
  4336. <comparator>
  4337. <type>RegexpComparator</type>
  4338. <expected-output>^put: `hdfs://\w+[-.a-z0-9]*:[0-9]+/file0': Is not a directory</expected-output>
  4339. </comparator>
  4340. </comparators>
  4341. </test>
  4342. <test> <!-- TESTED -->
  4343. <description>put: putting many files into a non existent directory in Namenode's path </description>
  4344. <test-commands>
  4345. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes CLITEST_DATA/data30bytes NAMENODE/wrongdir</command>
  4346. </test-commands>
  4347. <cleanup-commands>
  4348. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  4349. </cleanup-commands>
  4350. <comparators>
  4351. <comparator>
  4352. <type>RegexpComparator</type>
  4353. <expected-output>^put: `hdfs://\w+[-.a-z0-9]*:[0-9]+/wrongdir': No such file or directory</expected-output>
  4354. </comparator>
  4355. </comparators>
  4356. </test>
  4357. <!-- Tests for copyFromLocal -->
  4358. <test> <!-- TESTED -->
  4359. <description>copyFromLocal: copying file into a file (absolute path)</description>
  4360. <test-commands>
  4361. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes /data15bytes</command>
  4362. <command>-fs NAMENODE -du /data15bytes</command>
  4363. </test-commands>
  4364. <cleanup-commands>
  4365. <command>-fs NAMENODE -rm /data15bytes</command>
  4366. </cleanup-commands>
  4367. <comparators>
  4368. <comparator>
  4369. <type>RegexpComparator</type>
  4370. <expected-output>^15\s+15\s+/data15bytes</expected-output>
  4371. </comparator>
  4372. </comparators>
  4373. </test>
  4374. <test> <!-- TESTED -->
  4375. <description>copyFromLocal: copying file into a file (relative path)</description>
  4376. <test-commands>
  4377. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  4378. <command>-fs NAMENODE -touchz test</command>
  4379. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes data15bytes</command>
  4380. <command>-fs NAMENODE -du data15bytes</command>
  4381. </test-commands>
  4382. <cleanup-commands>
  4383. <command>-fs NAMENODE -rm -r /user</command>
  4384. </cleanup-commands>
  4385. <comparators>
  4386. <comparator>
  4387. <type>RegexpComparator</type>
  4388. <expected-output>^15\s+15\s+data15bytes</expected-output>
  4389. </comparator>
  4390. </comparators>
  4391. </test>
  4392. <test> <!-- TESTED -->
  4393. <description>copyFromLocal: copying file into a directory(absolute path)</description>
  4394. <test-commands>
  4395. <command>-fs NAMENODE -mkdir -p /dir0/dir1/data</command>
  4396. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes /dir0/dir1/data</command>
  4397. <command>-fs NAMENODE -du /dir0/dir1/data/*</command>
  4398. </test-commands>
  4399. <cleanup-commands>
  4400. <command>-fs NAMENODE -rm -r /dir0</command>
  4401. </cleanup-commands>
  4402. <comparators>
  4403. <comparator>
  4404. <type>RegexpComparator</type>
  4405. <expected-output>^15\s+15\s+/dir0/dir1/data/data15bytes</expected-output>
  4406. </comparator>
  4407. </comparators>
  4408. </test>
  4409. <test> <!-- TESTED -->
  4410. <description>copyFromLocal: copying file into a directory(relative path)</description>
  4411. <test-commands>
  4412. <command>-fs NAMENODE -mkdir -p dir0/dir1/data</command>
  4413. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes dir0/dir1/data</command>
  4414. <command>-fs NAMENODE -du dir0/dir1/data/*</command>
  4415. </test-commands>
  4416. <cleanup-commands>
  4417. <command>-fs NAMENODE -rm -r /user</command>
  4418. </cleanup-commands>
  4419. <comparators>
  4420. <comparator>
  4421. <type>RegexpComparator</type>
  4422. <expected-output>^15\s+15\s+dir0/dir1/data/data15bytes</expected-output>
  4423. </comparator>
  4424. </comparators>
  4425. </test>
  4426. <test> <!-- TESTED -->
  4427. <description>copyFromLocal: copying many files into an existing directory(absolute path)</description>
  4428. <test-commands>
  4429. <command>-fs NAMENODE -mkdir /dir0</command>
  4430. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes CLITEST_DATA/data30bytes /dir0</command>
  4431. <command>-fs NAMENODE -du /dir0</command>
  4432. </test-commands>
  4433. <cleanup-commands>
  4434. <command>-fs NAMENODE -rm -r /user</command>
  4435. </cleanup-commands>
  4436. <comparators>
  4437. <comparator>
  4438. <type>RegexpComparator</type>
  4439. <expected-output>^15\s+15\s+/dir0/data15bytes</expected-output>
  4440. </comparator>
  4441. <comparator>
  4442. <type>RegexpComparator</type>
  4443. <expected-output>^30\s+30\s+/dir0/data30bytes</expected-output>
  4444. </comparator>
  4445. </comparators>
  4446. </test>
  4447. <test> <!-- TESTED -->
  4448. <description>copyFromLocal: copying many files into an existing directory(relative path)</description>
  4449. <test-commands>
  4450. <command>-fs NAMENODE -mkdir -p dir0</command>
  4451. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes CLITEST_DATA/data30bytes dir0</command>
  4452. <command>-fs NAMENODE -du dir0</command>
  4453. </test-commands>
  4454. <cleanup-commands>
  4455. <command>-fs NAMENODE -rm -r /user</command>
  4456. </cleanup-commands>
  4457. <comparators>
  4458. <comparator>
  4459. <type>RegexpComparator</type>
  4460. <expected-output>^15\s+15\s+dir0/data15bytes</expected-output>
  4461. </comparator>
  4462. <comparator>
  4463. <type>RegexpComparator</type>
  4464. <expected-output>^30\s+30\s+dir0/data30bytes</expected-output>
  4465. </comparator>
  4466. </comparators>
  4467. </test>
  4468. <test> <!-- TESTED -->
  4469. <description>copyFromLocal: copying non existent file(absolute path)</description>
  4470. <test-commands>
  4471. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  4472. <command>-fs NAMENODE -touchz test</command>
  4473. <command>-fs NAMENODE -copyFromLocal /user/wrongdata file</command>
  4474. </test-commands>
  4475. <cleanup-commands>
  4476. <command>-fs NAMENODE -rm -r /user</command>
  4477. </cleanup-commands>
  4478. <comparators>
  4479. <comparator>
  4480. <type>TokenComparator</type>
  4481. <expected-output>copyFromLocal: `/user/wrongdata': No such file or directory</expected-output>
  4482. </comparator>
  4483. </comparators>
  4484. </test>
  4485. <test> <!-- TESTED -->
  4486. <description>copyFromLocal: copying non existent file(relative path)</description>
  4487. <test-commands>
  4488. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  4489. <command>-fs NAMENODE -touchz test</command>
  4490. <command>-fs NAMENODE -copyFromLocal wrongdata file</command>
  4491. </test-commands>
  4492. <cleanup-commands>
  4493. <command>-fs NAMENODE -rm -r /user</command>
  4494. </cleanup-commands>
  4495. <comparators>
  4496. <comparator>
  4497. <type>TokenComparator</type>
  4498. <expected-output>copyFromLocal: `wrongdata': No such file or directory</expected-output>
  4499. </comparator>
  4500. </comparators>
  4501. </test>
  4502. <test> <!-- TESTED -->
  4503. <description>copyFromLocal: copying file into an already existing destination(absolute path)</description>
  4504. <test-commands>
  4505. <command>-fs NAMENODE -mkdir /user</command>
  4506. <command>-fs NAMENODE -touchz /user/file0</command>
  4507. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes /user/file0</command>
  4508. </test-commands>
  4509. <cleanup-commands>
  4510. <command>-fs NAMENODE -rm -r /user</command>
  4511. </cleanup-commands>
  4512. <comparators>
  4513. <comparator>
  4514. <type>TokenComparator</type>
  4515. <expected-output>copyFromLocal: `/user/file0': File exists</expected-output>
  4516. </comparator>
  4517. </comparators>
  4518. </test>
  4519. <test> <!-- TESTED -->
  4520. <description>copyFromLocal: copying file into an already existing destination with -f option(absolute path)</description>
  4521. <test-commands>
  4522. <command>-fs NAMENODE -mkdir /user</command>
  4523. <command>-fs NAMENODE -touchz /user/file0</command>
  4524. <command>-fs NAMENODE -copyFromLocal -f CLITEST_DATA/data120bytes /user/file0</command>
  4525. <command>-fs NAMENODE -cat /user/file0</command>
  4526. </test-commands>
  4527. <cleanup-commands>
  4528. <command>-fs NAMENODE -rm -r /user</command>
  4529. </cleanup-commands>
  4530. <comparators>
  4531. <comparator>
  4532. <type>RegexpComparator</type>
  4533. <expected-output>12345678901234</expected-output>
  4534. </comparator>
  4535. </comparators>
  4536. </test>
  4537. <test> <!-- TESTED -->
  4538. <description>copyFromLocal: copying file into an already existing destination(relative path)</description>
  4539. <test-commands>
  4540. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  4541. <command>-fs NAMENODE -touchz file0</command>
  4542. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes file0</command>
  4543. </test-commands>
  4544. <cleanup-commands>
  4545. <command>-fs NAMENODE -rm -r /user</command>
  4546. </cleanup-commands>
  4547. <comparators>
  4548. <comparator>
  4549. <type>TokenComparator</type>
  4550. <expected-output>copyFromLocal: `file0': File exists</expected-output>
  4551. </comparator>
  4552. </comparators>
  4553. </test>
  4554. <test> <!-- TESTED -->
  4555. <description>copyFromLocal: copying many files into an existing file</description>
  4556. <test-commands>
  4557. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes /data15bytes</command>
  4558. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data30bytes /data30bytes</command>
  4559. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  4560. <command>-fs NAMENODE -touchz file0</command>
  4561. <command>-fs NAMENODE -copyFromLocal /data15bytes /data30bytes file0</command>
  4562. </test-commands>
  4563. <cleanup-commands>
  4564. <command>-fs NAMENODE -rm -r /user</command>
  4565. </cleanup-commands>
  4566. <comparators>
  4567. <comparator>
  4568. <type>RegexpComparator</type>
  4569. <expected-output>^copyFromLocal: `file0': Is not a directory</expected-output>
  4570. </comparator>
  4571. </comparators>
  4572. </test>
  4573. <test> <!-- TESTED -->
  4574. <description>copyFromLocal: copying many files into a non existent directory</description>
  4575. <test-commands>
  4576. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes /data15bytes</command>
  4577. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data30bytes /data30bytes</command>
  4578. <command>-fs NAMENODE -copyFromLocal /data15bytes /data30bytes wrongdir</command>
  4579. </test-commands>
  4580. <cleanup-commands>
  4581. <command>-fs NAMENODE -rm -r /user</command>
  4582. </cleanup-commands>
  4583. <comparators>
  4584. <comparator>
  4585. <type>RegexpComparator</type>
  4586. <expected-output>^copyFromLocal: `wrongdir': No such file or directory</expected-output>
  4587. </comparator>
  4588. </comparators>
  4589. </test>
  4590. <test> <!-- TESTED -->
  4591. <description>copyFromLocal: Test for hdfs:// path - copying local file into a hdfs://file</description>
  4592. <test-commands>
  4593. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes hdfs:///data15bytes</command>
  4594. <command>-fs NAMENODE -du hdfs:///data15bytes</command>
  4595. </test-commands>
  4596. <cleanup-commands>
  4597. <command>-fs NAMENODE -rm hdfs:///data15bytes</command>
  4598. </cleanup-commands>
  4599. <comparators>
  4600. <comparator>
  4601. <type>RegexpComparator</type>
  4602. <expected-output>^15\s+15\s+hdfs:///data15bytes</expected-output>
  4603. </comparator>
  4604. </comparators>
  4605. </test>
  4606. <test> <!-- TESTED -->
  4607. <description>copyFromLocal: Test for hdfs:// path - copying local file into a hdfs directory</description>
  4608. <test-commands>
  4609. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  4610. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
  4611. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1/data</command>
  4612. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes hdfs:///dir0/dir1/data/</command>
  4613. <command>-fs NAMENODE -du hdfs:///dir0/dir1/data/data15bytes</command>
  4614. </test-commands>
  4615. <cleanup-commands>
  4616. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  4617. </cleanup-commands>
  4618. <comparators>
  4619. <comparator>
  4620. <type>RegexpComparator</type>
  4621. <expected-output>^15\s+15\s+hdfs:///dir0/dir1/data/data15bytes</expected-output>
  4622. </comparator>
  4623. </comparators>
  4624. </test>
  4625. <test> <!-- TESTED -->
  4626. <description>copyFromLocal: Test for hdfs:// path copying many local files into an existing hdfs directory</description>
  4627. <test-commands>
  4628. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  4629. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes CLITEST_DATA/data30bytes hdfs:///dir0</command>
  4630. <command>-fs NAMENODE -du hdfs:///dir0</command>
  4631. </test-commands>
  4632. <cleanup-commands>
  4633. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  4634. </cleanup-commands>
  4635. <comparators>
  4636. <comparator>
  4637. <type>RegexpComparator</type>
  4638. <expected-output>^15\s+15\s+hdfs:///dir0/data15bytes</expected-output>
  4639. </comparator>
  4640. <comparator>
  4641. <type>RegexpComparator</type>
  4642. <expected-output>^30\s+30\s+hdfs:///dir0/data30bytes</expected-output>
  4643. </comparator>
  4644. </comparators>
  4645. </test>
  4646. <test> <!-- TESTED -->
  4647. <description>copyFromLocal: Test for hdfs:// path - copying non existent file</description>
  4648. <test-commands>
  4649. <command>-fs NAMENODE -copyFromLocal /user/wrongdata hdfs:///file</command>
  4650. </test-commands>
  4651. <cleanup-commands>
  4652. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  4653. </cleanup-commands>
  4654. <comparators>
  4655. <comparator>
  4656. <type>TokenComparator</type>
  4657. <expected-output>copyFromLocal: `/user/wrongdata': No such file or directory</expected-output>
  4658. </comparator>
  4659. </comparators>
  4660. </test>
  4661. <test> <!-- TESTED -->
  4662. <description>copyFromLocal: Test for hdfs:// path - copying local file into an already existing destination</description>
  4663. <test-commands>
  4664. <command>-fs NAMENODE -mkdir hdfs:///user/</command>
  4665. <command>-fs NAMENODE -touchz hdfs:///user/file0</command>
  4666. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes hdfs:///user/file0</command>
  4667. </test-commands>
  4668. <cleanup-commands>
  4669. <command>-fs NAMENODE -rm -r hdfs:///user</command>
  4670. </cleanup-commands>
  4671. <comparators>
  4672. <comparator>
  4673. <type>TokenComparator</type>
  4674. <expected-output>copyFromLocal: `hdfs:///user/file0': File exists</expected-output>
  4675. </comparator>
  4676. </comparators>
  4677. </test>
  4678. <test> <!-- TESTED -->
  4679. <description>copyFromLocal: Test for hdfs:// path - copying many local files into an existing file</description>
  4680. <test-commands>
  4681. <command>-fs NAMENODE -touchz hdfs:///file0</command>
  4682. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes CLITEST_DATA/data30bytes hdfs:///file0</command>
  4683. </test-commands>
  4684. <cleanup-commands>
  4685. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  4686. </cleanup-commands>
  4687. <comparators>
  4688. <comparator>
  4689. <type>RegexpComparator</type>
  4690. <expected-output>^copyFromLocal: `hdfs:///file0': Is not a directory</expected-output>
  4691. </comparator>
  4692. </comparators>
  4693. </test>
  4694. <test> <!-- TESTED -->
  4695. <description>copyFromLocal: Test for hdfs:// path - copying many local files into a non existent directory</description>
  4696. <test-commands>
  4697. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes CLITEST_DATA/data30bytes hdfs:///wrongdir</command>
  4698. </test-commands>
  4699. <cleanup-commands>
  4700. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  4701. </cleanup-commands>
  4702. <comparators>
  4703. <comparator>
  4704. <type>RegexpComparator</type>
  4705. <expected-output>^copyFromLocal: `hdfs:///wrongdir': No such file or directory</expected-output>
  4706. </comparator>
  4707. </comparators>
  4708. </test>
  4709. <!-- Tests for copyFromLocal using Namenode's path-->
  4710. <test> <!-- TESTED -->
  4711. <description>copyFromLocal: Test for Namenode's path - copying local file into a hdfs://file</description>
  4712. <test-commands>
  4713. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes NAMENODE/data15bytes</command>
  4714. <command>-fs NAMENODE -du NAMENODE/data15bytes</command>
  4715. </test-commands>
  4716. <cleanup-commands>
  4717. <command>-fs NAMENODE -rm NAMENODE/data15bytes</command>
  4718. </cleanup-commands>
  4719. <comparators>
  4720. <comparator>
  4721. <type>RegexpComparator</type>
  4722. <expected-output>^15\s+15\s+NAMENODE/data15bytes</expected-output>
  4723. </comparator>
  4724. </comparators>
  4725. </test>
  4726. <test> <!-- TESTED -->
  4727. <description>copyFromLocal: Test for Namenode's path - copying local file into a hdfs directory</description>
  4728. <test-commands>
  4729. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  4730. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1</command>
  4731. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1/data</command>
  4732. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes NAMENODE/dir0/dir1/data/</command>
  4733. <command>-fs NAMENODE -du NAMENODE/dir0/dir1/data/data15bytes</command>
  4734. </test-commands>
  4735. <cleanup-commands>
  4736. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  4737. </cleanup-commands>
  4738. <comparators>
  4739. <comparator>
  4740. <type>RegexpComparator</type>
  4741. <expected-output>^15\s+15\s+NAMENODE/dir0/dir1/data/data15bytes</expected-output>
  4742. </comparator>
  4743. </comparators>
  4744. </test>
  4745. <test> <!-- TESTED -->
  4746. <description>copyFromLocal: Test for Namenode's path copying many local files into an existing hdfs directory</description>
  4747. <test-commands>
  4748. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  4749. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes CLITEST_DATA/data30bytes NAMENODE/dir0</command>
  4750. <command>-fs NAMENODE -du NAMENODE/dir0</command>
  4751. </test-commands>
  4752. <cleanup-commands>
  4753. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  4754. </cleanup-commands>
  4755. <comparators>
  4756. <comparator>
  4757. <type>RegexpComparator</type>
  4758. <expected-output>^15\s+15\s+NAMENODE/dir0/data15bytes</expected-output>
  4759. </comparator>
  4760. <comparator>
  4761. <type>RegexpComparator</type>
  4762. <expected-output>^30\s+30\s+NAMENODE/dir0/data30bytes</expected-output>
  4763. </comparator>
  4764. </comparators>
  4765. </test>
  4766. <test> <!-- TESTED -->
  4767. <description>copyFromLocal: Test for Namenode's path - copying non existent file</description>
  4768. <test-commands>
  4769. <command>-fs NAMENODE -copyFromLocal /user/wrongdata NAMENODE/file</command>
  4770. </test-commands>
  4771. <cleanup-commands>
  4772. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  4773. </cleanup-commands>
  4774. <comparators>
  4775. <comparator>
  4776. <type>TokenComparator</type>
  4777. <expected-output>copyFromLocal: `/user/wrongdata': No such file or directory</expected-output>
  4778. </comparator>
  4779. </comparators>
  4780. </test>
  4781. <test> <!-- TESTED -->
  4782. <description>copyFromLocal: Test for Namenode's path - copying local file into an already existing destination</description>
  4783. <test-commands>
  4784. <command>-fs NAMENODE -mkdir NAMENODE/user/</command>
  4785. <command>-fs NAMENODE -touchz NAMENODE/user/file0</command>
  4786. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes NAMENODE/user/file0</command>
  4787. </test-commands>
  4788. <cleanup-commands>
  4789. <command>-fs NAMENODE -rm -r NAMENODE/user</command>
  4790. </cleanup-commands>
  4791. <comparators>
  4792. <comparator>
  4793. <type>RegexpComparator</type>
  4794. <expected-output>copyFromLocal: `hdfs://\w+[-.a-z0-9]*:[0-9]+/user/file0': File exists</expected-output>
  4795. </comparator>
  4796. </comparators>
  4797. </test>
  4798. <test> <!-- TESTED -->
  4799. <description>copyFromLocal: Test for Namenode's path - copying many local files into an existing file</description>
  4800. <test-commands>
  4801. <command>-fs NAMENODE -touchz NAMENODE/file0</command>
  4802. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes CLITEST_DATA/data30bytes NAMENODE/file0</command>
  4803. </test-commands>
  4804. <cleanup-commands>
  4805. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  4806. </cleanup-commands>
  4807. <comparators>
  4808. <comparator>
  4809. <type>RegexpComparator</type>
  4810. <expected-output>^copyFromLocal: `hdfs://\w+[-.a-z0-9]*:[0-9]+/file0': Is not a directory</expected-output>
  4811. </comparator>
  4812. </comparators>
  4813. </test>
  4814. <test> <!-- TESTED -->
  4815. <description>copyFromLocal: Test for Namenode's path - copying many local files into a non existent directory</description>
  4816. <test-commands>
  4817. <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes CLITEST_DATA/data30bytes NAMENODE/wrongdir</command>
  4818. </test-commands>
  4819. <cleanup-commands>
  4820. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  4821. </cleanup-commands>
  4822. <comparators>
  4823. <comparator>
  4824. <type>RegexpComparator</type>
  4825. <expected-output>^copyFromLocal: `hdfs://\w+[-.a-z0-9]*:[0-9]+/wrongdir': No such file or directory</expected-output>
  4826. </comparator>
  4827. </comparators>
  4828. </test>
  4829. <!-- Tests for get -->
  4830. <test> <!-- TESTED -->
  4831. <description>get: getting non existent(absolute path)</description>
  4832. <test-commands>
  4833. <command>-fs NAMENODE -get /user/file CLITEST_DATA/file</command>
  4834. </test-commands>
  4835. <cleanup-commands>
  4836. <command>-fs NAMENODE -rm -r /user</command>
  4837. </cleanup-commands>
  4838. <comparators>
  4839. <comparator>
  4840. <type>RegexpComparator</type>
  4841. <expected-output>get: `.*': No such file or directory</expected-output>
  4842. </comparator>
  4843. </comparators>
  4844. </test>
  4845. <test> <!-- TESTED -->
  4846. <description>get: getting non existent file(relative path)</description>
  4847. <test-commands>
  4848. <command>-fs NAMENODE -get file CLITEST_DATA/file</command>
  4849. </test-commands>
  4850. <cleanup-commands>
  4851. <command>-fs NAMENODE -rm -r /user</command>
  4852. </cleanup-commands>
  4853. <comparators>
  4854. <comparator>
  4855. <type>RegexpComparator</type>
  4856. <expected-output>get: `.*': No such file or directory</expected-output>
  4857. </comparator>
  4858. </comparators>
  4859. </test>
  4860. <test> <!-- TESTED -->
  4861. <description>get: Test for hdfs:// path - getting non existent</description>
  4862. <test-commands>
  4863. <command>-fs NAMENODE -get hdfs:///user/file CLITEST_DATA/file</command>
  4864. </test-commands>
  4865. <cleanup-commands>
  4866. <command>-fs NAMENODE -rm -r hdfs:///user</command>
  4867. </cleanup-commands>
  4868. <comparators>
  4869. <comparator>
  4870. <type>RegexpComparator</type>
  4871. <expected-output>get: `.*': No such file or directory</expected-output>
  4872. </comparator>
  4873. </comparators>
  4874. </test>
  4875. <test> <!-- TESTED -->
  4876. <description>get: Test for Namenode's path - getting non existent</description>
  4877. <test-commands>
  4878. <command>-fs NAMENODE -get NAMENODE/user/file CLITEST_DATA/file</command>
  4879. </test-commands>
  4880. <cleanup-commands>
  4881. <command>-fs NAMENODE -rm -r NAMENODE/user</command>
  4882. </cleanup-commands>
  4883. <comparators>
  4884. <comparator>
  4885. <type>RegexpComparator</type>
  4886. <expected-output>get: `.*': No such file or directory</expected-output>
  4887. </comparator>
  4888. </comparators>
  4889. </test>
  4890. <!-- Tests for getmerge -->
  4891. <!-- Manual Testing -->
  4892. <!-- Tests for cat -->
  4893. <test> <!-- TESTED -->
  4894. <description>cat: contents of file(absolute path)</description>
  4895. <test-commands>
  4896. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /data15bytes</command>
  4897. <command>-fs NAMENODE -cat /data15bytes</command>
  4898. </test-commands>
  4899. <cleanup-commands>
  4900. <command>-fs NAMENODE -rm /data15bytes</command>
  4901. </cleanup-commands>
  4902. <comparators>
  4903. <comparator>
  4904. <type>TokenComparator</type>
  4905. <expected-output>12345678901234</expected-output>
  4906. </comparator>
  4907. </comparators>
  4908. </test>
  4909. <test>
  4910. <description>cat: contents of file(relative path)</description>
  4911. <test-commands>
  4912. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  4913. <command>-fs NAMENODE -touchz test</command>
  4914. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes data15bytes</command>
  4915. <command>-fs NAMENODE -cat data15bytes</command>
  4916. </test-commands>
  4917. <cleanup-commands>
  4918. <command>-fs NAMENODE -rm -r /user</command>
  4919. </cleanup-commands>
  4920. <comparators>
  4921. <comparator>
  4922. <type>TokenComparator</type>
  4923. <expected-output>12345678901234</expected-output>
  4924. </comparator>
  4925. </comparators>
  4926. </test>
  4927. <test> <!-- TESTED -->
  4928. <description>cat: contents of files(absolute path) using globbing</description>
  4929. <test-commands>
  4930. <command>-fs NAMENODE -mkdir /dir0</command>
  4931. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/data15bytes</command>
  4932. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /dir0/data30bytes</command>
  4933. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /dir0/data60bytes</command>
  4934. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes /dir0/data120bytes</command>
  4935. <command>-fs NAMENODE -cat /dir0/data*</command>
  4936. </test-commands>
  4937. <cleanup-commands>
  4938. <command>-fs NAMENODE -rm -r /dir0</command>
  4939. </cleanup-commands>
  4940. <comparators>
  4941. <comparator>
  4942. <type>RegexpComparator</type>
  4943. <expected-output>12345678901234.*</expected-output>
  4944. </comparator>
  4945. </comparators>
  4946. </test>
  4947. <test> <!-- TESTED-->
  4948. <description>cat: contents of files(relative path) using globbing</description>
  4949. <test-commands>
  4950. <command>-fs NAMENODE -mkdir -p dir0</command>
  4951. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes dir0/data15bytes</command>
  4952. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes dir0/data30bytes</command>
  4953. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes dir0/data60bytes</command>
  4954. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes dir0/data120bytes</command>
  4955. <command>-fs NAMENODE -cat dir0/data*</command>
  4956. </test-commands>
  4957. <cleanup-commands>
  4958. <command>-fs NAMENODE -rm -r /user</command>
  4959. </cleanup-commands>
  4960. <comparators>
  4961. <comparator>
  4962. <type>RegexpComparator</type>
  4963. <expected-output>12345678901234.*</expected-output>
  4964. </comparator>
  4965. </comparators>
  4966. </test>
  4967. <test> <!-- TESTED -->
  4968. <description>cat: contents of files(absolute path) without globbing</description>
  4969. <test-commands>
  4970. <command>-fs NAMENODE -mkdir /dir0</command>
  4971. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/data15bytes</command>
  4972. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /dir0/data30bytes</command>
  4973. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /dir0/data60bytes</command>
  4974. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes /dir0/data120bytes</command>
  4975. <command>-fs NAMENODE -cat /dir0/data15bytes /dir0/data30bytes /dir0/data60bytes /dir0/data120bytes</command>
  4976. </test-commands>
  4977. <cleanup-commands>
  4978. <command>-fs NAMENODE -rm -r /dir0</command>
  4979. </cleanup-commands>
  4980. <comparators>
  4981. <comparator>
  4982. <type>RegexpComparator</type>
  4983. <expected-output>12345678901234.*</expected-output>
  4984. </comparator>
  4985. </comparators>
  4986. </test>
  4987. <test> <!-- TESTED-->
  4988. <description>cat: contents of files(relative path) without globbing</description>
  4989. <test-commands>
  4990. <command>-fs NAMENODE -mkdir -p dir0</command>
  4991. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes dir0/data15bytes</command>
  4992. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes dir0/data30bytes</command>
  4993. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes dir0/data60bytes</command>
  4994. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes dir0/data120bytes</command>
  4995. <command>-fs NAMENODE -cat dir0/data15bytes dir0/data30bytes dir0/data60bytes dir0/data120bytes</command>
  4996. </test-commands>
  4997. <cleanup-commands>
  4998. <command>-fs NAMENODE -rm -r /user</command>
  4999. </cleanup-commands>
  5000. <comparators>
  5001. <comparator>
  5002. <type>RegexpComparator</type>
  5003. <expected-output>12345678901234.*</expected-output>
  5004. </comparator>
  5005. </comparators>
  5006. </test>
  5007. <test> <!-- TESTED -->
  5008. <description>cat: contents of file(absolute path) that does not exist</description>
  5009. <test-commands>
  5010. <command>-fs NAMENODE -cat /file</command>
  5011. </test-commands>
  5012. <cleanup-commands>
  5013. </cleanup-commands>
  5014. <comparators>
  5015. <comparator>
  5016. <type>RegexpComparator</type>
  5017. <expected-output>^cat: `/file': No such file or directory</expected-output>
  5018. </comparator>
  5019. </comparators>
  5020. </test>
  5021. <test> <!-- TESTED -->
  5022. <description>cat: contents of file(relative path) that does not exist</description>
  5023. <test-commands>
  5024. <command>-fs NAMENODE -cat file</command>
  5025. </test-commands>
  5026. <cleanup-commands>
  5027. </cleanup-commands>
  5028. <comparators>
  5029. <comparator>
  5030. <type>RegexpComparator</type>
  5031. <expected-output>^cat: `file': No such file or directory</expected-output>
  5032. </comparator>
  5033. </comparators>
  5034. </test>
  5035. <test> <!-- TESTED -->
  5036. <description>cat: contents of directory(absolute path)</description>
  5037. <test-commands>
  5038. <command>-fs NAMENODE -mkdir /dir1</command>
  5039. <command>-fs NAMENODE -cat /dir1</command>
  5040. </test-commands>
  5041. <cleanup-commands>
  5042. <command>-fs NAMENODE -rm -r /dir1</command>
  5043. </cleanup-commands>
  5044. <comparators>
  5045. <comparator>
  5046. <type>RegexpComparator</type>
  5047. <expected-output>^cat: `/dir1': Is a directory</expected-output>
  5048. </comparator>
  5049. </comparators>
  5050. </test>
  5051. <test> <!-- TESTED -->
  5052. <description>cat: contents of directory(relative path)</description>
  5053. <test-commands>
  5054. <command>-fs NAMENODE -mkdir -p dir1</command>
  5055. <command>-fs NAMENODE -cat dir1</command>
  5056. </test-commands>
  5057. <cleanup-commands>
  5058. <command>-fs NAMENODE -rm -r dir1</command>
  5059. </cleanup-commands>
  5060. <comparators>
  5061. <comparator>
  5062. <type>RegexpComparator</type>
  5063. <expected-output>^cat: `dir1': Is a directory</expected-output>
  5064. </comparator>
  5065. </comparators>
  5066. </test>
  5067. <test> <!-- TESTED -->
  5068. <description>cat: Test for hdfs:// path - content of file</description>
  5069. <test-commands>
  5070. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///data15bytes</command>
  5071. <command>-fs NAMENODE -cat hdfs:///data15bytes</command>
  5072. </test-commands>
  5073. <cleanup-commands>
  5074. <command>-fs NAMENODE -rm hdfs:///data15bytes</command>
  5075. </cleanup-commands>
  5076. <comparators>
  5077. <comparator>
  5078. <type>TokenComparator</type>
  5079. <expected-output>12345678901234</expected-output>
  5080. </comparator>
  5081. </comparators>
  5082. </test>
  5083. <test> <!-- TESTED -->
  5084. <description>cat: Test for hdfs:// path - contents of files using globbing</description>
  5085. <test-commands>
  5086. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  5087. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///dir0/data15bytes</command>
  5088. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes hdfs:///dir0/data30bytes</command>
  5089. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///dir0/data60bytes</command>
  5090. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes hdfs:///dir0/data120bytes</command>
  5091. <command>-fs NAMENODE -cat hdfs:///dir0/data*</command>
  5092. </test-commands>
  5093. <cleanup-commands>
  5094. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  5095. </cleanup-commands>
  5096. <comparators>
  5097. <comparator>
  5098. <type>RegexpComparator</type>
  5099. <expected-output>12345678901234.*</expected-output>
  5100. </comparator>
  5101. </comparators>
  5102. </test>
  5103. <test> <!-- TESTED -->
  5104. <description>cat: Test for hdfs:// path - contents of files without globbing</description>
  5105. <test-commands>
  5106. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  5107. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///dir0/data15bytes</command>
  5108. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes hdfs:///dir0/data30bytes</command>
  5109. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///dir0/data60bytes</command>
  5110. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes hdfs:///dir0/data120bytes</command>
  5111. <command>-fs NAMENODE -cat hdfs:///dir0/data15bytes hdfs:///dir0/data30bytes hdfs:///dir0/data60bytes hdfs:///dir0/data120bytes</command>
  5112. </test-commands>
  5113. <cleanup-commands>
  5114. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  5115. </cleanup-commands>
  5116. <comparators>
  5117. <comparator>
  5118. <type>RegexpComparator</type>
  5119. <expected-output>12345678901234.*</expected-output>
  5120. </comparator>
  5121. </comparators>
  5122. </test>
  5123. <test> <!-- TESTED -->
  5124. <description>cat: Test for hdfs:// path - contents of file that does not exist</description>
  5125. <test-commands>
  5126. <command>-fs NAMENODE -cat hdfs:///file</command>
  5127. </test-commands>
  5128. <cleanup-commands>
  5129. </cleanup-commands>
  5130. <comparators>
  5131. <comparator>
  5132. <type>RegexpComparator</type>
  5133. <expected-output>^cat: `hdfs:///file': No such file or directory</expected-output>
  5134. </comparator>
  5135. </comparators>
  5136. </test>
  5137. <test> <!-- TESTED -->
  5138. <description>cat: Test for hdfs:// path - contents of directory</description>
  5139. <test-commands>
  5140. <command>-fs NAMENODE -mkdir hdfs:///dir1</command>
  5141. <command>-fs NAMENODE -cat hdfs:///dir1</command>
  5142. </test-commands>
  5143. <cleanup-commands>
  5144. <command>-fs NAMENODE -rm -r hdfs:///dir1</command>
  5145. </cleanup-commands>
  5146. <comparators>
  5147. <comparator>
  5148. <type>RegexpComparator</type>
  5149. <expected-output>^cat: `hdfs:///dir1': Is a directory</expected-output>
  5150. </comparator>
  5151. </comparators>
  5152. </test>
  5153. <!-- Tests for cat using Namenode's path -->
  5154. <test> <!-- TESTED -->
  5155. <description>cat: Test for Namenode's path - content of file</description>
  5156. <test-commands>
  5157. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/data15bytes</command>
  5158. <command>-fs NAMENODE -cat NAMENODE/data15bytes</command>
  5159. </test-commands>
  5160. <cleanup-commands>
  5161. <command>-fs NAMENODE -rm NAMENODE/data15bytes</command>
  5162. </cleanup-commands>
  5163. <comparators>
  5164. <comparator>
  5165. <type>TokenComparator</type>
  5166. <expected-output>12345678901234</expected-output>
  5167. </comparator>
  5168. </comparators>
  5169. </test>
  5170. <test> <!-- TESTED -->
  5171. <description>cat: Test for Namenode's path - contents of files using globbing</description>
  5172. <test-commands>
  5173. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  5174. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/data15bytes</command>
  5175. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes NAMENODE/dir0/data30bytes</command>
  5176. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes NAMENODE/dir0/data60bytes</command>
  5177. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes NAMENODE/dir0/data120bytes</command>
  5178. <command>-fs NAMENODE -cat NAMENODE/dir0/data*</command>
  5179. </test-commands>
  5180. <cleanup-commands>
  5181. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  5182. </cleanup-commands>
  5183. <comparators>
  5184. <comparator>
  5185. <type>RegexpComparator</type>
  5186. <expected-output>12345678901234.*</expected-output>
  5187. </comparator>
  5188. </comparators>
  5189. </test>
  5190. <test> <!-- TESTED -->
  5191. <description>cat: Test for Namenode's path - contents of files without globbing</description>
  5192. <test-commands>
  5193. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  5194. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/data15bytes</command>
  5195. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes NAMENODE/dir0/data30bytes</command>
  5196. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes NAMENODE/dir0/data60bytes</command>
  5197. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes NAMENODE/dir0/data120bytes</command>
  5198. <command>-fs NAMENODE -cat NAMENODE/dir0/data15bytes NAMENODE/dir0/data30bytes NAMENODE/dir0/data60bytes NAMENODE/dir0/data120bytes</command>
  5199. </test-commands>
  5200. <cleanup-commands>
  5201. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  5202. </cleanup-commands>
  5203. <comparators>
  5204. <comparator>
  5205. <type>RegexpComparator</type>
  5206. <expected-output>12345678901234.*</expected-output>
  5207. </comparator>
  5208. </comparators>
  5209. </test>
  5210. <test> <!-- TESTED -->
  5211. <description>cat: Test for Namenode's path - contents of file that does not exist</description>
  5212. <test-commands>
  5213. <command>-fs NAMENODE -cat NAMENODE/file</command>
  5214. </test-commands>
  5215. <cleanup-commands>
  5216. </cleanup-commands>
  5217. <comparators>
  5218. <comparator>
  5219. <type>RegexpComparator</type>
  5220. <expected-output>^cat: `NAMENODE/file': No such file or directory</expected-output>
  5221. </comparator>
  5222. </comparators>
  5223. </test>
  5224. <test> <!-- TESTED -->
  5225. <description>cat: Test for Namenode's path - contents of directory</description>
  5226. <test-commands>
  5227. <command>-fs NAMENODE -mkdir NAMENODE/dir1</command>
  5228. <command>-fs NAMENODE -cat NAMENODE/dir1</command>
  5229. </test-commands>
  5230. <cleanup-commands>
  5231. <command>-fs NAMENODE -rm -r NAMENODE/dir1</command>
  5232. </cleanup-commands>
  5233. <comparators>
  5234. <comparator>
  5235. <type>RegexpComparator</type>
  5236. <expected-output>^cat: `NAMENODE/dir1': Is a directory</expected-output>
  5237. </comparator>
  5238. </comparators>
  5239. </test>
  5240. <!-- Tests for copyToLocal -->
  5241. <test> <!-- TESTED -->
  5242. <description>copyToLocal: non existent relative path</description>
  5243. <test-commands>
  5244. <command>-fs NAMENODE -copyToLocal file CLITEST_DATA/file</command>
  5245. </test-commands>
  5246. <cleanup-commands>
  5247. <command>-fs NAMENODE -rm -r /user</command>
  5248. </cleanup-commands>
  5249. <comparators>
  5250. <comparator>
  5251. <type>RegexpComparator</type>
  5252. <expected-output>copyToLocal: `.*': No such file or directory</expected-output>
  5253. </comparator>
  5254. </comparators>
  5255. </test>
  5256. <test> <!-- TESTED -->
  5257. <description>copyToLocal: non existent absolute path</description>
  5258. <test-commands>
  5259. <command>-fs NAMENODE -copyToLocal /user/file CLITEST_DATA/file</command>
  5260. </test-commands>
  5261. <cleanup-commands>
  5262. <command>-fs NAMENODE -rm -r /user</command>
  5263. </cleanup-commands>
  5264. <comparators>
  5265. <comparator>
  5266. <type>RegexpComparator</type>
  5267. <expected-output>copyToLocal: `.*': No such file or directory</expected-output>
  5268. </comparator>
  5269. </comparators>
  5270. </test>
  5271. <test> <!-- TESTED -->
  5272. <description>copyToLocal: Test for hdfs:// path - non existent file/directory</description>
  5273. <test-commands>
  5274. <command>-fs NAMENODE -copyToLocal hdfs:///file CLITEST_DATA/file</command>
  5275. </test-commands>
  5276. <cleanup-commands>
  5277. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  5278. </cleanup-commands>
  5279. <comparators>
  5280. <comparator>
  5281. <type>RegexpComparator</type>
  5282. <expected-output>copyToLocal: `.*': No such file or directory</expected-output>
  5283. </comparator>
  5284. </comparators>
  5285. </test>
  5286. <test> <!-- TESTED -->
  5287. <description>copyToLocal: Test for Namenode's path - non existent file/directory</description>
  5288. <test-commands>
  5289. <command>-fs NAMENODE -copyToLocal NAMENODE/file CLITEST_DATA/file</command>
  5290. </test-commands>
  5291. <cleanup-commands>
  5292. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  5293. </cleanup-commands>
  5294. <comparators>
  5295. <comparator>
  5296. <type>RegexpComparator</type>
  5297. <expected-output>copyToLocal: `.*': No such file or directory</expected-output>
  5298. </comparator>
  5299. </comparators>
  5300. </test>
  5301. <test> <!-- TESTED-->
  5302. <description>checksum: checksum of files(relative path) using globbing</description>
  5303. <test-commands>
  5304. <command>-fs NAMENODE -mkdir -p dir0</command>
  5305. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes dir0/data15bytes</command>
  5306. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes dir0/data30bytes</command>
  5307. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes dir0/data60bytes</command>
  5308. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes dir0/data120bytes</command>
  5309. <command>-fs NAMENODE -checksum dir0/data*</command>
  5310. </test-commands>
  5311. <cleanup-commands>
  5312. <command>-fs NAMENODE -rm -r /user</command>
  5313. </cleanup-commands>
  5314. <comparators>
  5315. <comparator>
  5316. <type>RegexpComparator</type>
  5317. <expected-output>^dir0/data120bytes\tMD5-of-0MD5-of-512CRC32C\t000002000000000000000000a58cdc3c0967fc8cddb7fed5960d06f2</expected-output>
  5318. </comparator>
  5319. <comparator>
  5320. <type>RegexpComparator</type>
  5321. <expected-output>^dir0/data15bytes\tMD5-of-0MD5-of-512CRC32C\t0000020000000000000000007267e9528002723a30939aefc238d665</expected-output>
  5322. </comparator>
  5323. <comparator>
  5324. <type>RegexpComparator</type>
  5325. <expected-output>^dir0/data30bytes\tMD5-of-0MD5-of-512CRC32C\t000002000000000000000000fc09371298117c4943cf089b4bd79c96</expected-output>
  5326. </comparator>
  5327. <comparator>
  5328. <type>RegexpComparator</type>
  5329. <expected-output>^dir0/data60bytes\tMD5-of-0MD5-of-512CRC32C\t000002000000000000000000009476431d851dd7b0a8d057a404d7b9</expected-output>
  5330. </comparator>
  5331. </comparators>
  5332. </test>
  5333. <!-- Tests for moveToLocal -->
  5334. <!-- Not yet implemented -->
  5335. <!-- Tests for mkdir -->
  5336. <test> <!-- TESTED -->
  5337. <description>mkdir: creating directory (absolute path) </description>
  5338. <test-commands>
  5339. <command>-fs NAMENODE -mkdir /dir0</command>
  5340. <command>-fs NAMENODE -du -s /dir0</command>
  5341. </test-commands>
  5342. <cleanup-commands>
  5343. <command>-fs NAMENODE -rm /user</command>
  5344. </cleanup-commands>
  5345. <comparators>
  5346. <comparator>
  5347. <type>RegexpComparator</type>
  5348. <expected-output>^0\s+0\s+/dir0</expected-output>
  5349. </comparator>
  5350. </comparators>
  5351. </test>
  5352. <test> <!-- TESTED -->
  5353. <description>mkdir: creating directory (absolute path) </description>
  5354. <test-commands>
  5355. <command>-fs NAMENODE -mkdir /dir0</command>
  5356. <command>-fs NAMENODE -mkdir /dir0/b/</command>
  5357. <command>-fs NAMENODE -du -s /dir0/b</command>
  5358. </test-commands>
  5359. <cleanup-commands>
  5360. <command>-fs NAMENODE -rm /user</command>
  5361. </cleanup-commands>
  5362. <comparators>
  5363. <comparator>
  5364. <type>RegexpComparator</type>
  5365. <expected-output>^0\s+0\s+/dir0/b</expected-output>
  5366. </comparator>
  5367. </comparators>
  5368. </test>
  5369. <test> <!-- TESTED -->
  5370. <description>mkdir: creating directory (relative path) </description>
  5371. <test-commands>
  5372. <command>-fs NAMENODE -mkdir -p dir0 </command>
  5373. <command>-fs NAMENODE -du -s dir0</command>
  5374. </test-commands>
  5375. <cleanup-commands>
  5376. <command>-fs NAMENODE -rm /user</command>
  5377. </cleanup-commands>
  5378. <comparators>
  5379. <comparator>
  5380. <type>RegexpComparator</type>
  5381. <expected-output>^0\s+0\s+dir0</expected-output>
  5382. </comparator>
  5383. </comparators>
  5384. </test>
  5385. <test> <!-- TESTED -->
  5386. <description>mkdir: creating many directories (absolute path) </description>
  5387. <test-commands>
  5388. <command>-fs NAMENODE -mkdir /dir0 </command>
  5389. <command>-fs NAMENODE -mkdir /dir1 </command>
  5390. <command>-fs NAMENODE -mkdir /dir2 </command>
  5391. <command>-fs NAMENODE -mkdir /dir3 </command>
  5392. <command>-fs NAMENODE -du -s /dir*</command>
  5393. </test-commands>
  5394. <cleanup-commands>
  5395. <command>-fs NAMENODE -rm /dir*</command>
  5396. </cleanup-commands>
  5397. <comparators>
  5398. <comparator>
  5399. <type>RegexpComparator</type>
  5400. <expected-output>^0\s+0\s+/dir0</expected-output>
  5401. </comparator>
  5402. <comparator>
  5403. <type>RegexpComparator</type>
  5404. <expected-output>^0\s+0\s+/dir1</expected-output>
  5405. </comparator>
  5406. <comparator>
  5407. <type>RegexpComparator</type>
  5408. <expected-output>^0\s+0\s+/dir2</expected-output>
  5409. </comparator>
  5410. <comparator>
  5411. <type>RegexpComparator</type>
  5412. <expected-output>^0\s+0\s+/dir3</expected-output>
  5413. </comparator>
  5414. </comparators>
  5415. </test>
  5416. <test> <!-- TESTED -->
  5417. <description>mkdir: creating many directories (relative path) </description>
  5418. <test-commands>
  5419. <command>-fs NAMENODE -mkdir -p dir0 </command>
  5420. <command>-fs NAMENODE -mkdir -p dir1 </command>
  5421. <command>-fs NAMENODE -mkdir -p dir2 </command>
  5422. <command>-fs NAMENODE -mkdir -p dir3 </command>
  5423. <command>-fs NAMENODE -du -s dir*</command>
  5424. </test-commands>
  5425. <cleanup-commands>
  5426. <command>-fs NAMENODE -rm /user</command>
  5427. </cleanup-commands>
  5428. <comparators>
  5429. <comparator>
  5430. <type>RegexpComparator</type>
  5431. <expected-output>^0\s+0\s+dir0</expected-output>
  5432. </comparator>
  5433. <comparator>
  5434. <type>RegexpComparator</type>
  5435. <expected-output>^0\s+0\s+dir1</expected-output>
  5436. </comparator>
  5437. <comparator>
  5438. <type>RegexpComparator</type>
  5439. <expected-output>^0\s+0\s+dir2</expected-output>
  5440. </comparator>
  5441. <comparator>
  5442. <type>RegexpComparator</type>
  5443. <expected-output>^0\s+0\s+dir3</expected-output>
  5444. </comparator>
  5445. </comparators>
  5446. </test>
  5447. <test> <!-- TESTED -->
  5448. <description>mkdir: creating a directory with the name of an already existing directory</description>
  5449. <test-commands>
  5450. <command>-fs NAMENODE -mkdir /dir0</command>
  5451. <command>-fs NAMENODE -mkdir /dir0</command>
  5452. </test-commands>
  5453. <cleanup-commands>
  5454. <command>-fs NAMENODE -rm -r /dir0</command>
  5455. </cleanup-commands>
  5456. <comparators>
  5457. <comparator>
  5458. <type>TokenComparator</type>
  5459. <expected-output>mkdir: `/dir0': File exists</expected-output>
  5460. </comparator>
  5461. </comparators>
  5462. </test>
  5463. <test> <!-- TESTED -->
  5464. <description>mkdir: creating a directory with the name of an already existing file</description>
  5465. <test-commands>
  5466. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes data15bytes</command>
  5467. <command>-fs NAMENODE -mkdir -p data15bytes</command>
  5468. </test-commands>
  5469. <cleanup-commands>
  5470. <command>-fs NAMENODE -rm -r data15bytes</command>
  5471. </cleanup-commands>
  5472. <comparators>
  5473. <comparator>
  5474. <type>TokenComparator</type>
  5475. <expected-output>mkdir: `data15bytes': Is not a directory</expected-output>
  5476. </comparator>
  5477. </comparators>
  5478. </test>
  5479. <test> <!-- TESTED -->
  5480. <description>mkdir: Test for hdfs:// path - creating directory</description>
  5481. <test-commands>
  5482. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  5483. <command>-fs NAMENODE -du -s hdfs:///dir0</command>
  5484. </test-commands>
  5485. <cleanup-commands>
  5486. <command>-fs NAMENODE -rm hdfs:///*</command>
  5487. </cleanup-commands>
  5488. <comparators>
  5489. <comparator>
  5490. <type>RegexpComparator</type>
  5491. <expected-output>^0\s+0\s+hdfs:///dir0</expected-output>
  5492. </comparator>
  5493. </comparators>
  5494. </test>
  5495. <test> <!-- TESTED -->
  5496. <description>mkdir: Test for hdfs:// path - creating many directories</description>
  5497. <test-commands>
  5498. <command>-fs NAMENODE -mkdir hdfs:///dir0 hdfs:///dir1 hdfs:///dir2 hdfs:///dir3 </command>
  5499. <command>-fs NAMENODE -du -s hdfs:///dir*</command>
  5500. </test-commands>
  5501. <cleanup-commands>
  5502. <command>-fs NAMENODE -rm hdfs:///dir*</command>
  5503. </cleanup-commands>
  5504. <comparators>
  5505. <comparator>
  5506. <type>RegexpComparator</type>
  5507. <expected-output>^0\s+0\s+hdfs:///dir0</expected-output>
  5508. </comparator>
  5509. <comparator>
  5510. <type>RegexpComparator</type>
  5511. <expected-output>^0\s+0\s+hdfs:///dir1</expected-output>
  5512. </comparator>
  5513. <comparator>
  5514. <type>RegexpComparator</type>
  5515. <expected-output>^0\s+0\s+hdfs:///dir2</expected-output>
  5516. </comparator>
  5517. <comparator>
  5518. <type>RegexpComparator</type>
  5519. <expected-output>^0\s+0\s+hdfs:///dir3</expected-output>
  5520. </comparator>
  5521. </comparators>
  5522. </test>
  5523. <test> <!-- TESTED -->
  5524. <description>mkdir: Test for hdfs:// path - creating a directory with the name of an already existing directory</description>
  5525. <test-commands>
  5526. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  5527. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  5528. </test-commands>
  5529. <cleanup-commands>
  5530. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  5531. </cleanup-commands>
  5532. <comparators>
  5533. <comparator>
  5534. <type>TokenComparator</type>
  5535. <expected-output>mkdir: `hdfs:///dir0': File exists</expected-output>
  5536. </comparator>
  5537. </comparators>
  5538. </test>
  5539. <test> <!-- TESTED -->
  5540. <description>mkdir: Test for hdfs:// path - creating a directory with the name of an already existing file</description>
  5541. <test-commands>
  5542. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///data15bytes</command>
  5543. <command>-fs NAMENODE -mkdir hdfs:///data15bytes</command>
  5544. </test-commands>
  5545. <cleanup-commands>
  5546. <command>-fs NAMENODE -rm -r hdfs:///data15bytes</command>
  5547. </cleanup-commands>
  5548. <comparators>
  5549. <comparator>
  5550. <type>TokenComparator</type>
  5551. <expected-output>mkdir: `hdfs:///data15bytes': Is not a directory</expected-output>
  5552. </comparator>
  5553. </comparators>
  5554. </test>
  5555. <test> <!-- TESTED -->
  5556. <description>mkdir: Test for Namenode's path - creating directory</description>
  5557. <test-commands>
  5558. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  5559. <command>-fs NAMENODE -du -s NAMENODE/dir0</command>
  5560. </test-commands>
  5561. <cleanup-commands>
  5562. <command>-fs NAMENODE -rm NAMENODE/*</command>
  5563. </cleanup-commands>
  5564. <comparators>
  5565. <comparator>
  5566. <type>RegexpComparator</type>
  5567. <expected-output>^0\s+0\s+NAMENODE/dir0</expected-output>
  5568. </comparator>
  5569. </comparators>
  5570. </test>
  5571. <test> <!-- TESTED -->
  5572. <description>mkdir: Test for Namenode's path - creating many directories</description>
  5573. <test-commands>
  5574. <command>-fs NAMENODE -mkdir NAMENODE/dir0 NAMENODE/dir1 NAMENODE/dir2 NAMENODE/dir3</command>
  5575. <command>-fs NAMENODE -du -s NAMENODE/dir*</command>
  5576. </test-commands>
  5577. <cleanup-commands>
  5578. <command>-fs NAMENODE -rm NAMENODE/dir*</command>
  5579. </cleanup-commands>
  5580. <comparators>
  5581. <comparator>
  5582. <type>RegexpComparator</type>
  5583. <expected-output>^0\s+0\s+NAMENODE/dir0</expected-output>
  5584. </comparator>
  5585. <comparator>
  5586. <type>RegexpComparator</type>
  5587. <expected-output>^0\s+0\s+NAMENODE/dir1</expected-output>
  5588. </comparator>
  5589. <comparator>
  5590. <type>RegexpComparator</type>
  5591. <expected-output>^0\s+0\s+NAMENODE/dir2</expected-output>
  5592. </comparator>
  5593. <comparator>
  5594. <type>RegexpComparator</type>
  5595. <expected-output>^0\s+0\s+NAMENODE/dir3</expected-output>
  5596. </comparator>
  5597. </comparators>
  5598. </test>
  5599. <test> <!-- TESTED -->
  5600. <description>mkdir: Test for NAMENODE path - creating a directory with the name of an already existing directory</description>
  5601. <test-commands>
  5602. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  5603. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  5604. </test-commands>
  5605. <cleanup-commands>
  5606. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  5607. </cleanup-commands>
  5608. <comparators>
  5609. <comparator>
  5610. <type>RegexpComparator</type>
  5611. <expected-output>mkdir: `hdfs://\w+[-.a-z0-9]*:[0-9]+/dir0': File exists</expected-output>
  5612. </comparator>
  5613. </comparators>
  5614. </test>
  5615. <test> <!-- TESTED -->
  5616. <description>mkdir: Test for Namenode's path - creating a directory with the name of an already existing file</description>
  5617. <test-commands>
  5618. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/data15bytes</command>
  5619. <command>-fs NAMENODE -mkdir NAMENODE/data15bytes</command>
  5620. </test-commands>
  5621. <cleanup-commands>
  5622. <command>-fs NAMENODE -rm -r NAMENODE/data15bytes</command>
  5623. </cleanup-commands>
  5624. <comparators>
  5625. <comparator>
  5626. <type>RegexpComparator</type>
  5627. <expected-output>mkdir: `hdfs://\w+[-.a-z0-9]*:[0-9]+/data15bytes': Is not a directory</expected-output>
  5628. </comparator>
  5629. </comparators>
  5630. </test>
  5631. <test> <!-- TESTED -->
  5632. <description>mkdir: Test create of directory with no parent and no -p fails</description>
  5633. <test-commands>
  5634. <command>-fs NAMENODE -rm -r -f dir0</command>
  5635. <command>-fs NAMENODE -mkdir dir0/dir1</command>
  5636. </test-commands>
  5637. <cleanup-commands>
  5638. <command>-fs NAMENODE -rm -r dir0</command>
  5639. </cleanup-commands>
  5640. <comparators>
  5641. <comparator>
  5642. <type>RegexpComparator</type>
  5643. <expected-output>mkdir: `dir0/dir1': No such file or directory</expected-output>
  5644. </comparator>
  5645. </comparators>
  5646. </test>
  5647. <test> <!-- TESTED -->
  5648. <description>mkdir: Test recreate of existing directory fails</description>
  5649. <test-commands>
  5650. <command>-fs NAMENODE -rm -r -f dir0</command>
  5651. <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
  5652. <command>-fs NAMENODE -mkdir dir0/dir1</command>
  5653. </test-commands>
  5654. <cleanup-commands>
  5655. <command>-fs NAMENODE -rm -r dir0</command>
  5656. </cleanup-commands>
  5657. <comparators>
  5658. <comparator>
  5659. <type>RegexpComparator</type>
  5660. <expected-output>mkdir: `dir0/dir1': File exists</expected-output>
  5661. </comparator>
  5662. </comparators>
  5663. </test>
  5664. <test> <!-- TESTED -->
  5665. <description>mkdir: Test recreate of existing directory with -p succeeds</description>
  5666. <test-commands>
  5667. <command>-fs NAMENODE -rm -r -f dir0</command>
  5668. <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
  5669. <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
  5670. </test-commands>
  5671. <cleanup-commands>
  5672. <command>-fs NAMENODE -rm -r dir0</command>
  5673. </cleanup-commands>
  5674. <comparators>
  5675. <comparator>
  5676. <type>ExactComparator</type>
  5677. <expected-output></expected-output>
  5678. </comparator>
  5679. </comparators>
  5680. </test>
  5681. <!--Tests for setrep-->
  5682. <test> <!-- TESTED -->
  5683. <description>setrep: existent file (absolute path)</description>
  5684. <test-commands>
  5685. <command>-fs NAMENODE -mkdir /dir0</command>
  5686. <command>-fs NAMENODE -touchz /dir0/file0</command>
  5687. <command>-fs NAMENODE -setrep 2 /dir0/file0</command>
  5688. </test-commands>
  5689. <cleanup-commands>
  5690. <command>-fs NAMENODE -rm -r /user</command>
  5691. </cleanup-commands>
  5692. <comparators>
  5693. <comparator>
  5694. <type>RegexpComparator</type>
  5695. <expected-output>^Replication 2 set: /dir0/file0</expected-output>
  5696. </comparator>
  5697. </comparators>
  5698. </test>
  5699. <test> <!-- TESTED -->
  5700. <description>setrep: existent file (relative path)</description>
  5701. <test-commands>
  5702. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  5703. <command>-fs NAMENODE -touchz file0</command>
  5704. <command>-fs NAMENODE -setrep 2 file0</command>
  5705. </test-commands>
  5706. <cleanup-commands>
  5707. <command>-fs NAMENODE -rm -r /user</command>
  5708. </cleanup-commands>
  5709. <comparators>
  5710. <comparator>
  5711. <type>RegexpComparator</type>
  5712. <expected-output>^Replication 2 set: file0</expected-output>
  5713. </comparator>
  5714. </comparators>
  5715. </test>
  5716. <test> <!-- TESTED -->
  5717. <description>setrep: existent directory (absolute path)</description>
  5718. <test-commands>
  5719. <command>-fs NAMENODE -mkdir /dir0</command>
  5720. <command>-fs NAMENODE -touchz /dir0/file0</command>
  5721. <command>-fs NAMENODE -touchz /dir0/file1</command>
  5722. <command>-fs NAMENODE -setrep 2 /dir0</command>
  5723. </test-commands>
  5724. <cleanup-commands>
  5725. <command>-fs NAMENODE -rm -r /user</command>
  5726. </cleanup-commands>
  5727. <comparators>
  5728. <comparator>
  5729. <type>RegexpComparator</type>
  5730. <expected-output>^Replication 2 set: /dir0/file0</expected-output>
  5731. </comparator>
  5732. <comparator>
  5733. <type>RegexpComparator</type>
  5734. <expected-output>^Replication 2 set: /dir0/file1</expected-output>
  5735. </comparator>
  5736. </comparators>
  5737. </test>
  5738. <test> <!-- TESTED -->
  5739. <description>setrep: existent directory (relative path)</description>
  5740. <test-commands>
  5741. <command>-fs NAMENODE -mkdir -p dir0</command>
  5742. <command>-fs NAMENODE -touchz dir0/file0</command>
  5743. <command>-fs NAMENODE -touchz dir0/file1</command>
  5744. <command>-fs NAMENODE -setrep 2 dir0</command>
  5745. </test-commands>
  5746. <cleanup-commands>
  5747. <command>-fs NAMENODE -rm -r /user</command>
  5748. </cleanup-commands>
  5749. <comparators>
  5750. <comparator>
  5751. <type>RegexpComparator</type>
  5752. <expected-output>^Replication 2 set: dir0/file0</expected-output>
  5753. </comparator>
  5754. <comparator>
  5755. <type>RegexpComparator</type>
  5756. <expected-output>^Replication 2 set: dir0/file1</expected-output>
  5757. </comparator>
  5758. </comparators>
  5759. </test>
  5760. <test> <!-- TESTED -->
  5761. <description>setrep: -R ignored for existing file</description>
  5762. <test-commands>
  5763. <command>-fs NAMENODE -mkdir -p dir0</command>
  5764. <command>-fs NAMENODE -touchz dir0/file0</command>
  5765. <command>-fs NAMENODE -setrep -R 2 dir0/file0</command>
  5766. </test-commands>
  5767. <cleanup-commands>
  5768. <command>-fs NAMENODE -rm -r /user</command>
  5769. </cleanup-commands>
  5770. <comparators>
  5771. <comparator>
  5772. <type>RegexpComparator</type>
  5773. <expected-output>^Replication 2 set: dir0/file0</expected-output>
  5774. </comparator>
  5775. </comparators>
  5776. </test>
  5777. <test> <!-- TESTED -->
  5778. <description>setrep: non existent file (absolute path)</description>
  5779. <test-commands>
  5780. <command>-fs NAMENODE -setrep 2 /dir0/file</command>
  5781. </test-commands>
  5782. <cleanup-commands>
  5783. <command>-fs NAMENODE -rm -r /user</command>
  5784. </cleanup-commands>
  5785. <comparators>
  5786. <comparator>
  5787. <type>RegexpComparator</type>
  5788. <expected-output>^setrep: `/dir0/file': No such file or directory</expected-output>
  5789. </comparator>
  5790. </comparators>
  5791. </test>
  5792. <test> <!-- TESTED -->
  5793. <description>setrep: non existent file (relative path)</description>
  5794. <test-commands>
  5795. <command>-fs NAMENODE -setrep 2 file0</command>
  5796. </test-commands>
  5797. <cleanup-commands>
  5798. <command>-fs NAMENODE -rm -r /user</command>
  5799. </cleanup-commands>
  5800. <comparators>
  5801. <comparator>
  5802. <type>RegexpComparator</type>
  5803. <expected-output>^setrep: `file0': No such file or directory</expected-output>
  5804. </comparator>
  5805. </comparators>
  5806. </test>
  5807. <test> <!-- TESTED -->
  5808. <description>setrep: Test for hdfs:// path - existent file</description>
  5809. <test-commands>
  5810. <command>-fs NAMENODE -mkdir hdfs:///dir0/</command>
  5811. <command>-fs NAMENODE -touchz hdfs:///dir0/file0</command>
  5812. <command>-fs NAMENODE -setrep 2 hdfs:///dir0/file0</command>
  5813. </test-commands>
  5814. <cleanup-commands>
  5815. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  5816. </cleanup-commands>
  5817. <comparators>
  5818. <comparator>
  5819. <type>RegexpComparator</type>
  5820. <expected-output>^Replication 2 set: hdfs:///dir0/file0</expected-output>
  5821. </comparator>
  5822. </comparators>
  5823. </test>
  5824. <test> <!-- TESTED -->
  5825. <description>setrep: Test for hdfs:// path - existent directory</description>
  5826. <test-commands>
  5827. <command>-fs NAMENODE -mkdir hdfs:///dir0/</command>
  5828. <command>-fs NAMENODE -touchz hdfs:///dir0/file0</command>
  5829. <command>-fs NAMENODE -touchz hdfs:///dir0/file1</command>
  5830. <command>-fs NAMENODE -setrep 2 hdfs:///dir0</command>
  5831. </test-commands>
  5832. <cleanup-commands>
  5833. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  5834. </cleanup-commands>
  5835. <comparators>
  5836. <comparator>
  5837. <type>RegexpComparator</type>
  5838. <expected-output>^Replication 2 set: hdfs:///dir0/file0</expected-output>
  5839. </comparator>
  5840. <comparator>
  5841. <type>RegexpComparator</type>
  5842. <expected-output>^Replication 2 set: hdfs:///dir0/file1</expected-output>
  5843. </comparator>
  5844. </comparators>
  5845. </test>
  5846. <test> <!-- TESTED -->
  5847. <description>setrep: Test for hdfs:// path - non existent file</description>
  5848. <test-commands>
  5849. <command>-fs NAMENODE -mkdir hdfs:///dir0/</command>
  5850. <command>-fs NAMENODE -setrep 2 hdfs:///dir0/file</command>
  5851. </test-commands>
  5852. <cleanup-commands>
  5853. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  5854. </cleanup-commands>
  5855. <comparators>
  5856. <comparator>
  5857. <type>RegexpComparator</type>
  5858. <expected-output>^setrep: `hdfs:///dir0/file': No such file or directory</expected-output>
  5859. </comparator>
  5860. </comparators>
  5861. </test>
  5862. <test> <!-- TESTED -->
  5863. <description>setrep: Test for Namenode's path - existent file</description>
  5864. <test-commands>
  5865. <command>-fs NAMENODE -mkdir NAMENODE/dir0/</command>
  5866. <command>-fs NAMENODE -touchz NAMENODE/dir0/file0</command>
  5867. <command>-fs NAMENODE -setrep 2 NAMENODE/dir0/file0</command>
  5868. </test-commands>
  5869. <cleanup-commands>
  5870. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  5871. </cleanup-commands>
  5872. <comparators>
  5873. <comparator>
  5874. <type>RegexpComparator</type>
  5875. <expected-output>^Replication 2 set: NAMENODE/dir0/file0</expected-output>
  5876. </comparator>
  5877. </comparators>
  5878. </test>
  5879. <test> <!-- TESTED -->
  5880. <description>setrep: Test for Namenode's path - existent directory</description>
  5881. <test-commands>
  5882. <command>-fs NAMENODE -mkdir -p NAMENODE/dir0</command>
  5883. <command>-fs NAMENODE -touchz NAMENODE/dir0/file0</command>
  5884. <command>-fs NAMENODE -touchz NAMENODE/dir0/file1</command>
  5885. <command>-fs NAMENODE -setrep 2 NAMENODE/dir0</command>
  5886. </test-commands>
  5887. <cleanup-commands>
  5888. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  5889. </cleanup-commands>
  5890. <comparators>
  5891. <comparator>
  5892. <type>RegexpComparator</type>
  5893. <expected-output>^Replication 2 set: NAMENODE/dir0/file0</expected-output>
  5894. </comparator>
  5895. <comparator>
  5896. <type>RegexpComparator</type>
  5897. <expected-output>^Replication 2 set: NAMENODE/dir0/file1</expected-output>
  5898. </comparator>
  5899. </comparators>
  5900. </test>
  5901. <test> <!-- TESTED -->
  5902. <description>setrep: Test for Namenode's path - non existent file</description>
  5903. <test-commands>
  5904. <command>-fs NAMENODE -setrep 2 NAMENODE/dir0/file</command>
  5905. </test-commands>
  5906. <cleanup-commands>
  5907. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  5908. </cleanup-commands>
  5909. <comparators>
  5910. <comparator>
  5911. <type>RegexpComparator</type>
  5912. <expected-output>^setrep: `hdfs://\w+[-.a-z0-9]*:[0-9]+/dir0/file': No such file or directory</expected-output>
  5913. </comparator>
  5914. </comparators>
  5915. </test>
  5916. <!-- Tests for touchz-->
  5917. <test> <!-- TESTED -->
  5918. <description>touchz: touching file (absolute path) </description>
  5919. <test-commands>
  5920. <command>-fs NAMENODE -mkdir /user</command>
  5921. <command>-fs NAMENODE -touchz /user/file0</command>
  5922. <command>-fs NAMENODE -du /user/file0</command>
  5923. </test-commands>
  5924. <cleanup-commands>
  5925. <command>-fs NAMENODE -rm /user</command>
  5926. </cleanup-commands>
  5927. <comparators>
  5928. <comparator>
  5929. <type>RegexpComparator</type>
  5930. <expected-output>^0\s+0\s+/user/file0</expected-output>
  5931. </comparator>
  5932. </comparators>
  5933. </test>
  5934. <test> <!-- TESTED -->
  5935. <description>touchz: touching file in non-existent directory </description>
  5936. <test-commands>
  5937. <command>-fs NAMENODE -touchz file0 </command>
  5938. </test-commands>
  5939. <cleanup-commands>
  5940. </cleanup-commands>
  5941. <comparators>
  5942. <comparator>
  5943. <type>RegexpComparator</type>
  5944. <expected-output>touchz: `file0': No such file or directory</expected-output>
  5945. </comparator>
  5946. </comparators>
  5947. </test>
  5948. <test> <!-- TESTED -->
  5949. <description>touchz: touching file(relative path) </description>
  5950. <test-commands>
  5951. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  5952. <command>-fs NAMENODE -touchz file0 </command>
  5953. <command>-fs NAMENODE -du file0</command>
  5954. </test-commands>
  5955. <cleanup-commands>
  5956. <command>-fs NAMENODE -rm /user</command>
  5957. </cleanup-commands>
  5958. <comparators>
  5959. <comparator>
  5960. <type>RegexpComparator</type>
  5961. <expected-output>^0\s+0\s+file0</expected-output>
  5962. </comparator>
  5963. </comparators>
  5964. </test>
  5965. <test> <!-- TESTED -->
  5966. <description>touchz: touching many files </description>
  5967. <test-commands>
  5968. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  5969. <command>-fs NAMENODE -touchz file0 file1 file2</command>
  5970. <command>-fs NAMENODE -du file*</command>
  5971. </test-commands>
  5972. <cleanup-commands>
  5973. <command>-fs NAMENODE -rm /user</command>
  5974. </cleanup-commands>
  5975. <comparators>
  5976. <comparator>
  5977. <type>RegexpComparator</type>
  5978. <expected-output>^0( |\t)*0( |\t)*file0</expected-output>
  5979. <expected-output>^0( |\t)*0( |\t)*file1</expected-output>
  5980. <expected-output>^0( |\t)*0( |\t)*file2</expected-output>
  5981. </comparator>
  5982. </comparators>
  5983. </test>
  5984. <test> <!-- TESTED -->
  5985. <description>touchz: touching already existing file </description>
  5986. <test-commands>
  5987. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  5988. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes data15bytes</command>
  5989. <command>-fs NAMENODE -touchz data15bytes</command>
  5990. </test-commands>
  5991. <cleanup-commands>
  5992. <command>-fs NAMENODE -rm data15bytes</command>
  5993. </cleanup-commands>
  5994. <comparators>
  5995. <comparator>
  5996. <type>TokenComparator</type>
  5997. <expected-output>touchz: `data15bytes': Not a zero-length file</expected-output>
  5998. </comparator>
  5999. </comparators>
  6000. </test>
  6001. <test> <!-- TESTED -->
  6002. <description>touchz: Test for hdfs:// path - touching file</description>
  6003. <test-commands>
  6004. <command>-fs NAMENODE -mkdir -p hdfs:///user/</command>
  6005. <command>-fs NAMENODE -touchz hdfs:///user/file0</command>
  6006. <command>-fs NAMENODE -du hdfs:///user/file0</command>
  6007. </test-commands>
  6008. <cleanup-commands>
  6009. <command>-fs NAMENODE -rm hdfs:///user</command>
  6010. </cleanup-commands>
  6011. <comparators>
  6012. <comparator>
  6013. <type>RegexpComparator</type>
  6014. <expected-output>^0\s+0\s+hdfs:///user/file0</expected-output>
  6015. </comparator>
  6016. </comparators>
  6017. </test>
  6018. <test> <!-- TESTED -->
  6019. <description>touchz: Test for hdfs:// path - touching many files </description>
  6020. <test-commands>
  6021. <command>-fs NAMENODE -touchz hdfs:///file0 hdfs:///file1 hdfs:///file2</command>
  6022. <command>-fs NAMENODE -du hdfs:///file*</command>
  6023. </test-commands>
  6024. <cleanup-commands>
  6025. <command>-fs NAMENODE -rm hdfs:///user</command>
  6026. </cleanup-commands>
  6027. <comparators>
  6028. <comparator>
  6029. <type>RegexpComparator</type>
  6030. <expected-output>^0( |\t)*0( |\t)*hdfs:///file0</expected-output>
  6031. <expected-output>^0( |\t)*0( |\t)*hdfs:///file1</expected-output>
  6032. <expected-output>^0( |\t)*0( |\t)*hdfs:///file2</expected-output>
  6033. </comparator>
  6034. </comparators>
  6035. </test>
  6036. <test> <!-- TESTED -->
  6037. <description>touchz: Test for hdfs:// path - touching already existing file </description>
  6038. <test-commands>
  6039. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///data15bytes</command>
  6040. <command>-fs NAMENODE -touchz hdfs:///data15bytes</command>
  6041. </test-commands>
  6042. <cleanup-commands>
  6043. <command>-fs NAMENODE -rm hdfs:///data15bytes</command>
  6044. </cleanup-commands>
  6045. <comparators>
  6046. <comparator>
  6047. <type>TokenComparator</type>
  6048. <expected-output>touchz: `hdfs:///data15bytes': Not a zero-length file</expected-output>
  6049. </comparator>
  6050. </comparators>
  6051. </test>
  6052. <test> <!-- TESTED -->
  6053. <description>touchz: Test for Namenode's path - touching file</description>
  6054. <test-commands>
  6055. <command>-fs NAMENODE -touchz NAMENODE/user/file0</command>
  6056. <command>-fs NAMENODE -du NAMENODE/user/file0</command>
  6057. </test-commands>
  6058. <cleanup-commands>
  6059. <command>-fs NAMENODE -rm NAMENODE/user</command>
  6060. </cleanup-commands>
  6061. <comparators>
  6062. <comparator>
  6063. <type>RegexpComparator</type>
  6064. <expected-output>^0\s+0\s+NAMENODE/user/file0</expected-output>
  6065. </comparator>
  6066. </comparators>
  6067. </test>
  6068. <test> <!-- TESTED -->
  6069. <description>touchz: Test for Namenode path - touching many files </description>
  6070. <test-commands>
  6071. <command>-fs NAMENODE -touchz NAMENODE/file0 NAMENODE/file1 NAMENODE/file2</command>
  6072. <command>-fs NAMENODE -du NAMENODE/file*</command>
  6073. </test-commands>
  6074. <cleanup-commands>
  6075. <command>-fs NAMENODE -rm NAMENODE/user</command>
  6076. </cleanup-commands>
  6077. <comparators>
  6078. <comparator>
  6079. <type>RegexpComparator</type>
  6080. <expected-output>^0\s+0\s+hdfs://\w+[-.a-z0-9]*:[0-9]+/file0</expected-output>
  6081. <expected-output>^0\s+0\s+hdfs://\w+[-.a-z0-9]*:[0-9]+/file1</expected-output>
  6082. <expected-output>^0\s+0\s+hdfs://\w+[-.a-z0-9]*:[0-9]+/file2</expected-output>
  6083. </comparator>
  6084. </comparators>
  6085. </test>
  6086. <test> <!-- TESTED -->
  6087. <description>touchz: Test for Namenode's path - touching already existing file </description>
  6088. <test-commands>
  6089. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/data15bytes</command>
  6090. <command>-fs NAMENODE -touchz NAMENODE/data15bytes</command>
  6091. </test-commands>
  6092. <cleanup-commands>
  6093. <command>-fs NAMENODE -rm NAMENODE/data15bytes</command>
  6094. </cleanup-commands>
  6095. <comparators>
  6096. <comparator>
  6097. <type>RegexpComparator</type>
  6098. <expected-output>touchz: `hdfs://\w+[-.a-z0-9]*:[0-9]+/data15bytes': Not a zero-length file</expected-output>
  6099. </comparator>
  6100. </comparators>
  6101. </test>
  6102. <!--Tests for test-->
  6103. <test> <!-- TESTED -->
  6104. <description>test: non existent file (absolute path)</description>
  6105. <test-commands>
  6106. <command>-fs NAMENODE -test -z /dir0/file</command>
  6107. </test-commands>
  6108. <cleanup-commands>
  6109. <command>-fs NAMENODE -rm -r /user</command>
  6110. </cleanup-commands>
  6111. <comparators>
  6112. <comparator>
  6113. <type>ExactComparator</type>
  6114. <expected-output></expected-output>
  6115. </comparator>
  6116. </comparators>
  6117. </test>
  6118. <test> <!-- TESTED -->
  6119. <description>test: non existent file (relative path)</description>
  6120. <test-commands>
  6121. <command>-fs NAMENODE -test -z file</command>
  6122. </test-commands>
  6123. <cleanup-commands>
  6124. <command>-fs NAMENODE -rm -r /user</command>
  6125. </cleanup-commands>
  6126. <comparators>
  6127. <comparator>
  6128. <type>ExactComparator</type>
  6129. <expected-output></expected-output>
  6130. </comparator>
  6131. </comparators>
  6132. </test>
  6133. <test> <!-- TESTED -->
  6134. <description>test: non existent directory (absolute path)</description>
  6135. <test-commands>
  6136. <command>-fs NAMENODE -test -d /dir</command>
  6137. </test-commands>
  6138. <cleanup-commands>
  6139. <command>-fs NAMENODE -rm -r /user</command>
  6140. </cleanup-commands>
  6141. <comparators>
  6142. <comparator>
  6143. <type>ExactComparator</type>
  6144. <expected-output></expected-output>
  6145. </comparator>
  6146. </comparators>
  6147. </test>
  6148. <test> <!-- TESTED -->
  6149. <description>test: non existent directory (relative path)</description>
  6150. <test-commands>
  6151. <command>-fs NAMENODE -test -d dir0</command>
  6152. </test-commands>
  6153. <cleanup-commands>
  6154. <command>-fs NAMENODE -rm -r /user</command>
  6155. </cleanup-commands>
  6156. <comparators>
  6157. <comparator>
  6158. <type>ExactComparator</type>
  6159. <expected-output></expected-output>
  6160. </comparator>
  6161. </comparators>
  6162. </test>
  6163. <test> <!-- TESTED -->
  6164. <description>test: Test for hdfs:// path - non existent file</description>
  6165. <test-commands>
  6166. <command>-fs NAMENODE -test -z hdfs:///dir0/file</command>
  6167. </test-commands>
  6168. <cleanup-commands>
  6169. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  6170. </cleanup-commands>
  6171. <comparators>
  6172. <comparator>
  6173. <type>ExactComparator</type>
  6174. <expected-output></expected-output>
  6175. </comparator>
  6176. </comparators>
  6177. </test>
  6178. <test> <!-- TESTED -->
  6179. <description>test: Test for hdfs:// path - non existent directory</description>
  6180. <test-commands>
  6181. <command>-fs NAMENODE -test -d hdfs:///dir</command>
  6182. </test-commands>
  6183. <cleanup-commands>
  6184. <command>-fs NAMENODE -rm -r hdfs:///dir</command>
  6185. </cleanup-commands>
  6186. <comparators>
  6187. <comparator>
  6188. <type>ExactComparator</type>
  6189. <expected-output></expected-output>
  6190. </comparator>
  6191. </comparators>
  6192. </test>
  6193. <test> <!-- TESTED -->
  6194. <description>test: Test for Namenode's path - non existent file</description>
  6195. <test-commands>
  6196. <command>-fs NAMENODE -test -z NAMENODE/dir0/file</command>
  6197. </test-commands>
  6198. <cleanup-commands>
  6199. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  6200. </cleanup-commands>
  6201. <comparators>
  6202. <comparator>
  6203. <type>ExactComparator</type>
  6204. <expected-output></expected-output>
  6205. </comparator>
  6206. </comparators>
  6207. </test>
  6208. <test> <!-- TESTED -->
  6209. <description>test: Test for Namenode's path - non existent directory</description>
  6210. <test-commands>
  6211. <command>-fs NAMENODE -test -d NAMENODE/dir</command>
  6212. </test-commands>
  6213. <cleanup-commands>
  6214. <command>-fs NAMENODE -rm -r NAMENODE/dir</command>
  6215. </cleanup-commands>
  6216. <comparators>
  6217. <comparator>
  6218. <type>ExactComparator</type>
  6219. <expected-output></expected-output>
  6220. </comparator>
  6221. </comparators>
  6222. </test>
  6223. <!--Tests for stat -->
  6224. <test> <!-- TESTED -->
  6225. <description>stat: statistics about file(absolute path)</description>
  6226. <test-commands>
  6227. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /data60bytes</command>
  6228. <command>-fs NAMENODE -stat "%n-%b" /data60bytes</command>
  6229. </test-commands>
  6230. <cleanup-commands>
  6231. <command>-fs NAMENODE -rm -r /data60bytes</command>
  6232. </cleanup-commands>
  6233. <comparators>
  6234. <comparator>
  6235. <type>TokenComparator</type>
  6236. <expected-output>data60bytes-60</expected-output>
  6237. </comparator>
  6238. </comparators>
  6239. </test>
  6240. <test> <!-- TESTED -->
  6241. <description>stat: statistics about file(relative path)</description>
  6242. <test-commands>
  6243. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  6244. <command>-fs NAMENODE -touchz test</command>
  6245. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes data60bytes</command>
  6246. <command>-fs NAMENODE -stat "%n-%b" data60bytes</command>
  6247. </test-commands>
  6248. <cleanup-commands>
  6249. <command>-fs NAMENODE -rm -r /user</command>
  6250. </cleanup-commands>
  6251. <comparators>
  6252. <comparator>
  6253. <type>TokenComparator</type>
  6254. <expected-output>data60bytes-60</expected-output>
  6255. </comparator>
  6256. </comparators>
  6257. </test>
  6258. <test> <!-- TESTED -->
  6259. <description>stat: statistics about directory(absolute path)</description>
  6260. <test-commands>
  6261. <command>-fs NAMENODE -mkdir /dirtest</command>
  6262. <command>-fs NAMENODE -stat "%n-%b-%o" /dirtest</command>
  6263. </test-commands>
  6264. <cleanup-commands>
  6265. <command>-fs NAMENODE -rm -r /dirtest</command>
  6266. </cleanup-commands>
  6267. <comparators>
  6268. <comparator>
  6269. <type>TokenComparator</type>
  6270. <expected-output>dirtest-0-0</expected-output>
  6271. </comparator>
  6272. </comparators>
  6273. </test>
  6274. <test> <!-- TESTED -->
  6275. <description>stat: statistics about directory(relative path)</description>
  6276. <test-commands>
  6277. <command>-fs NAMENODE -mkdir -p dirtest</command>
  6278. <command>-fs NAMENODE -stat "%n-%b-%o" dirtest</command>
  6279. </test-commands>
  6280. <cleanup-commands>
  6281. <command>-fs NAMENODE -rm -r /user</command>
  6282. </cleanup-commands>
  6283. <comparators>
  6284. <comparator>
  6285. <type>TokenComparator</type>
  6286. <expected-output>dirtest-0-0</expected-output>
  6287. </comparator>
  6288. </comparators>
  6289. </test>
  6290. <test> <!-- TESTED -->
  6291. <description>stat: statistics about files (absolute path) using globbing</description>
  6292. <test-commands>
  6293. <command>-fs NAMENODE -mkdir /dir0</command>
  6294. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/data15bytes</command>
  6295. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /dir0/data30bytes</command>
  6296. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /dir0/data60bytes</command>
  6297. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes /dir0/data120bytes</command>
  6298. <command>-fs NAMENODE -mkdir /dir0/datadir</command>
  6299. <command>-fs NAMENODE -stat "%n-%b" /dir0/data*</command>
  6300. </test-commands>
  6301. <cleanup-commands>
  6302. <command>-fs NAMENODE -rm -r /dir0</command>
  6303. </cleanup-commands>
  6304. <comparators>
  6305. <comparator>
  6306. <type>TokenComparator</type>
  6307. <expected-output>data15bytes-15</expected-output>
  6308. </comparator>
  6309. <comparator>
  6310. <type>TokenComparator</type>
  6311. <expected-output>data30bytes-30</expected-output>
  6312. </comparator>
  6313. <comparator>
  6314. <type>TokenComparator</type>
  6315. <expected-output>data60bytes-60</expected-output>
  6316. </comparator>
  6317. <comparator>
  6318. <type>TokenComparator</type>
  6319. <expected-output>data120bytes-120</expected-output>
  6320. </comparator>
  6321. <comparator>
  6322. <type>TokenComparator</type>
  6323. <expected-output>datadir-0</expected-output>
  6324. </comparator>
  6325. </comparators>
  6326. </test>
  6327. <test> <!-- TESTED -->
  6328. <description>stat: statistics about files (relative path) using globbing</description>
  6329. <test-commands>
  6330. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  6331. <command>-fs NAMENODE -touchz test</command>
  6332. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes data15bytes</command>
  6333. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes data30bytes</command>
  6334. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes data60bytes</command>
  6335. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes data120bytes</command>
  6336. <command>-fs NAMENODE -mkdir -p datadir</command>
  6337. <command>-fs NAMENODE -stat "%n-%b" data*</command>
  6338. </test-commands>
  6339. <cleanup-commands>
  6340. <command>-fs NAMENODE -rm -r /user</command>
  6341. </cleanup-commands>
  6342. <comparators>
  6343. <comparator>
  6344. <type>TokenComparator</type>
  6345. <expected-output>data15bytes-15</expected-output>
  6346. </comparator>
  6347. <comparator>
  6348. <type>TokenComparator</type>
  6349. <expected-output>data30bytes-30</expected-output>
  6350. </comparator>
  6351. <comparator>
  6352. <type>TokenComparator</type>
  6353. <expected-output>data60bytes-60</expected-output>
  6354. </comparator>
  6355. <comparator>
  6356. <type>TokenComparator</type>
  6357. <expected-output>data120bytes-120</expected-output>
  6358. </comparator>
  6359. <comparator>
  6360. <type>TokenComparator</type>
  6361. <expected-output>datadir-0</expected-output>
  6362. </comparator>
  6363. </comparators>
  6364. </test>
  6365. <test> <!-- TESTED -->
  6366. <description>stat: statistics about file or directory(absolute path) that does not exist</description>
  6367. <test-commands>
  6368. <command>-fs NAMENODE -stat /file</command>
  6369. </test-commands>
  6370. <cleanup-commands>
  6371. </cleanup-commands>
  6372. <comparators>
  6373. <comparator>
  6374. <type>RegexpComparator</type>
  6375. <expected-output>^stat: `/file': No such file or directory</expected-output>
  6376. </comparator>
  6377. </comparators>
  6378. </test>
  6379. <test> <!-- TESTED -->
  6380. <description>stat: statistics about file or directory(relative path) that does not exist </description>
  6381. <test-commands>
  6382. <command>-fs NAMENODE -stat file1</command>
  6383. </test-commands>
  6384. <cleanup-commands>
  6385. </cleanup-commands>
  6386. <comparators>
  6387. <comparator>
  6388. <type>RegexpComparator</type>
  6389. <expected-output>^stat: `file1': No such file or directory</expected-output>
  6390. </comparator>
  6391. </comparators>
  6392. </test>
  6393. <test> <!-- TESTED -->
  6394. <description>stat: Test for hdfs:// path - statistics about file</description>
  6395. <test-commands>
  6396. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///data60bytes</command>
  6397. <command>-fs NAMENODE -stat "%n-%b" hdfs:///data60bytes</command>
  6398. </test-commands>
  6399. <cleanup-commands>
  6400. <command>-fs NAMENODE -rm -r hdfs:///data60bytes</command>
  6401. </cleanup-commands>
  6402. <comparators>
  6403. <comparator>
  6404. <type>TokenComparator</type>
  6405. <expected-output>data60bytes-60</expected-output>
  6406. </comparator>
  6407. </comparators>
  6408. </test>
  6409. <test> <!-- TESTED -->
  6410. <description>stat: Test for hdfs:// path - statistics about directory</description>
  6411. <test-commands>
  6412. <command>-fs NAMENODE -mkdir hdfs:///dirtest</command>
  6413. <command>-fs NAMENODE -stat "%n-%b-%o" hdfs:///dirtest</command>
  6414. </test-commands>
  6415. <cleanup-commands>
  6416. <command>-fs NAMENODE -rm -r hdfs:///dirtest</command>
  6417. </cleanup-commands>
  6418. <comparators>
  6419. <comparator>
  6420. <type>TokenComparator</type>
  6421. <expected-output>dirtest-0-0</expected-output>
  6422. </comparator>
  6423. </comparators>
  6424. </test>
  6425. <test> <!-- TESTED -->
  6426. <description>stat: Test for hdfs:// path - statistics about files using globbing</description>
  6427. <test-commands>
  6428. <command>-fs NAMENODE -mkdir /dir0</command>
  6429. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///dir0/data15bytes</command>
  6430. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes hdfs:///dir0/data30bytes</command>
  6431. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///dir0/data60bytes</command>
  6432. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes hdfs:///dir0/data120bytes</command>
  6433. <command>-fs NAMENODE -mkdir -p hdfs:///dir0/datadir</command>
  6434. <command>-fs NAMENODE -stat "%n-%b" hdfs:///dir0/data*</command>
  6435. </test-commands>
  6436. <cleanup-commands>
  6437. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  6438. </cleanup-commands>
  6439. <comparators>
  6440. <comparator>
  6441. <type>TokenComparator</type>
  6442. <expected-output>data15bytes-15</expected-output>
  6443. </comparator>
  6444. <comparator>
  6445. <type>TokenComparator</type>
  6446. <expected-output>data30bytes-30</expected-output>
  6447. </comparator>
  6448. <comparator>
  6449. <type>TokenComparator</type>
  6450. <expected-output>data60bytes-60</expected-output>
  6451. </comparator>
  6452. <comparator>
  6453. <type>TokenComparator</type>
  6454. <expected-output>data120bytes-120</expected-output>
  6455. </comparator>
  6456. <comparator>
  6457. <type>TokenComparator</type>
  6458. <expected-output>datadir-0</expected-output>
  6459. </comparator>
  6460. </comparators>
  6461. </test>
  6462. <test> <!-- TESTED -->
  6463. <description>stat: Test for hdfs:// path - statistics about file or directory that does not exist</description>
  6464. <test-commands>
  6465. <command>-fs NAMENODE -stat hdfs:///file</command>
  6466. </test-commands>
  6467. <cleanup-commands>
  6468. </cleanup-commands>
  6469. <comparators>
  6470. <comparator>
  6471. <type>RegexpComparator</type>
  6472. <expected-output>^stat: `hdfs:///file': No such file or directory</expected-output>
  6473. </comparator>
  6474. </comparators>
  6475. </test>
  6476. <test> <!-- TESTED -->
  6477. <description>stat: Test for Namenode's path - statistics about file</description>
  6478. <test-commands>
  6479. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes NAMENODE/data60bytes</command>
  6480. <command>-fs NAMENODE -stat "%n-%b" NAMENODE/data60bytes</command>
  6481. </test-commands>
  6482. <cleanup-commands>
  6483. <command>-fs NAMENODE -rm -r NAMENODE/data60bytes</command>
  6484. </cleanup-commands>
  6485. <comparators>
  6486. <comparator>
  6487. <type>TokenComparator</type>
  6488. <expected-output>data60bytes-60</expected-output>
  6489. </comparator>
  6490. </comparators>
  6491. </test>
  6492. <test> <!-- TESTED -->
  6493. <description>stat: Test for Namenode's path - statistics about directory</description>
  6494. <test-commands>
  6495. <command>-fs NAMENODE -mkdir NAMENODE/dirtest</command>
  6496. <command>-fs NAMENODE -stat "%n-%b-%o" NAMENODE/dirtest</command>
  6497. </test-commands>
  6498. <cleanup-commands>
  6499. <command>-fs NAMENODE -rm -r NAMENODE/dirtest</command>
  6500. </cleanup-commands>
  6501. <comparators>
  6502. <comparator>
  6503. <type>TokenComparator</type>
  6504. <expected-output>dirtest-0-0</expected-output>
  6505. </comparator>
  6506. </comparators>
  6507. </test>
  6508. <test> <!-- TESTED -->
  6509. <description>stat: Test for Namenode's path - statistics about files using globbing</description>
  6510. <test-commands>
  6511. <command>-fs NAMENODE -mkdir /dir0</command>
  6512. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/data15bytes</command>
  6513. <command>-fs NAMENODE -put CLITEST_DATA/data30bytes NAMENODE/dir0/data30bytes</command>
  6514. <command>-fs NAMENODE -put CLITEST_DATA/data60bytes NAMENODE/dir0/data60bytes</command>
  6515. <command>-fs NAMENODE -put CLITEST_DATA/data120bytes NAMENODE/dir0/data120bytes</command>
  6516. <command>-fs NAMENODE -mkdir -p NAMENODE/dir0/datadir</command>
  6517. <command>-fs NAMENODE -stat "%n-%b" NAMENODE/dir0/data*</command>
  6518. </test-commands>
  6519. <cleanup-commands>
  6520. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  6521. </cleanup-commands>
  6522. <comparators>
  6523. <comparator>
  6524. <type>TokenComparator</type>
  6525. <expected-output>data15bytes-15</expected-output>
  6526. </comparator>
  6527. <comparator>
  6528. <type>TokenComparator</type>
  6529. <expected-output>data30bytes-30</expected-output>
  6530. </comparator>
  6531. <comparator>
  6532. <type>TokenComparator</type>
  6533. <expected-output>data60bytes-60</expected-output>
  6534. </comparator>
  6535. <comparator>
  6536. <type>TokenComparator</type>
  6537. <expected-output>data120bytes-120</expected-output>
  6538. </comparator>
  6539. <comparator>
  6540. <type>TokenComparator</type>
  6541. <expected-output>datadir-0</expected-output>
  6542. </comparator>
  6543. </comparators>
  6544. </test>
  6545. <test> <!-- TESTED -->
  6546. <description>stat: Test for Namenode's path - statistics about file or directory that does not exist</description>
  6547. <test-commands>
  6548. <command>-fs NAMENODE -stat NAMENODE/file</command>
  6549. </test-commands>
  6550. <cleanup-commands>
  6551. </cleanup-commands>
  6552. <comparators>
  6553. <comparator>
  6554. <type>RegexpComparator</type>
  6555. <expected-output>^stat: `hdfs://\w+[-.a-z0-9]*:[0-9]+/file': No such file or directory</expected-output>
  6556. </comparator>
  6557. </comparators>
  6558. </test>
  6559. <!-- Tests for tail -->
  6560. <test> <!-- TESTED -->
  6561. <description>tail: contents of file(absolute path)</description>
  6562. <test-commands>
  6563. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /data15bytes</command>
  6564. <command>-fs NAMENODE -tail /data15bytes</command>
  6565. </test-commands>
  6566. <cleanup-commands>
  6567. <command>-fs NAMENODE -rm /user</command>
  6568. </cleanup-commands>
  6569. <comparators>
  6570. <comparator>
  6571. <type>TokenComparator</type>
  6572. <expected-output>12345678901234</expected-output>
  6573. </comparator>
  6574. </comparators>
  6575. </test>
  6576. <test> <!--TESTED-->
  6577. <description>tail: contents of file(relative path)</description>
  6578. <test-commands>
  6579. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  6580. <command>-fs NAMENODE -touchz test</command>
  6581. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes data15bytes</command>
  6582. <command>-fs NAMENODE -tail data15bytes</command>
  6583. </test-commands>
  6584. <cleanup-commands>
  6585. <command>-fs NAMENODE -rm -r /user</command>
  6586. </cleanup-commands>
  6587. <comparators>
  6588. <comparator>
  6589. <type>TokenComparator</type>
  6590. <expected-output>12345678901234</expected-output>
  6591. </comparator>
  6592. </comparators>
  6593. </test>
  6594. <test> <!-- TESTED -->
  6595. <description>tail: contents of files(absolute path) using globbing</description>
  6596. <test-commands>
  6597. <command>-fs NAMENODE -touchz /file1</command>
  6598. <command>-fs NAMENODE -touchz /file2</command>
  6599. <command>-fs NAMENODE -touchz /file3</command>
  6600. <command>-fs NAMENODE -touchz /file4</command>
  6601. <command>-fs NAMENODE -tail /file*</command>
  6602. </test-commands>
  6603. <cleanup-commands>
  6604. <command>-fs NAMENODE -rm -r /user</command>
  6605. </cleanup-commands>
  6606. <comparators>
  6607. <comparator>
  6608. <type>RegexpComparator</type>
  6609. <expected-output>^tail: `/file\*': No such file or directory</expected-output>
  6610. </comparator>
  6611. </comparators>
  6612. </test>
  6613. <test> <!-- TESTED -->
  6614. <description>tail: contents of files(relative path) using globbing</description>
  6615. <test-commands>
  6616. <command>-fs NAMENODE -touchz file1</command>
  6617. <command>-fs NAMENODE -touchz file2</command>
  6618. <command>-fs NAMENODE -touchz file3</command>
  6619. <command>-fs NAMENODE -touchz file4</command>
  6620. <command>-fs NAMENODE -tail file*</command>
  6621. </test-commands>
  6622. <cleanup-commands>
  6623. <command>-fs NAMENODE -rm -r /user</command>
  6624. </cleanup-commands>
  6625. <comparators>
  6626. <comparator>
  6627. <type>RegexpComparator</type>
  6628. <expected-output>^tail: `file\*': No such file or directory</expected-output>
  6629. </comparator>
  6630. </comparators>
  6631. </test>
  6632. <test> <!-- TESTED -->
  6633. <description>tail: contents of file(absolute path) that does not exist</description>
  6634. <test-commands>
  6635. <command>-fs NAMENODE -tail /file</command>
  6636. </test-commands>
  6637. <cleanup-commands>
  6638. </cleanup-commands>
  6639. <comparators>
  6640. <comparator>
  6641. <type>RegexpComparator</type>
  6642. <expected-output>^tail: `/file': No such file or directory</expected-output>
  6643. </comparator>
  6644. </comparators>
  6645. </test>
  6646. <test> <!-- TESTED -->
  6647. <description>tail: contents of file(relative path) that does not exist</description>
  6648. <test-commands>
  6649. <command>-fs NAMENODE -tail file1</command>
  6650. </test-commands>
  6651. <cleanup-commands>
  6652. </cleanup-commands>
  6653. <comparators>
  6654. <comparator>
  6655. <type>RegexpComparator</type>
  6656. <expected-output>^tail: `file1': No such file or directory</expected-output>
  6657. </comparator>
  6658. </comparators>
  6659. </test>
  6660. <test> <!-- TESTED -->
  6661. <description>tail: contents of directory(absolute path) </description>
  6662. <test-commands>
  6663. <command>-fs NAMENODE -mkdir /dir1</command>
  6664. <command>-fs NAMENODE -tail /dir1</command>
  6665. </test-commands>
  6666. <cleanup-commands>
  6667. <command>-fs NAMENODE -rm -r /dir1</command>
  6668. </cleanup-commands>
  6669. <comparators>
  6670. <comparator>
  6671. <type>RegexpComparator</type>
  6672. <expected-output>^tail: `/dir1': Is a directory</expected-output>
  6673. </comparator>
  6674. </comparators>
  6675. </test>
  6676. <test> <!-- TESTED -->
  6677. <description>tail: contents of directory(relative path)</description>
  6678. <test-commands>
  6679. <command>-fs NAMENODE -mkdir -p dir1</command>
  6680. <command>-fs NAMENODE -tail dir1</command>
  6681. </test-commands>
  6682. <cleanup-commands>
  6683. <command>-fs NAMENODE -rm -r dir1</command>
  6684. </cleanup-commands>
  6685. <comparators>
  6686. <comparator>
  6687. <type>RegexpComparator</type>
  6688. <expected-output>^tail: `dir1': Is a directory</expected-output>
  6689. </comparator>
  6690. </comparators>
  6691. </test>
  6692. <test> <!-- TESTED -->
  6693. <description>tail: Test for hdfs:// path - contents of file</description>
  6694. <test-commands>
  6695. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///data15bytes</command>
  6696. <command>-fs NAMENODE -tail hdfs:///data15bytes</command>
  6697. </test-commands>
  6698. <cleanup-commands>
  6699. <command>-fs NAMENODE -rm hdfs:///*</command>
  6700. </cleanup-commands>
  6701. <comparators>
  6702. <comparator>
  6703. <type>TokenComparator</type>
  6704. <expected-output>12345678901234</expected-output>
  6705. </comparator>
  6706. </comparators>
  6707. </test>
  6708. <test> <!-- TESTED -->
  6709. <description>tail: Test for hdfs:// path - contents of files using globbing</description>
  6710. <test-commands>
  6711. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  6712. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  6713. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  6714. <command>-fs NAMENODE -touchz hdfs:///file4</command>
  6715. <command>-fs NAMENODE -tail hdfs:///file*</command>
  6716. </test-commands>
  6717. <cleanup-commands>
  6718. <command>-fs NAMENODE -rm -r hdfs:///*</command>
  6719. </cleanup-commands>
  6720. <comparators>
  6721. <comparator>
  6722. <type>RegexpComparator</type>
  6723. <expected-output>^tail: `hdfs:///file\*': No such file or directory</expected-output>
  6724. </comparator>
  6725. </comparators>
  6726. </test>
  6727. <test> <!-- TESTED -->
  6728. <description>tail: Test for hdfs:// path - contents of file that does not exist</description>
  6729. <test-commands>
  6730. <command>-fs NAMENODE -tail hdfs:///file</command>
  6731. </test-commands>
  6732. <cleanup-commands>
  6733. </cleanup-commands>
  6734. <comparators>
  6735. <comparator>
  6736. <type>RegexpComparator</type>
  6737. <expected-output>^tail: `hdfs:///file': No such file or directory</expected-output>
  6738. </comparator>
  6739. </comparators>
  6740. </test>
  6741. <test> <!-- TESTED -->
  6742. <description>tail: Test for hdfs:// path - contents of directory</description>
  6743. <test-commands>
  6744. <command>-fs NAMENODE -mkdir hdfs:///dir1</command>
  6745. <command>-fs NAMENODE -tail hdfs:///dir1</command>
  6746. </test-commands>
  6747. <cleanup-commands>
  6748. <command>-fs NAMENODE -rm -r hdfs:///dir1</command>
  6749. </cleanup-commands>
  6750. <comparators>
  6751. <comparator>
  6752. <type>RegexpComparator</type>
  6753. <expected-output>^tail: `hdfs:///dir1': Is a directory</expected-output>
  6754. </comparator>
  6755. </comparators>
  6756. </test>
  6757. <test> <!-- TESTED -->
  6758. <description>tail: Test for Namenode's path - contents of file</description>
  6759. <test-commands>
  6760. <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/data15bytes</command>
  6761. <command>-fs NAMENODE -tail NAMENODE/data15bytes</command>
  6762. </test-commands>
  6763. <cleanup-commands>
  6764. <command>-fs NAMENODE -rm NAMENODE/*</command>
  6765. </cleanup-commands>
  6766. <comparators>
  6767. <comparator>
  6768. <type>TokenComparator</type>
  6769. <expected-output>12345678901234</expected-output>
  6770. </comparator>
  6771. </comparators>
  6772. </test>
  6773. <test> <!-- TESTED -->
  6774. <description>tail: Test for Namenode's path - contents of files using globbing</description>
  6775. <test-commands>
  6776. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  6777. <command>-fs NAMENODE -touchz NAMENODE/file2</command>
  6778. <command>-fs NAMENODE -touchz NAMENODE/file3</command>
  6779. <command>-fs NAMENODE -touchz NAMENODE/file4</command>
  6780. <command>-fs NAMENODE -tail NAMENODE/file*</command>
  6781. </test-commands>
  6782. <cleanup-commands>
  6783. <command>-fs NAMENODE -rm -r NAMENODE/*</command>
  6784. </cleanup-commands>
  6785. <comparators>
  6786. <comparator>
  6787. <type>RegexpComparator</type>
  6788. <expected-output>^tail: `hdfs://\w+[-.a-z0-9]*:[0-9]+/file\*': No such file or directory</expected-output>
  6789. </comparator>
  6790. </comparators>
  6791. </test>
  6792. <test> <!-- TESTED -->
  6793. <description>tail: Test for Namenode's path - contents of file that does not exist</description>
  6794. <test-commands>
  6795. <command>-fs NAMENODE -tail NAMENODE/file</command>
  6796. </test-commands>
  6797. <cleanup-commands>
  6798. </cleanup-commands>
  6799. <comparators>
  6800. <comparator>
  6801. <type>RegexpComparator</type>
  6802. <expected-output>^tail: `hdfs://\w+[-.a-z0-9]*:[0-9]+/file': No such file or directory</expected-output>
  6803. </comparator>
  6804. </comparators>
  6805. </test>
  6806. <test> <!-- TESTED -->
  6807. <description>tail: Test for Namenode's path - contents of directory</description>
  6808. <test-commands>
  6809. <command>-fs NAMENODE -mkdir NAMENODE/dir1</command>
  6810. <command>-fs NAMENODE -tail NAMENODE/dir1</command>
  6811. </test-commands>
  6812. <cleanup-commands>
  6813. <command>-fs NAMENODE -rm -r NAMENODE/dir1</command>
  6814. </cleanup-commands>
  6815. <comparators>
  6816. <comparator>
  6817. <type>RegexpComparator</type>
  6818. <expected-output>^tail: `hdfs://\w+[-.a-z0-9]*:[0-9]+/dir1': Is a directory</expected-output>
  6819. </comparator>
  6820. </comparators>
  6821. </test>
  6822. <!-- Tests for count -->
  6823. <test> <!-- TESTED -->
  6824. <description>count: file using absolute path</description>
  6825. <test-commands>
  6826. <command>-fs NAMENODE -touchz /file1</command>
  6827. <command>-fs NAMENODE -count /file1</command>
  6828. </test-commands>
  6829. <cleanup-commands>
  6830. <command>-fs NAMENODE -rm /file1</command>
  6831. </cleanup-commands>
  6832. <comparators>
  6833. <comparator>
  6834. <type>RegexpComparator</type>
  6835. <expected-output>( |\t)*0( |\t)*1( |\t)*0 /file1</expected-output>
  6836. </comparator>
  6837. </comparators>
  6838. </test>
  6839. <test> <!-- TESTED -->
  6840. <description>count: file using relative path</description>
  6841. <test-commands>
  6842. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  6843. <command>-fs NAMENODE -touchz file1</command>
  6844. <command>-fs NAMENODE -count file1</command>
  6845. </test-commands>
  6846. <cleanup-commands>
  6847. <command>-fs NAMENODE -rm file1</command>
  6848. </cleanup-commands>
  6849. <comparators>
  6850. <comparator>
  6851. <type>RegexpComparator</type>
  6852. <expected-output>( |\t)*0( |\t)*1( |\t)*0 file1</expected-output>
  6853. </comparator>
  6854. </comparators>
  6855. </test>
  6856. <test> <!-- TESTED -->
  6857. <description>count: directory using absolute path</description>
  6858. <test-commands>
  6859. <command>-fs NAMENODE -mkdir /dir1</command>
  6860. <command>-fs NAMENODE -count /dir1</command>
  6861. </test-commands>
  6862. <cleanup-commands>
  6863. <command>-fs NAMENODE -rm -r /dir1</command>
  6864. </cleanup-commands>
  6865. <comparators>
  6866. <comparator>
  6867. <type>RegexpComparator</type>
  6868. <expected-output>( |\t)*1( |\t)*0( |\t)*0 /dir1</expected-output>
  6869. </comparator>
  6870. </comparators>
  6871. </test>
  6872. <test> <!-- TESTED -->
  6873. <description>count: directory using relative path</description>
  6874. <test-commands>
  6875. <command>-fs NAMENODE -mkdir -p dir1</command>
  6876. <command>-fs NAMENODE -count dir1</command>
  6877. </test-commands>
  6878. <cleanup-commands>
  6879. <command>-fs NAMENODE -rm -r dir1</command>
  6880. </cleanup-commands>
  6881. <comparators>
  6882. <comparator>
  6883. <type>RegexpComparator</type>
  6884. <expected-output>( |\t)*1( |\t)*0( |\t)*0 dir1</expected-output>
  6885. </comparator>
  6886. </comparators>
  6887. </test>
  6888. <test> <!-- TESTED -->
  6889. <description>count: absolute path to file/directory that does not exist</description>
  6890. <test-commands>
  6891. <command>-fs NAMENODE -count /file1 </command>
  6892. </test-commands>
  6893. <cleanup-commands>
  6894. </cleanup-commands>
  6895. <comparators>
  6896. <comparator>
  6897. <type>TokenComparator</type>
  6898. <expected-output>count: `/file1': No such file or directory</expected-output>
  6899. </comparator>
  6900. </comparators>
  6901. </test>
  6902. <test> <!-- TESTED -->
  6903. <description>count: relative path to file/directory that does not exist</description>
  6904. <test-commands>
  6905. <command>-fs NAMENODE -count file1</command>
  6906. </test-commands>
  6907. <cleanup-commands>
  6908. </cleanup-commands>
  6909. <comparators>
  6910. <comparator>
  6911. <type>TokenComparator</type>
  6912. <expected-output>count: `file1': No such file or directory</expected-output>
  6913. </comparator>
  6914. </comparators>
  6915. </test>
  6916. <test> <!-- TESTED -->
  6917. <description>count: absolute path to multiple files using globbing</description>
  6918. <test-commands>
  6919. <command>-fs NAMENODE -touchz /file1</command>
  6920. <command>-fs NAMENODE -touchz /file2</command>
  6921. <command>-fs NAMENODE -touchz /file3</command>
  6922. <command>-fs NAMENODE -touchz /file4</command>
  6923. <command>-fs NAMENODE -count /file*</command>
  6924. </test-commands>
  6925. <cleanup-commands>
  6926. <command>-fs NAMENODE -rm -r /file*</command>
  6927. </cleanup-commands>
  6928. <comparators>
  6929. <comparator>
  6930. <type>RegexpComparator</type>
  6931. <expected-output>( |\t)*0( |\t)*1( |\t)*0 /file1</expected-output>
  6932. </comparator>
  6933. <comparator>
  6934. <type>RegexpComparator</type>
  6935. <expected-output>( |\t)*0( |\t)*1( |\t)*0 /file2</expected-output>
  6936. </comparator>
  6937. <comparator>
  6938. <type>RegexpComparator</type>
  6939. <expected-output>( |\t)*0( |\t)*1( |\t)*0 /file3</expected-output>
  6940. </comparator>
  6941. <comparator>
  6942. <type>RegexpComparator</type>
  6943. <expected-output>( |\t)*0( |\t)*1( |\t)*0 /file4</expected-output>
  6944. </comparator>
  6945. </comparators>
  6946. </test>
  6947. <test> <!-- TESTED -->
  6948. <description>count: relative path to multiple files using globbing</description>
  6949. <test-commands>
  6950. <command>-fs NAMENODE -touchz file1</command>
  6951. <command>-fs NAMENODE -touchz file2</command>
  6952. <command>-fs NAMENODE -touchz file3</command>
  6953. <command>-fs NAMENODE -touchz file4</command>
  6954. <command>-fs NAMENODE -count file*</command>
  6955. </test-commands>
  6956. <cleanup-commands>
  6957. <command>-fs NAMENODE -rm -r /user</command>
  6958. </cleanup-commands>
  6959. <comparators>
  6960. <comparator>
  6961. <type>RegexpComparator</type>
  6962. <expected-output>( |\t)*0( |\t)*1( |\t)*0 file1</expected-output>
  6963. </comparator>
  6964. <comparator>
  6965. <type>RegexpComparator</type>
  6966. <expected-output>( |\t)*0( |\t)*1( |\t)*0 file2</expected-output>
  6967. </comparator>
  6968. <comparator>
  6969. <type>RegexpComparator</type>
  6970. <expected-output>( |\t)*0( |\t)*1( |\t)*0 file3</expected-output>
  6971. </comparator>
  6972. <comparator>
  6973. <type>RegexpComparator</type>
  6974. <expected-output>( |\t)*0( |\t)*1( |\t)*0 file4</expected-output>
  6975. </comparator>
  6976. </comparators>
  6977. </test>
  6978. <test> <!-- TESTED -->
  6979. <description>count: absolute path to multiple files without globbing</description>
  6980. <test-commands>
  6981. <command>-fs NAMENODE -touchz /file1</command>
  6982. <command>-fs NAMENODE -touchz /file2</command>
  6983. <command>-fs NAMENODE -touchz /file3</command>
  6984. <command>-fs NAMENODE -touchz /file4</command>
  6985. <command>-fs NAMENODE -count /file1 /file2 /file3 /file4</command>
  6986. </test-commands>
  6987. <cleanup-commands>
  6988. <command>-fs NAMENODE -rm -r /file*</command>
  6989. </cleanup-commands>
  6990. <comparators>
  6991. <comparator>
  6992. <type>RegexpComparator</type>
  6993. <expected-output>( |\t)*0( |\t)*1( |\t)*0 /file1</expected-output>
  6994. </comparator>
  6995. <comparator>
  6996. <type>RegexpComparator</type>
  6997. <expected-output>( |\t)*0( |\t)*1( |\t)*0 /file2</expected-output>
  6998. </comparator>
  6999. <comparator>
  7000. <type>RegexpComparator</type>
  7001. <expected-output>( |\t)*0( |\t)*1( |\t)*0 /file3</expected-output>
  7002. </comparator>
  7003. <comparator>
  7004. <type>RegexpComparator</type>
  7005. <expected-output>( |\t)*0( |\t)*1( |\t)*0 /file4</expected-output>
  7006. </comparator>
  7007. </comparators>
  7008. </test>
  7009. <test> <!-- TESTED -->
  7010. <description>count: relative path to multiple files without globbing</description>
  7011. <test-commands>
  7012. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  7013. <command>-fs NAMENODE -touchz file1</command>
  7014. <command>-fs NAMENODE -touchz file2</command>
  7015. <command>-fs NAMENODE -touchz file3</command>
  7016. <command>-fs NAMENODE -touchz file4</command>
  7017. <command>-fs NAMENODE -count file1 file2 file3 file4</command>
  7018. </test-commands>
  7019. <cleanup-commands>
  7020. <command>-fs NAMENODE -rm -r /user</command>
  7021. </cleanup-commands>
  7022. <comparators>
  7023. <comparator>
  7024. <type>RegexpComparator</type>
  7025. <expected-output>( |\t)*0( |\t)*1( |\t)*0 file1</expected-output>
  7026. </comparator>
  7027. <comparator>
  7028. <type>RegexpComparator</type>
  7029. <expected-output>( |\t)*0( |\t)*1( |\t)*0 file2</expected-output>
  7030. </comparator>
  7031. <comparator>
  7032. <type>RegexpComparator</type>
  7033. <expected-output>( |\t)*0( |\t)*1( |\t)*0 file3</expected-output>
  7034. </comparator>
  7035. <comparator>
  7036. <type>RegexpComparator</type>
  7037. <expected-output>( |\t)*0( |\t)*1( |\t)*0 file4</expected-output>
  7038. </comparator>
  7039. </comparators>
  7040. </test>
  7041. <test> <!-- TESTED -->
  7042. <description>count: absolute path to multiple directories using globbing</description>
  7043. <test-commands>
  7044. <command>-fs NAMENODE -mkdir /dir1</command>
  7045. <command>-fs NAMENODE -mkdir /dir2</command>
  7046. <command>-fs NAMENODE -mkdir /dir3</command>
  7047. <command>-fs NAMENODE -mkdir /dir4</command>
  7048. <command>-fs NAMENODE -count /dir* </command>
  7049. </test-commands>
  7050. <cleanup-commands>
  7051. <command>-fs NAMENODE -rm -r /dir*</command>
  7052. </cleanup-commands>
  7053. <comparators>
  7054. <comparator>
  7055. <type>RegexpComparator</type>
  7056. <expected-output>( |\t)*1( |\t)*0( |\t)*0 /dir1</expected-output>
  7057. </comparator>
  7058. <comparator>
  7059. <type>RegexpComparator</type>
  7060. <expected-output>( |\t)*1( |\t)*0( |\t)*0 /dir2</expected-output>
  7061. </comparator>
  7062. <comparator>
  7063. <type>RegexpComparator</type>
  7064. <expected-output>( |\t)*1( |\t)*0( |\t)*0 /dir3</expected-output>
  7065. </comparator>
  7066. <comparator>
  7067. <type>RegexpComparator</type>
  7068. <expected-output>( |\t)*1( |\t)*0( |\t)*0 /dir4</expected-output>
  7069. </comparator>
  7070. </comparators>
  7071. </test>
  7072. <test> <!-- TESTED -->
  7073. <description>count: relative path to multiple directories using globbing</description>
  7074. <test-commands>
  7075. <command>-fs NAMENODE -mkdir -p dir1</command>
  7076. <command>-fs NAMENODE -mkdir -p dir2</command>
  7077. <command>-fs NAMENODE -mkdir -p dir3</command>
  7078. <command>-fs NAMENODE -mkdir -p dir4</command>
  7079. <command>-fs NAMENODE -count dir* </command>
  7080. </test-commands>
  7081. <cleanup-commands>
  7082. <command>-fs NAMENODE -rm -r /user</command>
  7083. </cleanup-commands>
  7084. <comparators>
  7085. <comparator>
  7086. <type>RegexpComparator</type>
  7087. <expected-output>( |\t)*1( |\t)*0( |\t)*0 dir1</expected-output>
  7088. </comparator>
  7089. <comparator>
  7090. <type>RegexpComparator</type>
  7091. <expected-output>( |\t)*1( |\t)*0( |\t)*0 dir2</expected-output>
  7092. </comparator>
  7093. <comparator>
  7094. <type>RegexpComparator</type>
  7095. <expected-output>( |\t)*1( |\t)*0( |\t)*0 dir3</expected-output>
  7096. </comparator>
  7097. <comparator>
  7098. <type>RegexpComparator</type>
  7099. <expected-output>( |\t)*1( |\t)*0( |\t)*0 dir4</expected-output>
  7100. </comparator>
  7101. </comparators>
  7102. </test>
  7103. <test> <!-- TESTED -->
  7104. <description>count: absolute path to multiple directories without globbing</description>
  7105. <test-commands>
  7106. <command>-fs NAMENODE -mkdir /dir1</command>
  7107. <command>-fs NAMENODE -mkdir /dir2</command>
  7108. <command>-fs NAMENODE -mkdir /dir3</command>
  7109. <command>-fs NAMENODE -mkdir /dir4</command>
  7110. <command>-fs NAMENODE -count /dir1 /dir2 /dir3 /dir4 </command>
  7111. </test-commands>
  7112. <cleanup-commands>
  7113. <command>-fs NAMENODE -rm -r /dir*</command>
  7114. </cleanup-commands>
  7115. <comparators>
  7116. <comparator>
  7117. <type>RegexpComparator</type>
  7118. <expected-output>( |\t)*1( |\t)*0( |\t)*0 /dir1</expected-output>
  7119. </comparator>
  7120. <comparator>
  7121. <type>RegexpComparator</type>
  7122. <expected-output>( |\t)*1( |\t)*0( |\t)*0 /dir2</expected-output>
  7123. </comparator>
  7124. <comparator>
  7125. <type>RegexpComparator</type>
  7126. <expected-output>( |\t)*1( |\t)*0( |\t)*0 /dir3</expected-output>
  7127. </comparator>
  7128. <comparator>
  7129. <type>RegexpComparator</type>
  7130. <expected-output>( |\t)*1( |\t)*0( |\t)*0 /dir4</expected-output>
  7131. </comparator>
  7132. </comparators>
  7133. </test>
  7134. <test> <!-- TESTED -->
  7135. <description>count: relative path to multiple directories without globbing</description>
  7136. <test-commands>
  7137. <command>-fs NAMENODE -mkdir -p dir1</command>
  7138. <command>-fs NAMENODE -mkdir -p dir2</command>
  7139. <command>-fs NAMENODE -mkdir -p dir3</command>
  7140. <command>-fs NAMENODE -mkdir -p dir4</command>
  7141. <command>-fs NAMENODE -count dir1 dir2 dir3 dir4 </command>
  7142. </test-commands>
  7143. <cleanup-commands>
  7144. <command>-fs NAMENODE -rm -r /user</command>
  7145. </cleanup-commands>
  7146. <comparators>
  7147. <comparator>
  7148. <type>RegexpComparator</type>
  7149. <expected-output>( |\t)*1( |\t)*0( |\t)*0 dir1</expected-output>
  7150. </comparator>
  7151. <comparator>
  7152. <type>RegexpComparator</type>
  7153. <expected-output>( |\t)*1( |\t)*0( |\t)*0 dir2</expected-output>
  7154. </comparator>
  7155. <comparator>
  7156. <type>RegexpComparator</type>
  7157. <expected-output>( |\t)*1( |\t)*0( |\t)*0 dir3</expected-output>
  7158. </comparator>
  7159. <comparator>
  7160. <type>RegexpComparator</type>
  7161. <expected-output>( |\t)*1( |\t)*0( |\t)*0 dir4</expected-output>
  7162. </comparator>
  7163. </comparators>
  7164. </test>
  7165. <test> <!-- TESTED -->
  7166. <description>count: file using absolute path with -q option</description>
  7167. <test-commands>
  7168. <command>-fs NAMENODE -touchz /file1</command>
  7169. <command>-fs NAMENODE -count -q /file1</command>
  7170. </test-commands>
  7171. <cleanup-commands>
  7172. <command>-fs NAMENODE -rm /file1</command>
  7173. </cleanup-commands>
  7174. <comparators>
  7175. <comparator>
  7176. <type>RegexpComparator</type>
  7177. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 /file1</expected-output>
  7178. </comparator>
  7179. </comparators>
  7180. </test>
  7181. <test> <!-- TESTED -->
  7182. <description>count: file using relative path with -q option</description>
  7183. <test-commands>
  7184. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  7185. <command>-fs NAMENODE -touchz file1</command>
  7186. <command>-fs NAMENODE -count -q file1</command>
  7187. </test-commands>
  7188. <cleanup-commands>
  7189. <command>-fs NAMENODE -rm file1</command>
  7190. </cleanup-commands>
  7191. <comparators>
  7192. <comparator>
  7193. <type>RegexpComparator</type>
  7194. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 file1</expected-output>
  7195. </comparator>
  7196. </comparators>
  7197. </test>
  7198. <test> <!-- TESTED -->
  7199. <description>count: directory using absolute path with -q option</description>
  7200. <test-commands>
  7201. <command>-fs NAMENODE -mkdir /dir1</command>
  7202. <dfs-admin-command>-fs NAMENODE -setQuota 10 /dir1 </dfs-admin-command>
  7203. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m /dir1 </dfs-admin-command>
  7204. <command>-fs NAMENODE -count -q /dir1</command>
  7205. </test-commands>
  7206. <cleanup-commands>
  7207. <command>-fs NAMENODE -rm -r /dir1</command>
  7208. </cleanup-commands>
  7209. <comparators>
  7210. <comparator>
  7211. <type>RegexpComparator</type>
  7212. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 /dir1</expected-output>
  7213. </comparator>
  7214. </comparators>
  7215. </test>
  7216. <test> <!-- TESTED -->
  7217. <description>count: directory using relative path with -q option</description>
  7218. <test-commands>
  7219. <command>-fs NAMENODE -mkdir -p dir1</command>
  7220. <dfs-admin-command>-fs NAMENODE -setQuota 10 dir1 </dfs-admin-command>
  7221. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m dir1 </dfs-admin-command>
  7222. <command>-fs NAMENODE -count -q dir1</command>
  7223. </test-commands>
  7224. <cleanup-commands>
  7225. <command>-fs NAMENODE -rm -r dir1</command>
  7226. </cleanup-commands>
  7227. <comparators>
  7228. <comparator>
  7229. <type>RegexpComparator</type>
  7230. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 dir1</expected-output>
  7231. </comparator>
  7232. </comparators>
  7233. </test>
  7234. <test> <!-- TESTED -->
  7235. <description>count: absolute path to file/directory that does not exist with -q option</description>
  7236. <test-commands>
  7237. <command>-fs NAMENODE -count -q /file1 </command>
  7238. </test-commands>
  7239. <cleanup-commands>
  7240. </cleanup-commands>
  7241. <comparators>
  7242. <comparator>
  7243. <type>TokenComparator</type>
  7244. <expected-output>count: `/file1': No such file or directory</expected-output>
  7245. </comparator>
  7246. </comparators>
  7247. </test>
  7248. <test> <!-- TESTED -->
  7249. <description>count: relative path to file/directory that does not exist with -q option</description>
  7250. <test-commands>
  7251. <command>-fs NAMENODE -count -q file1</command>
  7252. </test-commands>
  7253. <cleanup-commands>
  7254. </cleanup-commands>
  7255. <comparators>
  7256. <comparator>
  7257. <type>TokenComparator</type>
  7258. <expected-output>count: `file1': No such file or directory</expected-output>
  7259. </comparator>
  7260. </comparators>
  7261. </test>
  7262. <test> <!-- TESTED -->
  7263. <description>count: absolute path to multiple files using globbing with -q option</description>
  7264. <test-commands>
  7265. <command>-fs NAMENODE -touchz /file1</command>
  7266. <command>-fs NAMENODE -touchz /file2</command>
  7267. <command>-fs NAMENODE -touchz /file3</command>
  7268. <command>-fs NAMENODE -touchz /file4</command>
  7269. <command>-fs NAMENODE -count -q /file*</command>
  7270. </test-commands>
  7271. <cleanup-commands>
  7272. <command>-fs NAMENODE -rm -r /file*</command>
  7273. </cleanup-commands>
  7274. <comparators>
  7275. <comparator>
  7276. <type>RegexpComparator</type>
  7277. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 /file1</expected-output>
  7278. </comparator>
  7279. <comparator>
  7280. <type>RegexpComparator</type>
  7281. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 /file2</expected-output>
  7282. </comparator>
  7283. <comparator>
  7284. <type>RegexpComparator</type>
  7285. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 /file3</expected-output>
  7286. </comparator>
  7287. <comparator>
  7288. <type>RegexpComparator</type>
  7289. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 /file4</expected-output>
  7290. </comparator>
  7291. </comparators>
  7292. </test>
  7293. <test> <!-- TESTED -->
  7294. <description>count: relative path to multiple files using globbing with -q option</description>
  7295. <test-commands>
  7296. <command>-fs NAMENODE -touchz file1</command>
  7297. <command>-fs NAMENODE -touchz file2</command>
  7298. <command>-fs NAMENODE -touchz file3</command>
  7299. <command>-fs NAMENODE -touchz file4</command>
  7300. <command>-fs NAMENODE -count -q file*</command>
  7301. </test-commands>
  7302. <cleanup-commands>
  7303. <command>-fs NAMENODE -rm -r /user</command>
  7304. </cleanup-commands>
  7305. <comparators>
  7306. <comparator>
  7307. <type>RegexpComparator</type>
  7308. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 file1</expected-output>
  7309. </comparator>
  7310. <comparator>
  7311. <type>RegexpComparator</type>
  7312. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 file2</expected-output>
  7313. </comparator>
  7314. <comparator>
  7315. <type>RegexpComparator</type>
  7316. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 file3</expected-output>
  7317. </comparator>
  7318. <comparator>
  7319. <type>RegexpComparator</type>
  7320. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 file4</expected-output>
  7321. </comparator>
  7322. </comparators>
  7323. </test>
  7324. <test> <!-- TESTED -->
  7325. <description>count: absolute path to multiple files without globbing with -q option</description>
  7326. <test-commands>
  7327. <command>-fs NAMENODE -touchz /file1</command>
  7328. <command>-fs NAMENODE -touchz /file2</command>
  7329. <command>-fs NAMENODE -touchz /file3</command>
  7330. <command>-fs NAMENODE -touchz /file4</command>
  7331. <command>-fs NAMENODE -count -q /file1 /file2 /file3 /file4</command>
  7332. </test-commands>
  7333. <cleanup-commands>
  7334. <command>-fs NAMENODE -rm -r /file*</command>
  7335. </cleanup-commands>
  7336. <comparators>
  7337. <comparator>
  7338. <type>RegexpComparator</type>
  7339. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 /file1</expected-output>
  7340. </comparator>
  7341. <comparator>
  7342. <type>RegexpComparator</type>
  7343. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 /file2</expected-output>
  7344. </comparator>
  7345. <comparator>
  7346. <type>RegexpComparator</type>
  7347. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 /file3</expected-output>
  7348. </comparator>
  7349. <comparator>
  7350. <type>RegexpComparator</type>
  7351. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 /file4</expected-output>
  7352. </comparator>
  7353. </comparators>
  7354. </test>
  7355. <test> <!-- TESTED -->
  7356. <description>count: relative path to multiple files without globbing with -q option</description>
  7357. <test-commands>
  7358. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  7359. <command>-fs NAMENODE -touchz file1</command>
  7360. <command>-fs NAMENODE -touchz file2</command>
  7361. <command>-fs NAMENODE -touchz file3</command>
  7362. <command>-fs NAMENODE -touchz file4</command>
  7363. <command>-fs NAMENODE -count -q file1 file2 file3 file4</command>
  7364. </test-commands>
  7365. <cleanup-commands>
  7366. <command>-fs NAMENODE -rm -r /user</command>
  7367. </cleanup-commands>
  7368. <comparators>
  7369. <comparator>
  7370. <type>RegexpComparator</type>
  7371. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 file1</expected-output>
  7372. </comparator>
  7373. <comparator>
  7374. <type>RegexpComparator</type>
  7375. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 file2</expected-output>
  7376. </comparator>
  7377. <comparator>
  7378. <type>RegexpComparator</type>
  7379. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 file3</expected-output>
  7380. </comparator>
  7381. <comparator>
  7382. <type>RegexpComparator</type>
  7383. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 file4</expected-output>
  7384. </comparator>
  7385. </comparators>
  7386. </test>
  7387. <test> <!-- TESTED -->
  7388. <description>count: absolute path to multiple directories using globbing with -q option</description>
  7389. <test-commands>
  7390. <command>-fs NAMENODE -mkdir /dir1</command>
  7391. <command>-fs NAMENODE -mkdir /dir2</command>
  7392. <command>-fs NAMENODE -mkdir /dir3</command>
  7393. <command>-fs NAMENODE -mkdir /dir4</command>
  7394. <dfs-admin-command>-fs NAMENODE -setQuota 10 /dir1 </dfs-admin-command>
  7395. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m /dir1 </dfs-admin-command>
  7396. <dfs-admin-command>-fs NAMENODE -setQuota 10 /dir2 </dfs-admin-command>
  7397. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m /dir2 </dfs-admin-command>
  7398. <dfs-admin-command>-fs NAMENODE -setQuota 10 /dir3 </dfs-admin-command>
  7399. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m /dir3 </dfs-admin-command>
  7400. <dfs-admin-command>-fs NAMENODE -setQuota 10 /dir4 </dfs-admin-command>
  7401. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m /dir4 </dfs-admin-command>
  7402. <command>-fs NAMENODE -count -q /dir* </command>
  7403. </test-commands>
  7404. <cleanup-commands>
  7405. <command>-fs NAMENODE -rm -r /dir*</command>
  7406. </cleanup-commands>
  7407. <comparators>
  7408. <comparator>
  7409. <type>RegexpComparator</type>
  7410. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 /dir1</expected-output>
  7411. </comparator>
  7412. <comparator>
  7413. <type>RegexpComparator</type>
  7414. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 /dir2</expected-output>
  7415. </comparator>
  7416. <comparator>
  7417. <type>RegexpComparator</type>
  7418. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 /dir3</expected-output>
  7419. </comparator>
  7420. <comparator>
  7421. <type>RegexpComparator</type>
  7422. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 /dir4</expected-output>
  7423. </comparator>
  7424. </comparators>
  7425. </test>
  7426. <test> <!-- TESTED -->
  7427. <description>count: relative path to multiple directories using globbing with -q option</description>
  7428. <test-commands>
  7429. <command>-fs NAMENODE -mkdir -p dir1</command>
  7430. <command>-fs NAMENODE -mkdir -p dir2</command>
  7431. <command>-fs NAMENODE -mkdir -p dir3</command>
  7432. <command>-fs NAMENODE -mkdir -p dir4</command>
  7433. <dfs-admin-command>-fs NAMENODE -setQuota 10 dir1 </dfs-admin-command>
  7434. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m dir1 </dfs-admin-command>
  7435. <dfs-admin-command>-fs NAMENODE -setQuota 10 dir2 </dfs-admin-command>
  7436. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m dir2 </dfs-admin-command>
  7437. <dfs-admin-command>-fs NAMENODE -setQuota 10 dir3 </dfs-admin-command>
  7438. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m dir3 </dfs-admin-command>
  7439. <dfs-admin-command>-fs NAMENODE -setQuota 10 dir4 </dfs-admin-command>
  7440. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m dir4 </dfs-admin-command>
  7441. <command>-fs NAMENODE -count -q dir* </command>
  7442. </test-commands>
  7443. <cleanup-commands>
  7444. <command>-fs NAMENODE -rm -r /user</command>
  7445. </cleanup-commands>
  7446. <comparators>
  7447. <comparator>
  7448. <type>RegexpComparator</type>
  7449. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 dir1</expected-output>
  7450. </comparator>
  7451. <comparator>
  7452. <type>RegexpComparator</type>
  7453. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 dir2</expected-output>
  7454. </comparator>
  7455. <comparator>
  7456. <type>RegexpComparator</type>
  7457. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 dir3</expected-output>
  7458. </comparator>
  7459. <comparator>
  7460. <type>RegexpComparator</type>
  7461. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 dir4</expected-output>
  7462. </comparator>
  7463. </comparators>
  7464. </test>
  7465. <test> <!-- TESTED -->
  7466. <description>count: absolute path to multiple directories without globbing with -q option</description>
  7467. <test-commands>
  7468. <command>-fs NAMENODE -mkdir /dir1</command>
  7469. <command>-fs NAMENODE -mkdir /dir2</command>
  7470. <command>-fs NAMENODE -mkdir /dir3</command>
  7471. <command>-fs NAMENODE -mkdir /dir4</command>
  7472. <dfs-admin-command>-fs NAMENODE -setQuota 10 /dir1 </dfs-admin-command>
  7473. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m /dir1 </dfs-admin-command>
  7474. <dfs-admin-command>-fs NAMENODE -setQuota 10 /dir2 </dfs-admin-command>
  7475. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m /dir2 </dfs-admin-command>
  7476. <dfs-admin-command>-fs NAMENODE -setQuota 10 /dir3 </dfs-admin-command>
  7477. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m /dir3 </dfs-admin-command>
  7478. <dfs-admin-command>-fs NAMENODE -setQuota 10 /dir4 </dfs-admin-command>
  7479. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m /dir4 </dfs-admin-command>
  7480. <command>-fs NAMENODE -count -q /dir1 /dir2 /dir3 /dir4 </command>
  7481. </test-commands>
  7482. <cleanup-commands>
  7483. <command>-fs NAMENODE -rm -r /dir*</command>
  7484. </cleanup-commands>
  7485. <comparators>
  7486. <comparator>
  7487. <type>RegexpComparator</type>
  7488. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 /dir1</expected-output>
  7489. </comparator>
  7490. <comparator>
  7491. <type>RegexpComparator</type>
  7492. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 /dir2</expected-output>
  7493. </comparator>
  7494. <comparator>
  7495. <type>RegexpComparator</type>
  7496. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 /dir3</expected-output>
  7497. </comparator>
  7498. <comparator>
  7499. <type>RegexpComparator</type>
  7500. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 /dir4</expected-output>
  7501. </comparator>
  7502. </comparators>
  7503. </test>
  7504. <test> <!-- TESTED -->
  7505. <description>count: relative path to multiple directories without globbing with -q option</description>
  7506. <test-commands>
  7507. <command>-fs NAMENODE -mkdir -p dir1</command>
  7508. <command>-fs NAMENODE -mkdir -p dir2</command>
  7509. <command>-fs NAMENODE -mkdir -p dir3</command>
  7510. <command>-fs NAMENODE -mkdir -p dir4</command>
  7511. <dfs-admin-command>-fs NAMENODE -setQuota 10 dir1 </dfs-admin-command>
  7512. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m dir1 </dfs-admin-command>
  7513. <dfs-admin-command>-fs NAMENODE -setQuota 10 dir2 </dfs-admin-command>
  7514. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m dir2 </dfs-admin-command>
  7515. <dfs-admin-command>-fs NAMENODE -setQuota 10 dir3 </dfs-admin-command>
  7516. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m dir3 </dfs-admin-command>
  7517. <dfs-admin-command>-fs NAMENODE -setQuota 10 dir4 </dfs-admin-command>
  7518. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m dir4 </dfs-admin-command>
  7519. <command>-fs NAMENODE -count -q dir1 dir2 dir3 dir4 </command>
  7520. </test-commands>
  7521. <cleanup-commands>
  7522. <command>-fs NAMENODE -rm -r /user</command>
  7523. </cleanup-commands>
  7524. <comparators>
  7525. <comparator>
  7526. <type>RegexpComparator</type>
  7527. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 dir1</expected-output>
  7528. </comparator>
  7529. <comparator>
  7530. <type>RegexpComparator</type>
  7531. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 dir2</expected-output>
  7532. </comparator>
  7533. <comparator>
  7534. <type>RegexpComparator</type>
  7535. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 dir3</expected-output>
  7536. </comparator>
  7537. <comparator>
  7538. <type>RegexpComparator</type>
  7539. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 dir4</expected-output>
  7540. </comparator>
  7541. </comparators>
  7542. </test>
  7543. <test> <!-- TESTED -->
  7544. <description>count: Test for file using hdfs:// path</description>
  7545. <test-commands>
  7546. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  7547. <command>-fs NAMENODE -count hdfs:///file1</command>
  7548. </test-commands>
  7549. <cleanup-commands>
  7550. <command>-fs NAMENODE -rm hdfs:///file1</command>
  7551. </cleanup-commands>
  7552. <comparators>
  7553. <comparator>
  7554. <type>RegexpComparator</type>
  7555. <expected-output>( |\t)*0( |\t)*1( |\t)*0 hdfs:///file1</expected-output>
  7556. </comparator>
  7557. </comparators>
  7558. </test>
  7559. <test> <!-- TESTED -->
  7560. <description>count: Test for directory using hdfs:// path</description>
  7561. <test-commands>
  7562. <command>-fs NAMENODE -mkdir hdfs:///dir1</command>
  7563. <command>-fs NAMENODE -count hdfs:///dir1</command>
  7564. </test-commands>
  7565. <cleanup-commands>
  7566. <command>-fs NAMENODE -rm -r hdfs:///dir1</command>
  7567. </cleanup-commands>
  7568. <comparators>
  7569. <comparator>
  7570. <type>RegexpComparator</type>
  7571. <expected-output>( |\t)*1( |\t)*0( |\t)*0 hdfs:///dir1</expected-output>
  7572. </comparator>
  7573. </comparators>
  7574. </test>
  7575. <test> <!-- TESTED -->
  7576. <description>count: Test for hdfs:// path - file/directory that does not exist</description>
  7577. <test-commands>
  7578. <command>-fs NAMENODE -count hdfs:///file1 </command>
  7579. </test-commands>
  7580. <cleanup-commands>
  7581. </cleanup-commands>
  7582. <comparators>
  7583. <comparator>
  7584. <type>TokenComparator</type>
  7585. <expected-output>count: `hdfs:///file1': No such file or directory</expected-output>
  7586. </comparator>
  7587. </comparators>
  7588. </test>
  7589. <test> <!-- TESTED -->
  7590. <description>count: Test for hdfs:// path - multiple files using globbing</description>
  7591. <test-commands>
  7592. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  7593. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  7594. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  7595. <command>-fs NAMENODE -touchz hdfs:///file4</command>
  7596. <command>-fs NAMENODE -count hdfs:///file*</command>
  7597. </test-commands>
  7598. <cleanup-commands>
  7599. <command>-fs NAMENODE -rm -r hdfs:///file*</command>
  7600. </cleanup-commands>
  7601. <comparators>
  7602. <comparator>
  7603. <type>RegexpComparator</type>
  7604. <expected-output>( |\t)*0( |\t)*1( |\t)*0 hdfs:///file1</expected-output>
  7605. </comparator>
  7606. <comparator>
  7607. <type>RegexpComparator</type>
  7608. <expected-output>( |\t)*0( |\t)*1( |\t)*0 hdfs:///file2</expected-output>
  7609. </comparator>
  7610. <comparator>
  7611. <type>RegexpComparator</type>
  7612. <expected-output>( |\t)*0( |\t)*1( |\t)*0 hdfs:///file3</expected-output>
  7613. </comparator>
  7614. <comparator>
  7615. <type>RegexpComparator</type>
  7616. <expected-output>( |\t)*0( |\t)*1( |\t)*0 hdfs:///file4</expected-output>
  7617. </comparator>
  7618. </comparators>
  7619. </test>
  7620. <test> <!-- TESTED -->
  7621. <description>count: Test for hdfs:// path - multiple files without globbing</description>
  7622. <test-commands>
  7623. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  7624. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  7625. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  7626. <command>-fs NAMENODE -touchz hdfs:///file4</command>
  7627. <command>-fs NAMENODE -count hdfs:///file1 hdfs:///file2 hdfs:///file3 hdfs:///file4</command>
  7628. </test-commands>
  7629. <cleanup-commands>
  7630. <command>-fs NAMENODE -rm -r hdfs:///file*</command>
  7631. </cleanup-commands>
  7632. <comparators>
  7633. <comparator>
  7634. <type>RegexpComparator</type>
  7635. <expected-output>( |\t)*0( |\t)*1( |\t)*0 hdfs:///file1</expected-output>
  7636. </comparator>
  7637. <comparator>
  7638. <type>RegexpComparator</type>
  7639. <expected-output>( |\t)*0( |\t)*1( |\t)*0 hdfs:///file2</expected-output>
  7640. </comparator>
  7641. <comparator>
  7642. <type>RegexpComparator</type>
  7643. <expected-output>( |\t)*0( |\t)*1( |\t)*0 hdfs:///file3</expected-output>
  7644. </comparator>
  7645. <comparator>
  7646. <type>RegexpComparator</type>
  7647. <expected-output>( |\t)*0( |\t)*1( |\t)*0 hdfs:///file4</expected-output>
  7648. </comparator>
  7649. </comparators>
  7650. </test>
  7651. <test> <!-- TESTED -->
  7652. <description>count: Test for hdfs:// path - multiple directories using globbing</description>
  7653. <test-commands>
  7654. <command>-fs NAMENODE -mkdir hdfs:///dir1</command>
  7655. <command>-fs NAMENODE -mkdir hdfs:///dir2</command>
  7656. <command>-fs NAMENODE -mkdir hdfs:///dir3</command>
  7657. <command>-fs NAMENODE -mkdir hdfs:///dir4</command>
  7658. <command>-fs NAMENODE -count hdfs:///dir* </command>
  7659. </test-commands>
  7660. <cleanup-commands>
  7661. <command>-fs NAMENODE -rm -r hdfs:///dir*</command>
  7662. </cleanup-commands>
  7663. <comparators>
  7664. <comparator>
  7665. <type>RegexpComparator</type>
  7666. <expected-output>( |\t)*1( |\t)*0( |\t)*0 hdfs:///dir1</expected-output>
  7667. </comparator>
  7668. <comparator>
  7669. <type>RegexpComparator</type>
  7670. <expected-output>( |\t)*1( |\t)*0( |\t)*0 hdfs:///dir2</expected-output>
  7671. </comparator>
  7672. <comparator>
  7673. <type>RegexpComparator</type>
  7674. <expected-output>( |\t)*1( |\t)*0( |\t)*0 hdfs:///dir3</expected-output>
  7675. </comparator>
  7676. <comparator>
  7677. <type>RegexpComparator</type>
  7678. <expected-output>( |\t)*1( |\t)*0( |\t)*0 hdfs:///dir4</expected-output>
  7679. </comparator>
  7680. </comparators>
  7681. </test>
  7682. <test> <!-- TESTED -->
  7683. <description>count: Test for hdfs:// path - multiple directories without globbing</description>
  7684. <test-commands>
  7685. <command>-fs NAMENODE -mkdir hdfs:///dir1</command>
  7686. <command>-fs NAMENODE -mkdir hdfs:///dir2</command>
  7687. <command>-fs NAMENODE -mkdir hdfs:///dir3</command>
  7688. <command>-fs NAMENODE -mkdir hdfs:///dir4</command>
  7689. <command>-fs NAMENODE -count hdfs:///dir1 hdfs:///dir2 hdfs:///dir3 hdfs:///dir4 </command>
  7690. </test-commands>
  7691. <cleanup-commands>
  7692. <command>-fs NAMENODE -rm -r hdfs:///dir*</command>
  7693. </cleanup-commands>
  7694. <comparators>
  7695. <comparator>
  7696. <type>RegexpComparator</type>
  7697. <expected-output>( |\t)*1( |\t)*0( |\t)*0 hdfs:///dir1</expected-output>
  7698. </comparator>
  7699. <comparator>
  7700. <type>RegexpComparator</type>
  7701. <expected-output>( |\t)*1( |\t)*0( |\t)*0 hdfs:///dir2</expected-output>
  7702. </comparator>
  7703. <comparator>
  7704. <type>RegexpComparator</type>
  7705. <expected-output>( |\t)*1( |\t)*0( |\t)*0 hdfs:///dir3</expected-output>
  7706. </comparator>
  7707. <comparator>
  7708. <type>RegexpComparator</type>
  7709. <expected-output>( |\t)*1( |\t)*0( |\t)*0 hdfs:///dir4</expected-output>
  7710. </comparator>
  7711. </comparators>
  7712. </test>
  7713. <test> <!-- TESTED -->
  7714. <description>count: Test for file using hdfs:// path with -q option</description>
  7715. <test-commands>
  7716. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  7717. <command>-fs NAMENODE -count -q hdfs:///file1</command>
  7718. </test-commands>
  7719. <cleanup-commands>
  7720. <command>-fs NAMENODE -rm hdfs:///file1</command>
  7721. </cleanup-commands>
  7722. <comparators>
  7723. <comparator>
  7724. <type>RegexpComparator</type>
  7725. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 hdfs:///file1</expected-output>
  7726. </comparator>
  7727. </comparators>
  7728. </test>
  7729. <test> <!-- TESTED -->
  7730. <description>count: Test for directory using hdfs:// path with -q option</description>
  7731. <test-commands>
  7732. <command>-fs NAMENODE -mkdir hdfs:///dir1</command>
  7733. <dfs-admin-command>-fs NAMENODE -setQuota 10 hdfs:///dir1 </dfs-admin-command>
  7734. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m hdfs:///dir1 </dfs-admin-command>
  7735. <command>-fs NAMENODE -count -q hdfs:///dir1</command>
  7736. </test-commands>
  7737. <cleanup-commands>
  7738. <command>-fs NAMENODE -rm -r hdfs:///dir1</command>
  7739. </cleanup-commands>
  7740. <comparators>
  7741. <comparator>
  7742. <type>RegexpComparator</type>
  7743. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 hdfs:///dir1</expected-output>
  7744. </comparator>
  7745. </comparators>
  7746. </test>
  7747. <test> <!-- TESTED -->
  7748. <description>count: Test for hdfs:// path - file/directory that does not exist with -q option</description>
  7749. <test-commands>
  7750. <command>-fs NAMENODE -count -q hdfs:///file1 </command>
  7751. </test-commands>
  7752. <cleanup-commands>
  7753. </cleanup-commands>
  7754. <comparators>
  7755. <comparator>
  7756. <type>TokenComparator</type>
  7757. <expected-output>count: `hdfs:///file1': No such file or directory</expected-output>
  7758. </comparator>
  7759. </comparators>
  7760. </test>
  7761. <test> <!-- TESTED -->
  7762. <description>count: Test for hdfs:// path - multiple files using globbing with -q option</description>
  7763. <test-commands>
  7764. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  7765. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  7766. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  7767. <command>-fs NAMENODE -touchz hdfs:///file4</command>
  7768. <command>-fs NAMENODE -count -q hdfs:///file*</command>
  7769. </test-commands>
  7770. <cleanup-commands>
  7771. <command>-fs NAMENODE -rm -r hdfs:///file*</command>
  7772. </cleanup-commands>
  7773. <comparators>
  7774. <comparator>
  7775. <type>RegexpComparator</type>
  7776. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 hdfs:///file1</expected-output>
  7777. </comparator>
  7778. <comparator>
  7779. <type>RegexpComparator</type>
  7780. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 hdfs:///file2</expected-output>
  7781. </comparator>
  7782. <comparator>
  7783. <type>RegexpComparator</type>
  7784. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 hdfs:///file3</expected-output>
  7785. </comparator>
  7786. <comparator>
  7787. <type>RegexpComparator</type>
  7788. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 hdfs:///file4</expected-output>
  7789. </comparator>
  7790. </comparators>
  7791. </test>
  7792. <test> <!-- TESTED -->
  7793. <description>count: Test for hdfs:// path - multiple files without globbing with -q option</description>
  7794. <test-commands>
  7795. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  7796. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  7797. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  7798. <command>-fs NAMENODE -touchz hdfs:///file4</command>
  7799. <command>-fs NAMENODE -count -q hdfs:///file1 hdfs:///file2 hdfs:///file3 hdfs:///file4</command>
  7800. </test-commands>
  7801. <cleanup-commands>
  7802. <command>-fs NAMENODE -rm -r hdfs:///file*</command>
  7803. </cleanup-commands>
  7804. <comparators>
  7805. <comparator>
  7806. <type>RegexpComparator</type>
  7807. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 hdfs:///file1</expected-output>
  7808. </comparator>
  7809. <comparator>
  7810. <type>RegexpComparator</type>
  7811. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 hdfs:///file2</expected-output>
  7812. </comparator>
  7813. <comparator>
  7814. <type>RegexpComparator</type>
  7815. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 hdfs:///file3</expected-output>
  7816. </comparator>
  7817. <comparator>
  7818. <type>RegexpComparator</type>
  7819. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 hdfs:///file4</expected-output>
  7820. </comparator>
  7821. </comparators>
  7822. </test>
  7823. <test> <!-- TESTED -->
  7824. <description>count: Test for hdfs:// path - multiple directories using globbing with -q option</description>
  7825. <test-commands>
  7826. <command>-fs NAMENODE -mkdir hdfs:///dir1</command>
  7827. <command>-fs NAMENODE -mkdir hdfs:///dir2</command>
  7828. <command>-fs NAMENODE -mkdir hdfs:///dir3</command>
  7829. <command>-fs NAMENODE -mkdir hdfs:///dir4</command>
  7830. <dfs-admin-command>-fs NAMENODE -setQuota 10 hdfs:///dir1 </dfs-admin-command>
  7831. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m hdfs:///dir1 </dfs-admin-command>
  7832. <dfs-admin-command>-fs NAMENODE -setQuota 10 hdfs:///dir2 </dfs-admin-command>
  7833. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m hdfs:///dir2 </dfs-admin-command>
  7834. <dfs-admin-command>-fs NAMENODE -setQuota 10 hdfs:///dir3 </dfs-admin-command>
  7835. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m hdfs:///dir3 </dfs-admin-command>
  7836. <dfs-admin-command>-fs NAMENODE -setQuota 10 hdfs:///dir4 </dfs-admin-command>
  7837. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m hdfs:///dir4 </dfs-admin-command>
  7838. <command>-fs NAMENODE -count -q hdfs:///dir* </command>
  7839. </test-commands>
  7840. <cleanup-commands>
  7841. <command>-fs NAMENODE -rm -r hdfs:///dir*</command>
  7842. </cleanup-commands>
  7843. <comparators>
  7844. <comparator>
  7845. <type>RegexpComparator</type>
  7846. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 hdfs:///dir1</expected-output>
  7847. </comparator>
  7848. <comparator>
  7849. <type>RegexpComparator</type>
  7850. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 hdfs:///dir2</expected-output>
  7851. </comparator>
  7852. <comparator>
  7853. <type>RegexpComparator</type>
  7854. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 hdfs:///dir3</expected-output>
  7855. </comparator>
  7856. <comparator>
  7857. <type>RegexpComparator</type>
  7858. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 hdfs:///dir4</expected-output>
  7859. </comparator>
  7860. </comparators>
  7861. </test>
  7862. <test> <!-- TESTED -->
  7863. <description>count: Test for hdfs:// path - multiple directories without globbing with -q option</description>
  7864. <test-commands>
  7865. <command>-fs NAMENODE -mkdir hdfs:///dir1</command>
  7866. <command>-fs NAMENODE -mkdir hdfs:///dir2</command>
  7867. <command>-fs NAMENODE -mkdir hdfs:///dir3</command>
  7868. <command>-fs NAMENODE -mkdir hdfs:///dir4</command>
  7869. <dfs-admin-command>-fs NAMENODE -setQuota 10 hdfs:///dir1 </dfs-admin-command>
  7870. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m hdfs:///dir1 </dfs-admin-command>
  7871. <dfs-admin-command>-fs NAMENODE -setQuota 10 hdfs:///dir2 </dfs-admin-command>
  7872. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m hdfs:///dir2 </dfs-admin-command>
  7873. <dfs-admin-command>-fs NAMENODE -setQuota 10 hdfs:///dir3 </dfs-admin-command>
  7874. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m hdfs:///dir3 </dfs-admin-command>
  7875. <dfs-admin-command>-fs NAMENODE -setQuota 10 hdfs:///dir4 </dfs-admin-command>
  7876. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m hdfs:///dir4 </dfs-admin-command>
  7877. <command>-fs NAMENODE -count -q hdfs:///dir1 hdfs:///dir2 hdfs:///dir3 hdfs:///dir4 </command>
  7878. </test-commands>
  7879. <cleanup-commands>
  7880. <command>-fs NAMENODE -rm -r /dir*</command>
  7881. </cleanup-commands>
  7882. <comparators>
  7883. <comparator>
  7884. <type>RegexpComparator</type>
  7885. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 hdfs:///dir1</expected-output>
  7886. </comparator>
  7887. <comparator>
  7888. <type>RegexpComparator</type>
  7889. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 hdfs:///dir2</expected-output>
  7890. </comparator>
  7891. <comparator>
  7892. <type>RegexpComparator</type>
  7893. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 hdfs:///dir3</expected-output>
  7894. </comparator>
  7895. <comparator>
  7896. <type>RegexpComparator</type>
  7897. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 hdfs:///dir4</expected-output>
  7898. </comparator>
  7899. </comparators>
  7900. </test>
  7901. <test> <!-- TESTED -->
  7902. <description>count: Test for file using Namenode's path</description>
  7903. <test-commands>
  7904. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  7905. <command>-fs NAMENODE -count NAMENODE/file1</command>
  7906. </test-commands>
  7907. <cleanup-commands>
  7908. <command>-fs NAMENODE -rm NAMENODE/file1</command>
  7909. </cleanup-commands>
  7910. <comparators>
  7911. <comparator>
  7912. <type>RegexpComparator</type>
  7913. <expected-output>( |\t)*0( |\t)*1( |\t)*0 NAMENODE/file1</expected-output>
  7914. </comparator>
  7915. </comparators>
  7916. </test>
  7917. <test> <!-- TESTED -->
  7918. <description>count: Test for directory using Namenode's path</description>
  7919. <test-commands>
  7920. <command>-fs NAMENODE -mkdir NAMENODE/dir1</command>
  7921. <command>-fs NAMENODE -count NAMENODE/dir1</command>
  7922. </test-commands>
  7923. <cleanup-commands>
  7924. <command>-fs NAMENODE -rm -r NAMENODE/dir1</command>
  7925. </cleanup-commands>
  7926. <comparators>
  7927. <comparator>
  7928. <type>RegexpComparator</type>
  7929. <expected-output>( |\t)*1( |\t)*0( |\t)*0 NAMENODE/dir1</expected-output>
  7930. </comparator>
  7931. </comparators>
  7932. </test>
  7933. <test> <!-- TESTED -->
  7934. <description>count: Test for Namenode's path - file/directory that does not exist</description>
  7935. <test-commands>
  7936. <command>-fs NAMENODE -count NAMENODE/file1 </command>
  7937. </test-commands>
  7938. <cleanup-commands>
  7939. </cleanup-commands>
  7940. <comparators>
  7941. <comparator>
  7942. <type>RegexpComparator</type>
  7943. <expected-output>count: `NAMENODE/file1': No such file or directory</expected-output>
  7944. </comparator>
  7945. </comparators>
  7946. </test>
  7947. <test> <!-- TESTED -->
  7948. <description>count: Test for Namenode's path - multiple files using globbing</description>
  7949. <test-commands>
  7950. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  7951. <command>-fs NAMENODE -touchz NAMENODE/file2</command>
  7952. <command>-fs NAMENODE -touchz NAMENODE/file3</command>
  7953. <command>-fs NAMENODE -touchz NAMENODE/file4</command>
  7954. <command>-fs NAMENODE -count NAMENODE/file*</command>
  7955. </test-commands>
  7956. <cleanup-commands>
  7957. <command>-fs NAMENODE -rm -r NAMENODE/file*</command>
  7958. </cleanup-commands>
  7959. <comparators>
  7960. <comparator>
  7961. <type>RegexpComparator</type>
  7962. <expected-output>( |\t)*0( |\t)*1( |\t)*0 NAMENODE/file1</expected-output>
  7963. </comparator>
  7964. <comparator>
  7965. <type>RegexpComparator</type>
  7966. <expected-output>( |\t)*0( |\t)*1( |\t)*0 NAMENODE/file2</expected-output>
  7967. </comparator>
  7968. <comparator>
  7969. <type>RegexpComparator</type>
  7970. <expected-output>( |\t)*0( |\t)*1( |\t)*0 NAMENODE/file3</expected-output>
  7971. </comparator>
  7972. <comparator>
  7973. <type>RegexpComparator</type>
  7974. <expected-output>( |\t)*0( |\t)*1( |\t)*0 NAMENODE/file4</expected-output>
  7975. </comparator>
  7976. </comparators>
  7977. </test>
  7978. <test> <!-- TESTED -->
  7979. <description>count: Test for Namenode's path - multiple files without globbing</description>
  7980. <test-commands>
  7981. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  7982. <command>-fs NAMENODE -touchz NAMENODE/file2</command>
  7983. <command>-fs NAMENODE -touchz NAMENODE/file3</command>
  7984. <command>-fs NAMENODE -touchz NAMENODE/file4</command>
  7985. <command>-fs NAMENODE -count NAMENODE/file1 NAMENODE/file2 NAMENODE/file3 NAMENODE/file4</command>
  7986. </test-commands>
  7987. <cleanup-commands>
  7988. <command>-fs NAMENODE -rm -r NAMENODE/file*</command>
  7989. </cleanup-commands>
  7990. <comparators>
  7991. <comparator>
  7992. <type>RegexpComparator</type>
  7993. <expected-output>( |\t)*0( |\t)*1( |\t)*0 NAMENODE/file1</expected-output>
  7994. </comparator>
  7995. <comparator>
  7996. <type>RegexpComparator</type>
  7997. <expected-output>( |\t)*0( |\t)*1( |\t)*0 NAMENODE/file2</expected-output>
  7998. </comparator>
  7999. <comparator>
  8000. <type>RegexpComparator</type>
  8001. <expected-output>( |\t)*0( |\t)*1( |\t)*0 NAMENODE/file3</expected-output>
  8002. </comparator>
  8003. <comparator>
  8004. <type>RegexpComparator</type>
  8005. <expected-output>( |\t)*0( |\t)*1( |\t)*0 NAMENODE/file4</expected-output>
  8006. </comparator>
  8007. </comparators>
  8008. </test>
  8009. <test> <!-- TESTED -->
  8010. <description>count: Test for Namenode's path - multiple directories using globbing</description>
  8011. <test-commands>
  8012. <command>-fs NAMENODE -mkdir NAMENODE/dir1</command>
  8013. <command>-fs NAMENODE -mkdir NAMENODE/dir2</command>
  8014. <command>-fs NAMENODE -mkdir NAMENODE/dir3</command>
  8015. <command>-fs NAMENODE -mkdir NAMENODE/dir4</command>
  8016. <command>-fs NAMENODE -count NAMENODE/dir* </command>
  8017. </test-commands>
  8018. <cleanup-commands>
  8019. <command>-fs NAMENODE -rm -r NAMENODE/dir*</command>
  8020. </cleanup-commands>
  8021. <comparators>
  8022. <comparator>
  8023. <type>RegexpComparator</type>
  8024. <expected-output>( |\t)*1( |\t)*0( |\t)*0 NAMENODE/dir1</expected-output>
  8025. </comparator>
  8026. <comparator>
  8027. <type>RegexpComparator</type>
  8028. <expected-output>( |\t)*1( |\t)*0( |\t)*0 NAMENODE/dir2</expected-output>
  8029. </comparator>
  8030. <comparator>
  8031. <type>RegexpComparator</type>
  8032. <expected-output>( |\t)*1( |\t)*0( |\t)*0 NAMENODE/dir3</expected-output>
  8033. </comparator>
  8034. <comparator>
  8035. <type>RegexpComparator</type>
  8036. <expected-output>( |\t)*1( |\t)*0( |\t)*0 NAMENODE/dir4</expected-output>
  8037. </comparator>
  8038. </comparators>
  8039. </test>
  8040. <test> <!-- TESTED -->
  8041. <description>count: Test for Namenode's path - multiple directories without globbing</description>
  8042. <test-commands>
  8043. <command>-fs NAMENODE -mkdir NAMENODE/dir1</command>
  8044. <command>-fs NAMENODE -mkdir NAMENODE/dir2</command>
  8045. <command>-fs NAMENODE -mkdir NAMENODE/dir3</command>
  8046. <command>-fs NAMENODE -mkdir NAMENODE/dir4</command>
  8047. <command>-fs NAMENODE -count NAMENODE/dir1 NAMENODE/dir2 NAMENODE/dir3 NAMENODE/dir4 </command>
  8048. </test-commands>
  8049. <cleanup-commands>
  8050. <command>-fs NAMENODE -rm -r NAMENODE/dir*</command>
  8051. </cleanup-commands>
  8052. <comparators>
  8053. <comparator>
  8054. <type>RegexpComparator</type>
  8055. <expected-output>( |\t)*1( |\t)*0( |\t)*0 NAMENODE/dir1</expected-output>
  8056. </comparator>
  8057. <comparator>
  8058. <type>RegexpComparator</type>
  8059. <expected-output>( |\t)*1( |\t)*0( |\t)*0 NAMENODE/dir2</expected-output>
  8060. </comparator>
  8061. <comparator>
  8062. <type>RegexpComparator</type>
  8063. <expected-output>( |\t)*1( |\t)*0( |\t)*0 NAMENODE/dir3</expected-output>
  8064. </comparator>
  8065. <comparator>
  8066. <type>RegexpComparator</type>
  8067. <expected-output>( |\t)*1( |\t)*0( |\t)*0 NAMENODE/dir4</expected-output>
  8068. </comparator>
  8069. </comparators>
  8070. </test>
  8071. <test> <!-- TESTED -->
  8072. <description>count: Test for file using Namenode's path with -q option</description>
  8073. <test-commands>
  8074. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  8075. <command>-fs NAMENODE -count -q NAMENODE/file1</command>
  8076. </test-commands>
  8077. <cleanup-commands>
  8078. <command>-fs NAMENODE -rm NAMENODE/file1</command>
  8079. </cleanup-commands>
  8080. <comparators>
  8081. <comparator>
  8082. <type>RegexpComparator</type>
  8083. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 NAMENODE/file1</expected-output>
  8084. </comparator>
  8085. </comparators>
  8086. </test>
  8087. <test> <!-- TESTED -->
  8088. <description>count: Test for directory using Namenode's path with -q option</description>
  8089. <test-commands>
  8090. <command>-fs NAMENODE -mkdir NAMENODE/dir1</command>
  8091. <dfs-admin-command>-fs NAMENODE -setQuota 10 NAMENODE/dir1 </dfs-admin-command>
  8092. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m NAMENODE/dir1 </dfs-admin-command>
  8093. <command>-fs NAMENODE -count -q NAMENODE/dir1</command>
  8094. </test-commands>
  8095. <cleanup-commands>
  8096. <command>-fs NAMENODE -rm -r NAMENODE/dir1</command>
  8097. </cleanup-commands>
  8098. <comparators>
  8099. <comparator>
  8100. <type>RegexpComparator</type>
  8101. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 NAMENODE/dir1</expected-output>
  8102. </comparator>
  8103. </comparators>
  8104. </test>
  8105. <test> <!-- TESTED -->
  8106. <description>count: Test for Namenode's path - file/directory that does not exist with -q option</description>
  8107. <test-commands>
  8108. <command>-fs NAMENODE -count -q NAMENODE/file1 </command>
  8109. </test-commands>
  8110. <cleanup-commands>
  8111. </cleanup-commands>
  8112. <comparators>
  8113. <comparator>
  8114. <type>RegexpComparator</type>
  8115. <expected-output>count: `NAMENODE/file1': No such file or directory</expected-output>
  8116. </comparator>
  8117. </comparators>
  8118. </test>
  8119. <test> <!-- TESTED -->
  8120. <description>count: Test for Namenode's path - multiple files using globbing with -q option</description>
  8121. <test-commands>
  8122. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  8123. <command>-fs NAMENODE -touchz NAMENODE/file2</command>
  8124. <command>-fs NAMENODE -touchz NAMENODE/file3</command>
  8125. <command>-fs NAMENODE -touchz NAMENODE/file4</command>
  8126. <command>-fs NAMENODE -count -q NAMENODE/file*</command>
  8127. </test-commands>
  8128. <cleanup-commands>
  8129. <command>-fs NAMENODE -rm -r NAMENODE/file*</command>
  8130. </cleanup-commands>
  8131. <comparators>
  8132. <comparator>
  8133. <type>RegexpComparator</type>
  8134. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 NAMENODE/file1</expected-output>
  8135. </comparator>
  8136. <comparator>
  8137. <type>RegexpComparator</type>
  8138. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 NAMENODE/file2</expected-output>
  8139. </comparator>
  8140. <comparator>
  8141. <type>RegexpComparator</type>
  8142. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 NAMENODE/file3</expected-output>
  8143. </comparator>
  8144. <comparator>
  8145. <type>RegexpComparator</type>
  8146. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 NAMENODE/file4</expected-output>
  8147. </comparator>
  8148. </comparators>
  8149. </test>
  8150. <test> <!-- TESTED -->
  8151. <description>count: Test for Namenode's path - multiple files without globbing with -q option</description>
  8152. <test-commands>
  8153. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  8154. <command>-fs NAMENODE -touchz NAMENODE/file2</command>
  8155. <command>-fs NAMENODE -touchz NAMENODE/file3</command>
  8156. <command>-fs NAMENODE -touchz NAMENODE/file4</command>
  8157. <command>-fs NAMENODE -count -q NAMENODE/file1 NAMENODE/file2 NAMENODE/file3 NAMENODE/file4</command>
  8158. </test-commands>
  8159. <cleanup-commands>
  8160. <command>-fs NAMENODE -rm -r NAMENODE/file*</command>
  8161. </cleanup-commands>
  8162. <comparators>
  8163. <comparator>
  8164. <type>RegexpComparator</type>
  8165. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 NAMENODE/file1</expected-output>
  8166. </comparator>
  8167. <comparator>
  8168. <type>RegexpComparator</type>
  8169. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 NAMENODE/file2</expected-output>
  8170. </comparator>
  8171. <comparator>
  8172. <type>RegexpComparator</type>
  8173. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 NAMENODE/file3</expected-output>
  8174. </comparator>
  8175. <comparator>
  8176. <type>RegexpComparator</type>
  8177. <expected-output>( |\t)*none( |\t)*inf( |\t)*none( |\t)*inf( |\t)*0( |\t)*1( |\t)*0 NAMENODE/file4</expected-output>
  8178. </comparator>
  8179. </comparators>
  8180. </test>
  8181. <test> <!-- TESTED -->
  8182. <description>count: Test for Namenode's path - multiple directories using globbing with -q option</description>
  8183. <test-commands>
  8184. <command>-fs NAMENODE -mkdir NAMENODE/dir1</command>
  8185. <command>-fs NAMENODE -mkdir NAMENODE/dir2</command>
  8186. <command>-fs NAMENODE -mkdir NAMENODE/dir3</command>
  8187. <command>-fs NAMENODE -mkdir NAMENODE/dir4</command>
  8188. <dfs-admin-command>-fs NAMENODE -setQuota 10 NAMENODE/dir1 </dfs-admin-command>
  8189. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m NAMENODE/dir1 </dfs-admin-command>
  8190. <dfs-admin-command>-fs NAMENODE -setQuota 10 NAMENODE/dir2 </dfs-admin-command>
  8191. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m NAMENODE/dir2 </dfs-admin-command>
  8192. <dfs-admin-command>-fs NAMENODE -setQuota 10 NAMENODE/dir3 </dfs-admin-command>
  8193. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m NAMENODE/dir3 </dfs-admin-command>
  8194. <dfs-admin-command>-fs NAMENODE -setQuota 10 NAMENODE/dir4 </dfs-admin-command>
  8195. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m NAMENODE/dir4 </dfs-admin-command>
  8196. <command>-fs NAMENODE -count -q NAMENODE/dir* </command>
  8197. </test-commands>
  8198. <cleanup-commands>
  8199. <command>-fs NAMENODE -rm -r NAMENODE/dir*</command>
  8200. </cleanup-commands>
  8201. <comparators>
  8202. <comparator>
  8203. <type>RegexpComparator</type>
  8204. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 NAMENODE/dir1</expected-output>
  8205. </comparator>
  8206. <comparator>
  8207. <type>RegexpComparator</type>
  8208. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 NAMENODE/dir2</expected-output>
  8209. </comparator>
  8210. <comparator>
  8211. <type>RegexpComparator</type>
  8212. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 NAMENODE/dir3</expected-output>
  8213. </comparator>
  8214. <comparator>
  8215. <type>RegexpComparator</type>
  8216. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 NAMENODE/dir4</expected-output>
  8217. </comparator>
  8218. </comparators>
  8219. </test>
  8220. <test> <!-- TESTED -->
  8221. <description>count: Test for Namenode's path - multiple directories without globbing with -q option</description>
  8222. <test-commands>
  8223. <command>-fs NAMENODE -mkdir NAMENODE/dir1</command>
  8224. <command>-fs NAMENODE -mkdir NAMENODE/dir2</command>
  8225. <command>-fs NAMENODE -mkdir NAMENODE/dir3</command>
  8226. <command>-fs NAMENODE -mkdir NAMENODE/dir4</command>
  8227. <dfs-admin-command>-fs NAMENODE -setQuota 10 NAMENODE/dir1 </dfs-admin-command>
  8228. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m NAMENODE/dir1 </dfs-admin-command>
  8229. <dfs-admin-command>-fs NAMENODE -setQuota 10 NAMENODE/dir2 </dfs-admin-command>
  8230. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m NAMENODE/dir2 </dfs-admin-command>
  8231. <dfs-admin-command>-fs NAMENODE -setQuota 10 NAMENODE/dir3 </dfs-admin-command>
  8232. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m NAMENODE/dir3 </dfs-admin-command>
  8233. <dfs-admin-command>-fs NAMENODE -setQuota 10 NAMENODE/dir4 </dfs-admin-command>
  8234. <dfs-admin-command>-fs NAMENODE -setSpaceQuota 1m NAMENODE/dir4 </dfs-admin-command>
  8235. <command>-fs NAMENODE -count -q NAMENODE/dir1 NAMENODE/dir2 NAMENODE/dir3 NAMENODE/dir4 </command>
  8236. </test-commands>
  8237. <cleanup-commands>
  8238. <command>-fs NAMENODE -rm -r NAMENODE/dir*</command>
  8239. </cleanup-commands>
  8240. <comparators>
  8241. <comparator>
  8242. <type>RegexpComparator</type>
  8243. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 NAMENODE/dir1</expected-output>
  8244. </comparator>
  8245. <comparator>
  8246. <type>RegexpComparator</type>
  8247. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 NAMENODE/dir2</expected-output>
  8248. </comparator>
  8249. <comparator>
  8250. <type>RegexpComparator</type>
  8251. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 NAMENODE/dir3</expected-output>
  8252. </comparator>
  8253. <comparator>
  8254. <type>RegexpComparator</type>
  8255. <expected-output>( |\t)*10( |\t)*9( |\t)*1048576( |\t)*1048576( |\t)*1( |\t)*0( |\t)*0 NAMENODE/dir4</expected-output>
  8256. </comparator>
  8257. </comparators>
  8258. </test>
  8259. <!-- Tests for chmod -->
  8260. <test> <!-- TESTED -->
  8261. <description>chmod: change permission(octal mode) of file in absolute path</description>
  8262. <test-commands>
  8263. <command>-fs NAMENODE -touchz /file1</command>
  8264. <command>-fs NAMENODE -chmod 777 /file1</command>
  8265. <command>-fs NAMENODE -ls /file1</command>
  8266. </test-commands>
  8267. <cleanup-commands>
  8268. <command>-fs NAMENODE -rm /file1</command>
  8269. </cleanup-commands>
  8270. <comparators>
  8271. <comparator>
  8272. <type>RegexpComparator</type>
  8273. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file1</expected-output>
  8274. </comparator>
  8275. </comparators>
  8276. </test>
  8277. <test> <!-- TESTED -->
  8278. <description>chmod: change permission(octal mode) of file in relative path</description>
  8279. <test-commands>
  8280. <command>-fs NAMENODE -mkdir -p dir</command> <!-- make sure user home dir exists -->
  8281. <command>-fs NAMENODE -touchz file1</command>
  8282. <command>-fs NAMENODE -chmod 666 file1</command>
  8283. <command>-fs NAMENODE -ls file1</command>
  8284. </test-commands>
  8285. <cleanup-commands>
  8286. <command>-fs NAMENODE -rm file1</command>
  8287. </cleanup-commands>
  8288. <comparators>
  8289. <comparator>
  8290. <type>RegexpComparator</type>
  8291. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file1</expected-output>
  8292. </comparator>
  8293. </comparators>
  8294. </test>
  8295. <test> <!-- TESTED -->
  8296. <description>chmod: change permission(octal mode) of directory in absolute path</description>
  8297. <test-commands>
  8298. <command>-fs NAMENODE -mkdir /dir0</command>
  8299. <command>-fs NAMENODE -mkdir /dir0/dir1</command>
  8300. <command>-fs NAMENODE -touchz /dir0/file0</command>
  8301. <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
  8302. <command>-fs NAMENODE -touchz /dir0/dir1/file2</command>
  8303. <command>-fs NAMENODE -chmod 777 /dir0/dir1</command>
  8304. <command>-fs NAMENODE -ls -R /dir0</command>
  8305. </test-commands>
  8306. <cleanup-commands>
  8307. <command>-fs NAMENODE -rm -r /dir0</command>
  8308. </cleanup-commands>
  8309. <comparators>
  8310. <comparator>
  8311. <type>RegexpComparator</type>
  8312. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1</expected-output>
  8313. </comparator>
  8314. <comparator>
  8315. <type>RegexpComparator</type>
  8316. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file1</expected-output>
  8317. </comparator>
  8318. <comparator>
  8319. <type>RegexpComparator</type>
  8320. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file2</expected-output>
  8321. </comparator>
  8322. <comparator>
  8323. <type>RegexpComparator</type>
  8324. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file0</expected-output>
  8325. </comparator>
  8326. </comparators>
  8327. </test>
  8328. <test> <!-- TESTED -->
  8329. <description>chmod: change permission(octal mode) of directory in relative path</description>
  8330. <test-commands>
  8331. <command>-fs NAMENODE -mkdir -p dir0</command>
  8332. <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
  8333. <command>-fs NAMENODE -touchz dir0/file0</command>
  8334. <command>-fs NAMENODE -touchz dir0/dir1/file1</command>
  8335. <command>-fs NAMENODE -touchz dir0/dir1/file2</command>
  8336. <command>-fs NAMENODE -chmod 777 dir0/dir1</command>
  8337. <command>-fs NAMENODE -ls -R dir0</command>
  8338. </test-commands>
  8339. <cleanup-commands>
  8340. <command>-fs NAMENODE -rm -r dir0</command>
  8341. </cleanup-commands>
  8342. <comparators>
  8343. <comparator>
  8344. <type>RegexpComparator</type>
  8345. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1</expected-output>
  8346. </comparator>
  8347. <comparator>
  8348. <type>RegexpComparator</type>
  8349. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file1</expected-output>
  8350. </comparator>
  8351. <comparator>
  8352. <type>RegexpComparator</type>
  8353. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file2</expected-output>
  8354. </comparator>
  8355. <comparator>
  8356. <type>RegexpComparator</type>
  8357. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/file0</expected-output>
  8358. </comparator>
  8359. </comparators>
  8360. </test>
  8361. <test> <!-- TESTED -->
  8362. <description>chmod: change permission(normal mode) of file in absolute path</description>
  8363. <test-commands>
  8364. <command>-fs NAMENODE -touchz /file1</command>
  8365. <command>-fs NAMENODE -chmod a+rw /file1</command>
  8366. <command>-fs NAMENODE -ls /file1</command>
  8367. </test-commands>
  8368. <cleanup-commands>
  8369. <command>-fs NAMENODE -rm /file1</command>
  8370. </cleanup-commands>
  8371. <comparators>
  8372. <comparator>
  8373. <type>RegexpComparator</type>
  8374. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file1</expected-output>
  8375. </comparator>
  8376. </comparators>
  8377. </test>
  8378. <test> <!-- TESTED -->
  8379. <description>chmod: change permission(normal mode) of file in relative path</description>
  8380. <test-commands>
  8381. <command>-fs NAMENODE -touchz file1</command>
  8382. <command>-fs NAMENODE -chmod a+rw file1</command>
  8383. <command>-fs NAMENODE -ls file1</command>
  8384. </test-commands>
  8385. <cleanup-commands>
  8386. <command>-fs NAMENODE -rm file1</command>
  8387. </cleanup-commands>
  8388. <comparators>
  8389. <comparator>
  8390. <type>RegexpComparator</type>
  8391. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file1</expected-output>
  8392. </comparator>
  8393. </comparators>
  8394. </test>
  8395. <test> <!-- TESTED -->
  8396. <description>chmod: change permission(normal mode) of directory in absolute path</description>
  8397. <test-commands>
  8398. <command>-fs NAMENODE -mkdir /dir0</command>
  8399. <command>-fs NAMENODE -mkdir /dir0/dir1</command>
  8400. <command>-fs NAMENODE -touchz /dir0/file0</command>
  8401. <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
  8402. <command>-fs NAMENODE -touchz /dir0/dir1/file2</command>
  8403. <command>-fs NAMENODE -chmod a+rwx /dir0/dir1</command>
  8404. <command>-fs NAMENODE -ls -R /dir0</command>
  8405. </test-commands>
  8406. <cleanup-commands>
  8407. <command>-fs NAMENODE -rm -r /dir0</command>
  8408. </cleanup-commands>
  8409. <comparators>
  8410. <comparator>
  8411. <type>RegexpComparator</type>
  8412. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1</expected-output>
  8413. </comparator>
  8414. <comparator>
  8415. <type>RegexpComparator</type>
  8416. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file1</expected-output>
  8417. </comparator>
  8418. <comparator>
  8419. <type>RegexpComparator</type>
  8420. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file2</expected-output>
  8421. </comparator>
  8422. <comparator>
  8423. <type>RegexpComparator</type>
  8424. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file0</expected-output>
  8425. </comparator>
  8426. </comparators>
  8427. </test>
  8428. <test> <!-- TESTED -->
  8429. <description>chmod: change permission(normal mode) of directory in relative path</description>
  8430. <test-commands>
  8431. <command>-fs NAMENODE -mkdir -p dir0</command>
  8432. <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
  8433. <command>-fs NAMENODE -touchz dir0/file0</command>
  8434. <command>-fs NAMENODE -touchz dir0/dir1/file1</command>
  8435. <command>-fs NAMENODE -touchz dir0/dir1/file2</command>
  8436. <command>-fs NAMENODE -chmod a+rwx dir0/dir1</command>
  8437. <command>-fs NAMENODE -ls -R dir0</command>
  8438. </test-commands>
  8439. <cleanup-commands>
  8440. <command>-fs NAMENODE -rm -r dir0</command>
  8441. </cleanup-commands>
  8442. <comparators>
  8443. <comparator>
  8444. <type>RegexpComparator</type>
  8445. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1</expected-output>
  8446. </comparator>
  8447. <comparator>
  8448. <type>RegexpComparator</type>
  8449. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file1</expected-output>
  8450. </comparator>
  8451. <comparator>
  8452. <type>RegexpComparator</type>
  8453. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file2</expected-output>
  8454. </comparator>
  8455. <comparator>
  8456. <type>RegexpComparator</type>
  8457. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/file0</expected-output>
  8458. </comparator>
  8459. </comparators>
  8460. </test>
  8461. <test> <!-- TESTED -->
  8462. <description>chmod: change permission(octal mode) of directory in absolute path recursively </description>
  8463. <test-commands>
  8464. <command>-fs NAMENODE -mkdir /dir0</command>
  8465. <command>-fs NAMENODE -mkdir /dir0/dir1</command>
  8466. <command>-fs NAMENODE -touchz /dir0/file0</command>
  8467. <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
  8468. <command>-fs NAMENODE -touchz /dir0/dir1/file2</command>
  8469. <command>-fs NAMENODE -chmod -R 777 /dir0/dir1</command>
  8470. <command>-fs NAMENODE -ls -R /dir0</command>
  8471. </test-commands>
  8472. <cleanup-commands>
  8473. <command>-fs NAMENODE -rm -r /dir0</command>
  8474. </cleanup-commands>
  8475. <comparators>
  8476. <comparator>
  8477. <type>RegexpComparator</type>
  8478. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1</expected-output>
  8479. </comparator>
  8480. <comparator>
  8481. <type>RegexpComparator</type>
  8482. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file1</expected-output>
  8483. </comparator>
  8484. <comparator>
  8485. <type>RegexpComparator</type>
  8486. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file2</expected-output>
  8487. </comparator>
  8488. <comparator>
  8489. <type>RegexpComparator</type>
  8490. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file0</expected-output>
  8491. </comparator>
  8492. </comparators>
  8493. </test>
  8494. <test> <!-- TESTED -->
  8495. <description>chmod: change permission(octal mode) of directory in relative path recursively</description>
  8496. <test-commands>
  8497. <command>-fs NAMENODE -mkdir -p dir0</command>
  8498. <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
  8499. <command>-fs NAMENODE -touchz dir0/file0</command>
  8500. <command>-fs NAMENODE -touchz dir0/dir1/file1</command>
  8501. <command>-fs NAMENODE -touchz dir0/dir1/file2</command>
  8502. <command>-fs NAMENODE -chmod -R 777 dir0/dir1</command>
  8503. <command>-fs NAMENODE -ls -R dir0</command>
  8504. </test-commands>
  8505. <cleanup-commands>
  8506. <command>-fs NAMENODE -rm -r dir0</command>
  8507. </cleanup-commands>
  8508. <comparators>
  8509. <comparator>
  8510. <type>RegexpComparator</type>
  8511. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1</expected-output>
  8512. </comparator>
  8513. <comparator>
  8514. <type>RegexpComparator</type>
  8515. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file1</expected-output>
  8516. </comparator>
  8517. <comparator>
  8518. <type>RegexpComparator</type>
  8519. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file2</expected-output>
  8520. </comparator>
  8521. <comparator>
  8522. <type>RegexpComparator</type>
  8523. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/file0</expected-output>
  8524. </comparator>
  8525. </comparators>
  8526. </test>
  8527. <test> <!-- TESTED -->
  8528. <description>chmod: change permission(normal mode) of directory in absolute path recursively</description>
  8529. <test-commands>
  8530. <command>-fs NAMENODE -mkdir /dir0</command>
  8531. <command>-fs NAMENODE -mkdir /dir0/dir1</command>
  8532. <command>-fs NAMENODE -touchz /dir0/file0</command>
  8533. <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
  8534. <command>-fs NAMENODE -touchz /dir0/dir1/file2</command>
  8535. <command>-fs NAMENODE -chmod -R a+rwx /dir0/dir1</command>
  8536. <command>-fs NAMENODE -ls -R /dir0</command>
  8537. </test-commands>
  8538. <cleanup-commands>
  8539. <command>-fs NAMENODE -rm -r /dir0</command>
  8540. </cleanup-commands>
  8541. <comparators>
  8542. <comparator>
  8543. <type>RegexpComparator</type>
  8544. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1</expected-output>
  8545. </comparator>
  8546. <comparator>
  8547. <type>RegexpComparator</type>
  8548. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file1</expected-output>
  8549. </comparator>
  8550. <comparator>
  8551. <type>RegexpComparator</type>
  8552. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file2</expected-output>
  8553. </comparator>
  8554. <comparator>
  8555. <type>RegexpComparator</type>
  8556. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file0</expected-output>
  8557. </comparator>
  8558. </comparators>
  8559. </test>
  8560. <test> <!-- TESTED -->
  8561. <description>chmod: change permission(normal mode) of directory in relative path recursively</description>
  8562. <test-commands>
  8563. <command>-fs NAMENODE -mkdir -p dir0</command>
  8564. <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
  8565. <command>-fs NAMENODE -touchz dir0/file0</command>
  8566. <command>-fs NAMENODE -touchz dir0/dir1/file1</command>
  8567. <command>-fs NAMENODE -touchz dir0/dir1/file2</command>
  8568. <command>-fs NAMENODE -chmod -R a+rwx dir0/dir1</command>
  8569. <command>-fs NAMENODE -ls -R dir0</command>
  8570. </test-commands>
  8571. <cleanup-commands>
  8572. <command>-fs NAMENODE -rm -r dir0</command>
  8573. </cleanup-commands>
  8574. <comparators>
  8575. <comparator>
  8576. <type>RegexpComparator</type>
  8577. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1</expected-output>
  8578. </comparator>
  8579. <comparator>
  8580. <type>RegexpComparator</type>
  8581. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file1</expected-output>
  8582. </comparator>
  8583. <comparator>
  8584. <type>RegexpComparator</type>
  8585. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file2</expected-output>
  8586. </comparator>
  8587. <comparator>
  8588. <type>RegexpComparator</type>
  8589. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/file0</expected-output>
  8590. </comparator>
  8591. </comparators>
  8592. </test>
  8593. <test> <!-- TESTED -->
  8594. <description>chmod: change permission(octal mode) of non existent file in absolute path</description>
  8595. <test-commands>
  8596. <command>-fs NAMENODE -chmod 777 /file1</command>
  8597. </test-commands>
  8598. <cleanup-commands>
  8599. <command>-fs NAMENODE -rm /file1</command>
  8600. </cleanup-commands>
  8601. <comparators>
  8602. <comparator>
  8603. <type>RegexpComparator</type>
  8604. <expected-output>^chmod: `/file1': No such file or directory</expected-output>
  8605. </comparator>
  8606. </comparators>
  8607. </test>
  8608. <test> <!-- TESTED -->
  8609. <description>chmod: change permission(octal mode) of non existent file in relative path</description>
  8610. <test-commands>
  8611. <command>-fs NAMENODE -chmod 666 file1</command>
  8612. </test-commands>
  8613. <cleanup-commands>
  8614. <command>-fs NAMENODE -rm file1</command>
  8615. </cleanup-commands>
  8616. <comparators>
  8617. <comparator>
  8618. <type>RegexpComparator</type>
  8619. <expected-output>^chmod: `file1': No such file or directory</expected-output>
  8620. </comparator>
  8621. </comparators>
  8622. </test>
  8623. <test> <!-- TESTED -->
  8624. <description>chmod: change permission(normal mode) of non existent file in absolute path</description>
  8625. <test-commands>
  8626. <command>-fs NAMENODE -chmod a+rw /file1</command>
  8627. </test-commands>
  8628. <cleanup-commands>
  8629. <command>-fs NAMENODE -rm /file1</command>
  8630. </cleanup-commands>
  8631. <comparators>
  8632. <comparator>
  8633. <type>RegexpComparator</type>
  8634. <expected-output>^chmod: `/file1': No such file or directory</expected-output>
  8635. </comparator>
  8636. </comparators>
  8637. </test>
  8638. <test> <!-- TESTED -->
  8639. <description>chmod: change permission(normal mode) of non existent file in relative path</description>
  8640. <test-commands>
  8641. <command>-fs NAMENODE -chmod a+rw file1</command>
  8642. </test-commands>
  8643. <cleanup-commands>
  8644. <command>-fs NAMENODE -rm file1</command>
  8645. </cleanup-commands>
  8646. <comparators>
  8647. <comparator>
  8648. <type>RegexpComparator</type>
  8649. <expected-output>^chmod: `file1': No such file or directory</expected-output>
  8650. </comparator>
  8651. </comparators>
  8652. </test>
  8653. <test> <!-- TESTED -->
  8654. <description>chmod: change permission(octal mode) of multiple files in absolute path using globbing</description>
  8655. <test-commands>
  8656. <command>-fs NAMENODE -touchz /file1</command>
  8657. <command>-fs NAMENODE -touchz /file2</command>
  8658. <command>-fs NAMENODE -touchz /file3</command>
  8659. <command>-fs NAMENODE -touchz /file4</command>
  8660. <command>-fs NAMENODE -chmod 777 /file* </command>
  8661. <command>-fs NAMENODE -ls -R /file*</command>
  8662. </test-commands>
  8663. <cleanup-commands>
  8664. <command>-fs NAMENODE -rm /file*</command>
  8665. </cleanup-commands>
  8666. <comparators>
  8667. <comparator>
  8668. <type>RegexpComparator</type>
  8669. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file1</expected-output>
  8670. </comparator>
  8671. <comparator>
  8672. <type>RegexpComparator</type>
  8673. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file2</expected-output>
  8674. </comparator>
  8675. <comparator>
  8676. <type>RegexpComparator</type>
  8677. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file3</expected-output>
  8678. </comparator>
  8679. <comparator>
  8680. <type>RegexpComparator</type>
  8681. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file4</expected-output>
  8682. </comparator>
  8683. </comparators>
  8684. </test>
  8685. <test> <!-- TESTED -->
  8686. <description>chmod: change permission(octal mode) of multiple files in relative path using globbing</description>
  8687. <test-commands>
  8688. <command>-fs NAMENODE -touchz file1</command>
  8689. <command>-fs NAMENODE -touchz file2</command>
  8690. <command>-fs NAMENODE -touchz file3</command>
  8691. <command>-fs NAMENODE -touchz file4</command>
  8692. <command>-fs NAMENODE -chmod 777 file* </command>
  8693. <command>-fs NAMENODE -ls -R file*</command>
  8694. </test-commands>
  8695. <cleanup-commands>
  8696. <command>-fs NAMENODE -rm file*</command>
  8697. </cleanup-commands>
  8698. <comparators>
  8699. <comparator>
  8700. <type>RegexpComparator</type>
  8701. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file1</expected-output>
  8702. </comparator>
  8703. <comparator>
  8704. <type>RegexpComparator</type>
  8705. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file2</expected-output>
  8706. </comparator>
  8707. <comparator>
  8708. <type>RegexpComparator</type>
  8709. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file3</expected-output>
  8710. </comparator>
  8711. <comparator>
  8712. <type>RegexpComparator</type>
  8713. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file4</expected-output>
  8714. </comparator>
  8715. </comparators>
  8716. </test>
  8717. <test> <!-- TESTED -->
  8718. <description>chmod: change permission(octal mode) of multiple directories in absolute path using globbing</description>
  8719. <test-commands>
  8720. <command>-fs NAMENODE -mkdir /dir0</command>
  8721. <command>-fs NAMENODE -mkdir /dir0/dir1</command>
  8722. <command>-fs NAMENODE -touchz /dir0/file0</command>
  8723. <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
  8724. <command>-fs NAMENODE -touchz /dir0/dir1/file2</command>
  8725. <command>-fs NAMENODE -mkdir /dir2</command>
  8726. <command>-fs NAMENODE -mkdir /dir2/dir1</command>
  8727. <command>-fs NAMENODE -touchz /dir2/file0</command>
  8728. <command>-fs NAMENODE -touchz /dir2/dir1/file1</command>
  8729. <command>-fs NAMENODE -touchz /dir2/dir1/file2</command>
  8730. <command>-fs NAMENODE -chmod 777 /dir*</command>
  8731. <command>-fs NAMENODE -ls -R /dir*</command>
  8732. </test-commands>
  8733. <cleanup-commands>
  8734. <command>-fs NAMENODE -rm -r /dir*</command>
  8735. </cleanup-commands>
  8736. <comparators>
  8737. <comparator>
  8738. <type>RegexpComparator</type>
  8739. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1</expected-output>
  8740. </comparator>
  8741. <comparator>
  8742. <type>RegexpComparator</type>
  8743. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file1</expected-output>
  8744. </comparator>
  8745. <comparator>
  8746. <type>RegexpComparator</type>
  8747. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file2</expected-output>
  8748. </comparator>
  8749. <comparator>
  8750. <type>RegexpComparator</type>
  8751. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file0</expected-output>
  8752. </comparator>
  8753. <comparator>
  8754. <type>RegexpComparator</type>
  8755. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1</expected-output>
  8756. </comparator>
  8757. <comparator>
  8758. <type>RegexpComparator</type>
  8759. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1/file1</expected-output>
  8760. </comparator>
  8761. <comparator>
  8762. <type>RegexpComparator</type>
  8763. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1/file2</expected-output>
  8764. </comparator>
  8765. <comparator>
  8766. <type>RegexpComparator</type>
  8767. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/file0</expected-output>
  8768. </comparator>
  8769. </comparators>
  8770. </test>
  8771. <test> <!-- TESTED -->
  8772. <description>chmod: change permission(octal mode) of multiple directories in relative path using globbing</description>
  8773. <test-commands>
  8774. <command>-fs NAMENODE -mkdir -p dir0</command>
  8775. <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
  8776. <command>-fs NAMENODE -touchz dir0/file0</command>
  8777. <command>-fs NAMENODE -touchz dir0/dir1/file1</command>
  8778. <command>-fs NAMENODE -touchz dir0/dir1/file2</command>
  8779. <command>-fs NAMENODE -mkdir -p dir2</command>
  8780. <command>-fs NAMENODE -mkdir -p dir2/dir1</command>
  8781. <command>-fs NAMENODE -touchz dir2/file0</command>
  8782. <command>-fs NAMENODE -touchz dir2/dir1/file1</command>
  8783. <command>-fs NAMENODE -touchz dir2/dir1/file2</command>
  8784. <command>-fs NAMENODE -chmod 777 dir*</command>
  8785. <command>-fs NAMENODE -ls -R dir*</command>
  8786. </test-commands>
  8787. <cleanup-commands>
  8788. <command>-fs NAMENODE -rm -r dir*</command>
  8789. </cleanup-commands>
  8790. <comparators>
  8791. <comparator>
  8792. <type>RegexpComparator</type>
  8793. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1</expected-output>
  8794. </comparator>
  8795. <comparator>
  8796. <type>RegexpComparator</type>
  8797. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file1</expected-output>
  8798. </comparator>
  8799. <comparator>
  8800. <type>RegexpComparator</type>
  8801. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file2</expected-output>
  8802. </comparator>
  8803. <comparator>
  8804. <type>RegexpComparator</type>
  8805. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/file0</expected-output>
  8806. </comparator>
  8807. <comparator>
  8808. <type>RegexpComparator</type>
  8809. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1</expected-output>
  8810. </comparator>
  8811. <comparator>
  8812. <type>RegexpComparator</type>
  8813. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1/file1</expected-output>
  8814. </comparator>
  8815. <comparator>
  8816. <type>RegexpComparator</type>
  8817. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1/file2</expected-output>
  8818. </comparator>
  8819. <comparator>
  8820. <type>RegexpComparator</type>
  8821. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/file0</expected-output>
  8822. </comparator>
  8823. </comparators>
  8824. </test>
  8825. <test> <!-- TESTED -->
  8826. <description>chmod: change permission(octal mode) of multiple files in absolute path without globbing</description>
  8827. <test-commands>
  8828. <command>-fs NAMENODE -touchz /file1</command>
  8829. <command>-fs NAMENODE -touchz /file2</command>
  8830. <command>-fs NAMENODE -touchz /file3</command>
  8831. <command>-fs NAMENODE -touchz /file4</command>
  8832. <command>-fs NAMENODE -chmod 777 /file1 /file2 /file3 /file4 </command>
  8833. <command>-fs NAMENODE -ls -R /file*</command>
  8834. </test-commands>
  8835. <cleanup-commands>
  8836. <command>-fs NAMENODE -rm /file*</command>
  8837. </cleanup-commands>
  8838. <comparators>
  8839. <comparator>
  8840. <type>RegexpComparator</type>
  8841. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file1</expected-output>
  8842. </comparator>
  8843. <comparator>
  8844. <type>RegexpComparator</type>
  8845. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file2</expected-output>
  8846. </comparator>
  8847. <comparator>
  8848. <type>RegexpComparator</type>
  8849. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file3</expected-output>
  8850. </comparator>
  8851. <comparator>
  8852. <type>RegexpComparator</type>
  8853. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file4</expected-output>
  8854. </comparator>
  8855. </comparators>
  8856. </test>
  8857. <test> <!-- TESTED -->
  8858. <description>chmod: change permission(octal mode) of multiple files in relative path without globbing</description>
  8859. <test-commands>
  8860. <command>-fs NAMENODE -touchz file1</command>
  8861. <command>-fs NAMENODE -touchz file2</command>
  8862. <command>-fs NAMENODE -touchz file3</command>
  8863. <command>-fs NAMENODE -touchz file4</command>
  8864. <command>-fs NAMENODE -chmod 777 file1 file2 file3 file4 </command>
  8865. <command>-fs NAMENODE -ls -R file*</command>
  8866. </test-commands>
  8867. <cleanup-commands>
  8868. <command>-fs NAMENODE -rm file*</command>
  8869. </cleanup-commands>
  8870. <comparators>
  8871. <comparator>
  8872. <type>RegexpComparator</type>
  8873. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file1</expected-output>
  8874. </comparator>
  8875. <comparator>
  8876. <type>RegexpComparator</type>
  8877. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file2</expected-output>
  8878. </comparator>
  8879. <comparator>
  8880. <type>RegexpComparator</type>
  8881. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file3</expected-output>
  8882. </comparator>
  8883. <comparator>
  8884. <type>RegexpComparator</type>
  8885. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file4</expected-output>
  8886. </comparator>
  8887. </comparators>
  8888. </test>
  8889. <test> <!-- TESTED -->
  8890. <description>chmod: change permission(octal mode) of multiple directories in absolute path without globbing</description>
  8891. <test-commands>
  8892. <command>-fs NAMENODE -mkdir /dir0</command>
  8893. <command>-fs NAMENODE -mkdir /dir0/dir1</command>
  8894. <command>-fs NAMENODE -touchz /dir0/file0</command>
  8895. <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
  8896. <command>-fs NAMENODE -touchz /dir0/dir1/file2</command>
  8897. <command>-fs NAMENODE -mkdir /dir2</command>
  8898. <command>-fs NAMENODE -mkdir /dir2/dir1</command>
  8899. <command>-fs NAMENODE -touchz /dir2/file0</command>
  8900. <command>-fs NAMENODE -touchz /dir2/dir1/file1</command>
  8901. <command>-fs NAMENODE -touchz /dir2/dir1/file2</command>
  8902. <command>-fs NAMENODE -chmod 777 /dir0 /dir2</command>
  8903. <command>-fs NAMENODE -ls -R /dir*</command>
  8904. </test-commands>
  8905. <cleanup-commands>
  8906. <command>-fs NAMENODE -rm -r /dir*</command>
  8907. </cleanup-commands>
  8908. <comparators>
  8909. <comparator>
  8910. <type>RegexpComparator</type>
  8911. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1</expected-output>
  8912. </comparator>
  8913. <comparator>
  8914. <type>RegexpComparator</type>
  8915. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file1</expected-output>
  8916. </comparator>
  8917. <comparator>
  8918. <type>RegexpComparator</type>
  8919. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file2</expected-output>
  8920. </comparator>
  8921. <comparator>
  8922. <type>RegexpComparator</type>
  8923. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file0</expected-output>
  8924. </comparator>
  8925. <comparator>
  8926. <type>RegexpComparator</type>
  8927. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1</expected-output>
  8928. </comparator>
  8929. <comparator>
  8930. <type>RegexpComparator</type>
  8931. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1/file1</expected-output>
  8932. </comparator>
  8933. <comparator>
  8934. <type>RegexpComparator</type>
  8935. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1/file2</expected-output>
  8936. </comparator>
  8937. <comparator>
  8938. <type>RegexpComparator</type>
  8939. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/file0</expected-output>
  8940. </comparator>
  8941. </comparators>
  8942. </test>
  8943. <test> <!-- TESTED -->
  8944. <description>chmod: change permission(octal mode) of multiple directories in relative path without globbing</description>
  8945. <test-commands>
  8946. <command>-fs NAMENODE -mkdir -p dir0</command>
  8947. <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
  8948. <command>-fs NAMENODE -touchz dir0/file0</command>
  8949. <command>-fs NAMENODE -touchz dir0/dir1/file1</command>
  8950. <command>-fs NAMENODE -touchz dir0/dir1/file2</command>
  8951. <command>-fs NAMENODE -mkdir -p dir2</command>
  8952. <command>-fs NAMENODE -mkdir -p dir2/dir1</command>
  8953. <command>-fs NAMENODE -touchz dir2/file0</command>
  8954. <command>-fs NAMENODE -touchz dir2/dir1/file1</command>
  8955. <command>-fs NAMENODE -touchz dir2/dir1/file2</command>
  8956. <command>-fs NAMENODE -chmod 777 dir0 dir2</command>
  8957. <command>-fs NAMENODE -ls -R dir*</command>
  8958. </test-commands>
  8959. <cleanup-commands>
  8960. <command>-fs NAMENODE -rm -r dir*</command>
  8961. </cleanup-commands>
  8962. <comparators>
  8963. <comparator>
  8964. <type>RegexpComparator</type>
  8965. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1</expected-output>
  8966. </comparator>
  8967. <comparator>
  8968. <type>RegexpComparator</type>
  8969. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file1</expected-output>
  8970. </comparator>
  8971. <comparator>
  8972. <type>RegexpComparator</type>
  8973. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file2</expected-output>
  8974. </comparator>
  8975. <comparator>
  8976. <type>RegexpComparator</type>
  8977. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/file0</expected-output>
  8978. </comparator>
  8979. <comparator>
  8980. <type>RegexpComparator</type>
  8981. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1</expected-output>
  8982. </comparator>
  8983. <comparator>
  8984. <type>RegexpComparator</type>
  8985. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1/file1</expected-output>
  8986. </comparator>
  8987. <comparator>
  8988. <type>RegexpComparator</type>
  8989. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1/file2</expected-output>
  8990. </comparator>
  8991. <comparator>
  8992. <type>RegexpComparator</type>
  8993. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/file0</expected-output>
  8994. </comparator>
  8995. </comparators>
  8996. </test>
  8997. <test> <!-- TESTED -->
  8998. <description>chmod: change permission(normal mode) of multiple files in absolute path using globbing</description>
  8999. <test-commands>
  9000. <command>-fs NAMENODE -touchz /file1</command>
  9001. <command>-fs NAMENODE -touchz /file2</command>
  9002. <command>-fs NAMENODE -touchz /file3</command>
  9003. <command>-fs NAMENODE -touchz /file4</command>
  9004. <command>-fs NAMENODE -chmod a+rw /file* </command>
  9005. <command>-fs NAMENODE -ls -R /file*</command>
  9006. </test-commands>
  9007. <cleanup-commands>
  9008. <command>-fs NAMENODE -rm /file*</command>
  9009. </cleanup-commands>
  9010. <comparators>
  9011. <comparator>
  9012. <type>RegexpComparator</type>
  9013. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file1</expected-output>
  9014. </comparator>
  9015. <comparator>
  9016. <type>RegexpComparator</type>
  9017. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file2</expected-output>
  9018. </comparator>
  9019. <comparator>
  9020. <type>RegexpComparator</type>
  9021. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file3</expected-output>
  9022. </comparator>
  9023. <comparator>
  9024. <type>RegexpComparator</type>
  9025. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file4</expected-output>
  9026. </comparator>
  9027. </comparators>
  9028. </test>
  9029. <test> <!-- TESTED -->
  9030. <description>chmod: change permission(normal mode) of multiple files in relative path using globbing</description>
  9031. <test-commands>
  9032. <command>-fs NAMENODE -touchz file1</command>
  9033. <command>-fs NAMENODE -touchz file2</command>
  9034. <command>-fs NAMENODE -touchz file3</command>
  9035. <command>-fs NAMENODE -touchz file4</command>
  9036. <command>-fs NAMENODE -chmod a+rw file* </command>
  9037. <command>-fs NAMENODE -ls -R file*</command>
  9038. </test-commands>
  9039. <cleanup-commands>
  9040. <command>-fs NAMENODE -rm file*</command>
  9041. </cleanup-commands>
  9042. <comparators>
  9043. <comparator>
  9044. <type>RegexpComparator</type>
  9045. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file1</expected-output>
  9046. </comparator>
  9047. <comparator>
  9048. <type>RegexpComparator</type>
  9049. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file2</expected-output>
  9050. </comparator>
  9051. <comparator>
  9052. <type>RegexpComparator</type>
  9053. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file3</expected-output>
  9054. </comparator>
  9055. <comparator>
  9056. <type>RegexpComparator</type>
  9057. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file4</expected-output>
  9058. </comparator>
  9059. </comparators>
  9060. </test>
  9061. <test> <!-- TESTED -->
  9062. <description>chmod: change permission(normal mode) of multiple directories in absolute path using globbing</description>
  9063. <test-commands>
  9064. <command>-fs NAMENODE -mkdir /dir0</command>
  9065. <command>-fs NAMENODE -mkdir /dir0/dir1</command>
  9066. <command>-fs NAMENODE -touchz /dir0/file0</command>
  9067. <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
  9068. <command>-fs NAMENODE -touchz /dir0/dir1/file2</command>
  9069. <command>-fs NAMENODE -mkdir /dir2</command>
  9070. <command>-fs NAMENODE -mkdir /dir2/dir1</command>
  9071. <command>-fs NAMENODE -touchz /dir2/file0</command>
  9072. <command>-fs NAMENODE -touchz /dir2/dir1/file1</command>
  9073. <command>-fs NAMENODE -touchz /dir2/dir1/file2</command>
  9074. <command>-fs NAMENODE -chmod a+rwx /dir*</command>
  9075. <command>-fs NAMENODE -ls -R /dir*</command>
  9076. </test-commands>
  9077. <cleanup-commands>
  9078. <command>-fs NAMENODE -rm -r /dir*</command>
  9079. </cleanup-commands>
  9080. <comparators>
  9081. <comparator>
  9082. <type>RegexpComparator</type>
  9083. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1</expected-output>
  9084. </comparator>
  9085. <comparator>
  9086. <type>RegexpComparator</type>
  9087. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file1</expected-output>
  9088. </comparator>
  9089. <comparator>
  9090. <type>RegexpComparator</type>
  9091. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file2</expected-output>
  9092. </comparator>
  9093. <comparator>
  9094. <type>RegexpComparator</type>
  9095. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file0</expected-output>
  9096. </comparator>
  9097. <comparator>
  9098. <type>RegexpComparator</type>
  9099. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1</expected-output>
  9100. </comparator>
  9101. <comparator>
  9102. <type>RegexpComparator</type>
  9103. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1/file1</expected-output>
  9104. </comparator>
  9105. <comparator>
  9106. <type>RegexpComparator</type>
  9107. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1/file2</expected-output>
  9108. </comparator>
  9109. <comparator>
  9110. <type>RegexpComparator</type>
  9111. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/file0</expected-output>
  9112. </comparator>
  9113. </comparators>
  9114. </test>
  9115. <test> <!-- TESTED -->
  9116. <description>chmod: change permission(normal mode) of multiple directories in relative path using globbing</description>
  9117. <test-commands>
  9118. <command>-fs NAMENODE -mkdir -p dir0</command>
  9119. <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
  9120. <command>-fs NAMENODE -touchz dir0/file0</command>
  9121. <command>-fs NAMENODE -touchz dir0/dir1/file1</command>
  9122. <command>-fs NAMENODE -touchz dir0/dir1/file2</command>
  9123. <command>-fs NAMENODE -mkdir -p dir2</command>
  9124. <command>-fs NAMENODE -mkdir -p dir2/dir1</command>
  9125. <command>-fs NAMENODE -touchz dir2/file0</command>
  9126. <command>-fs NAMENODE -touchz dir2/dir1/file1</command>
  9127. <command>-fs NAMENODE -touchz dir2/dir1/file2</command>
  9128. <command>-fs NAMENODE -chmod a+rwx dir*</command>
  9129. <command>-fs NAMENODE -ls -R dir*</command>
  9130. </test-commands>
  9131. <cleanup-commands>
  9132. <command>-fs NAMENODE -rm -r dir*</command>
  9133. </cleanup-commands>
  9134. <comparators>
  9135. <comparator>
  9136. <type>RegexpComparator</type>
  9137. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1</expected-output>
  9138. </comparator>
  9139. <comparator>
  9140. <type>RegexpComparator</type>
  9141. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file1</expected-output>
  9142. </comparator>
  9143. <comparator>
  9144. <type>RegexpComparator</type>
  9145. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file2</expected-output>
  9146. </comparator>
  9147. <comparator>
  9148. <type>RegexpComparator</type>
  9149. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/file0</expected-output>
  9150. </comparator>
  9151. <comparator>
  9152. <type>RegexpComparator</type>
  9153. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1</expected-output>
  9154. </comparator>
  9155. <comparator>
  9156. <type>RegexpComparator</type>
  9157. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1/file1</expected-output>
  9158. </comparator>
  9159. <comparator>
  9160. <type>RegexpComparator</type>
  9161. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1/file2</expected-output>
  9162. </comparator>
  9163. <comparator>
  9164. <type>RegexpComparator</type>
  9165. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/file0</expected-output>
  9166. </comparator>
  9167. </comparators>
  9168. </test>
  9169. <test> <!-- TESTED -->
  9170. <description>chmod: change permission(normal mode) of multiple files in absolute path without globbing</description>
  9171. <test-commands>
  9172. <command>-fs NAMENODE -touchz /file1</command>
  9173. <command>-fs NAMENODE -touchz /file2</command>
  9174. <command>-fs NAMENODE -touchz /file3</command>
  9175. <command>-fs NAMENODE -touchz /file4</command>
  9176. <command>-fs NAMENODE -chmod a+rw /file1 /file2 /file3 /file4 </command>
  9177. <command>-fs NAMENODE -ls -R /file*</command>
  9178. </test-commands>
  9179. <cleanup-commands>
  9180. <command>-fs NAMENODE -rm /file*</command>
  9181. </cleanup-commands>
  9182. <comparators>
  9183. <comparator>
  9184. <type>RegexpComparator</type>
  9185. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file1</expected-output>
  9186. </comparator>
  9187. <comparator>
  9188. <type>RegexpComparator</type>
  9189. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file2</expected-output>
  9190. </comparator>
  9191. <comparator>
  9192. <type>RegexpComparator</type>
  9193. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file3</expected-output>
  9194. </comparator>
  9195. <comparator>
  9196. <type>RegexpComparator</type>
  9197. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/file4</expected-output>
  9198. </comparator>
  9199. </comparators>
  9200. </test>
  9201. <test> <!-- TESTED -->
  9202. <description>chmod: change permission(normal mode) of multiple files in relative path without globbing</description>
  9203. <test-commands>
  9204. <command>-fs NAMENODE -touchz file1</command>
  9205. <command>-fs NAMENODE -touchz file2</command>
  9206. <command>-fs NAMENODE -touchz file3</command>
  9207. <command>-fs NAMENODE -touchz file4</command>
  9208. <command>-fs NAMENODE -chmod a+rw file1 file2 file3 file4 </command>
  9209. <command>-fs NAMENODE -ls -R file*</command>
  9210. </test-commands>
  9211. <cleanup-commands>
  9212. <command>-fs NAMENODE -rm file*</command>
  9213. </cleanup-commands>
  9214. <comparators>
  9215. <comparator>
  9216. <type>RegexpComparator</type>
  9217. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file1</expected-output>
  9218. </comparator>
  9219. <comparator>
  9220. <type>RegexpComparator</type>
  9221. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file2</expected-output>
  9222. </comparator>
  9223. <comparator>
  9224. <type>RegexpComparator</type>
  9225. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file3</expected-output>
  9226. </comparator>
  9227. <comparator>
  9228. <type>RegexpComparator</type>
  9229. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*file4</expected-output>
  9230. </comparator>
  9231. </comparators>
  9232. </test>
  9233. <test> <!-- TESTED -->
  9234. <description>chmod: change permission(normal mode) of multiple directories in absolute path without globbing</description>
  9235. <test-commands>
  9236. <command>-fs NAMENODE -mkdir /dir0</command>
  9237. <command>-fs NAMENODE -mkdir /dir0/dir1</command>
  9238. <command>-fs NAMENODE -touchz /dir0/file0</command>
  9239. <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
  9240. <command>-fs NAMENODE -touchz /dir0/dir1/file2</command>
  9241. <command>-fs NAMENODE -mkdir /dir2</command>
  9242. <command>-fs NAMENODE -mkdir /dir2/dir1</command>
  9243. <command>-fs NAMENODE -touchz /dir2/file0</command>
  9244. <command>-fs NAMENODE -touchz /dir2/dir1/file1</command>
  9245. <command>-fs NAMENODE -touchz /dir2/dir1/file2</command>
  9246. <command>-fs NAMENODE -chmod a+rwx /dir0 /dir2</command>
  9247. <command>-fs NAMENODE -ls -R /dir*</command>
  9248. </test-commands>
  9249. <cleanup-commands>
  9250. <command>-fs NAMENODE -rm -r /dir*</command>
  9251. </cleanup-commands>
  9252. <comparators>
  9253. <comparator>
  9254. <type>RegexpComparator</type>
  9255. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1</expected-output>
  9256. </comparator>
  9257. <comparator>
  9258. <type>RegexpComparator</type>
  9259. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file1</expected-output>
  9260. </comparator>
  9261. <comparator>
  9262. <type>RegexpComparator</type>
  9263. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file2</expected-output>
  9264. </comparator>
  9265. <comparator>
  9266. <type>RegexpComparator</type>
  9267. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file0</expected-output>
  9268. </comparator>
  9269. <comparator>
  9270. <type>RegexpComparator</type>
  9271. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1</expected-output>
  9272. </comparator>
  9273. <comparator>
  9274. <type>RegexpComparator</type>
  9275. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1/file1</expected-output>
  9276. </comparator>
  9277. <comparator>
  9278. <type>RegexpComparator</type>
  9279. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1/file2</expected-output>
  9280. </comparator>
  9281. <comparator>
  9282. <type>RegexpComparator</type>
  9283. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/file0</expected-output>
  9284. </comparator>
  9285. </comparators>
  9286. </test>
  9287. <test> <!-- TESTED -->
  9288. <description>chmod: change permission(normal mode) of multiple directories in relative path without globbing</description>
  9289. <test-commands>
  9290. <command>-fs NAMENODE -mkdir -p dir0</command>
  9291. <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
  9292. <command>-fs NAMENODE -touchz dir0/file0</command>
  9293. <command>-fs NAMENODE -touchz dir0/dir1/file1</command>
  9294. <command>-fs NAMENODE -touchz dir0/dir1/file2</command>
  9295. <command>-fs NAMENODE -mkdir -p dir2</command>
  9296. <command>-fs NAMENODE -mkdir -p dir2/dir1</command>
  9297. <command>-fs NAMENODE -touchz dir2/file0</command>
  9298. <command>-fs NAMENODE -touchz dir2/dir1/file1</command>
  9299. <command>-fs NAMENODE -touchz dir2/dir1/file2</command>
  9300. <command>-fs NAMENODE -chmod a+rwx dir0 dir2</command>
  9301. <command>-fs NAMENODE -ls -R dir*</command>
  9302. </test-commands>
  9303. <cleanup-commands>
  9304. <command>-fs NAMENODE -rm -r dir*</command>
  9305. </cleanup-commands>
  9306. <comparators>
  9307. <comparator>
  9308. <type>RegexpComparator</type>
  9309. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1</expected-output>
  9310. </comparator>
  9311. <comparator>
  9312. <type>RegexpComparator</type>
  9313. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file1</expected-output>
  9314. </comparator>
  9315. <comparator>
  9316. <type>RegexpComparator</type>
  9317. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file2</expected-output>
  9318. </comparator>
  9319. <comparator>
  9320. <type>RegexpComparator</type>
  9321. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/file0</expected-output>
  9322. </comparator>
  9323. <comparator>
  9324. <type>RegexpComparator</type>
  9325. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1</expected-output>
  9326. </comparator>
  9327. <comparator>
  9328. <type>RegexpComparator</type>
  9329. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1/file1</expected-output>
  9330. </comparator>
  9331. <comparator>
  9332. <type>RegexpComparator</type>
  9333. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1/file2</expected-output>
  9334. </comparator>
  9335. <comparator>
  9336. <type>RegexpComparator</type>
  9337. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/file0</expected-output>
  9338. </comparator>
  9339. </comparators>
  9340. </test>
  9341. <test> <!-- TESTED -->
  9342. <description>chmod: change permission(octal mode) of multiple directories in absolute path recursively using globbing</description>
  9343. <test-commands>
  9344. <command>-fs NAMENODE -mkdir /dir0</command>
  9345. <command>-fs NAMENODE -mkdir /dir0/dir1</command>
  9346. <command>-fs NAMENODE -touchz /dir0/file0</command>
  9347. <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
  9348. <command>-fs NAMENODE -touchz /dir0/dir1/file2</command>
  9349. <command>-fs NAMENODE -mkdir /dir2</command>
  9350. <command>-fs NAMENODE -mkdir /dir2/dir1</command>
  9351. <command>-fs NAMENODE -touchz /dir2/file0</command>
  9352. <command>-fs NAMENODE -touchz /dir2/dir1/file1</command>
  9353. <command>-fs NAMENODE -touchz /dir2/dir1/file2</command>
  9354. <command>-fs NAMENODE -chmod -R 777 /dir*</command>
  9355. <command>-fs NAMENODE -ls -R /dir*</command>
  9356. </test-commands>
  9357. <cleanup-commands>
  9358. <command>-fs NAMENODE -rm -r /dir*</command>
  9359. </cleanup-commands>
  9360. <comparators>
  9361. <comparator>
  9362. <type>RegexpComparator</type>
  9363. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1</expected-output>
  9364. </comparator>
  9365. <comparator>
  9366. <type>RegexpComparator</type>
  9367. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file1</expected-output>
  9368. </comparator>
  9369. <comparator>
  9370. <type>RegexpComparator</type>
  9371. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file2</expected-output>
  9372. </comparator>
  9373. <comparator>
  9374. <type>RegexpComparator</type>
  9375. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file0</expected-output>
  9376. </comparator>
  9377. <comparator>
  9378. <type>RegexpComparator</type>
  9379. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1</expected-output>
  9380. </comparator>
  9381. <comparator>
  9382. <type>RegexpComparator</type>
  9383. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1/file1</expected-output>
  9384. </comparator>
  9385. <comparator>
  9386. <type>RegexpComparator</type>
  9387. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1/file2</expected-output>
  9388. </comparator>
  9389. <comparator>
  9390. <type>RegexpComparator</type>
  9391. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/file0</expected-output>
  9392. </comparator>
  9393. </comparators>
  9394. </test>
  9395. <test> <!-- TESTED -->
  9396. <description>chmod: change permission(octal mode) of multiple directories in relative path recursively using globbing</description>
  9397. <test-commands>
  9398. <command>-fs NAMENODE -mkdir -p dir0</command>
  9399. <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
  9400. <command>-fs NAMENODE -touchz dir0/file0</command>
  9401. <command>-fs NAMENODE -touchz dir0/dir1/file1</command>
  9402. <command>-fs NAMENODE -touchz dir0/dir1/file2</command>
  9403. <command>-fs NAMENODE -mkdir -p dir2</command>
  9404. <command>-fs NAMENODE -mkdir -p dir2/dir1</command>
  9405. <command>-fs NAMENODE -touchz dir2/file0</command>
  9406. <command>-fs NAMENODE -touchz dir2/dir1/file1</command>
  9407. <command>-fs NAMENODE -touchz dir2/dir1/file2</command>
  9408. <command>-fs NAMENODE -chmod -R 777 dir*</command>
  9409. <command>-fs NAMENODE -ls -R dir*</command>
  9410. </test-commands>
  9411. <cleanup-commands>
  9412. <command>-fs NAMENODE -rm -r dir*</command>
  9413. </cleanup-commands>
  9414. <comparators>
  9415. <comparator>
  9416. <type>RegexpComparator</type>
  9417. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1</expected-output>
  9418. </comparator>
  9419. <comparator>
  9420. <type>RegexpComparator</type>
  9421. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file1</expected-output>
  9422. </comparator>
  9423. <comparator>
  9424. <type>RegexpComparator</type>
  9425. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file2</expected-output>
  9426. </comparator>
  9427. <comparator>
  9428. <type>RegexpComparator</type>
  9429. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/file0</expected-output>
  9430. </comparator>
  9431. <comparator>
  9432. <type>RegexpComparator</type>
  9433. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1</expected-output>
  9434. </comparator>
  9435. <comparator>
  9436. <type>RegexpComparator</type>
  9437. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1/file1</expected-output>
  9438. </comparator>
  9439. <comparator>
  9440. <type>RegexpComparator</type>
  9441. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1/file2</expected-output>
  9442. </comparator>
  9443. <comparator>
  9444. <type>RegexpComparator</type>
  9445. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/file0</expected-output>
  9446. </comparator>
  9447. </comparators>
  9448. </test>
  9449. <test> <!-- TESTED -->
  9450. <description>chmod: change permission(octal mode) of multiple directories in absolute path recursively without globbing</description>
  9451. <test-commands>
  9452. <command>-fs NAMENODE -mkdir /dir0</command>
  9453. <command>-fs NAMENODE -mkdir /dir0/dir1</command>
  9454. <command>-fs NAMENODE -touchz /dir0/file0</command>
  9455. <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
  9456. <command>-fs NAMENODE -touchz /dir0/dir1/file2</command>
  9457. <command>-fs NAMENODE -mkdir /dir2</command>
  9458. <command>-fs NAMENODE -mkdir /dir2/dir1</command>
  9459. <command>-fs NAMENODE -touchz /dir2/file0</command>
  9460. <command>-fs NAMENODE -touchz /dir2/dir1/file1</command>
  9461. <command>-fs NAMENODE -touchz /dir2/dir1/file2</command>
  9462. <command>-fs NAMENODE -chmod -R 777 /dir0 /dir2</command>
  9463. <command>-fs NAMENODE -ls -R /dir*</command>
  9464. </test-commands>
  9465. <cleanup-commands>
  9466. <command>-fs NAMENODE -rm -r /dir*</command>
  9467. </cleanup-commands>
  9468. <comparators>
  9469. <comparator>
  9470. <type>RegexpComparator</type>
  9471. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1</expected-output>
  9472. </comparator>
  9473. <comparator>
  9474. <type>RegexpComparator</type>
  9475. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file1</expected-output>
  9476. </comparator>
  9477. <comparator>
  9478. <type>RegexpComparator</type>
  9479. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file2</expected-output>
  9480. </comparator>
  9481. <comparator>
  9482. <type>RegexpComparator</type>
  9483. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file0</expected-output>
  9484. </comparator>
  9485. <comparator>
  9486. <type>RegexpComparator</type>
  9487. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1</expected-output>
  9488. </comparator>
  9489. <comparator>
  9490. <type>RegexpComparator</type>
  9491. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1/file1</expected-output>
  9492. </comparator>
  9493. <comparator>
  9494. <type>RegexpComparator</type>
  9495. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1/file2</expected-output>
  9496. </comparator>
  9497. <comparator>
  9498. <type>RegexpComparator</type>
  9499. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/file0</expected-output>
  9500. </comparator>
  9501. </comparators>
  9502. </test>
  9503. <test> <!-- TESTED -->
  9504. <description>chmod: change permission(octal mode) of multiple directories in relative path recursively without globbing</description>
  9505. <test-commands>
  9506. <command>-fs NAMENODE -mkdir -p dir0</command>
  9507. <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
  9508. <command>-fs NAMENODE -touchz dir0/file0</command>
  9509. <command>-fs NAMENODE -touchz dir0/dir1/file1</command>
  9510. <command>-fs NAMENODE -touchz dir0/dir1/file2</command>
  9511. <command>-fs NAMENODE -mkdir -p dir2</command>
  9512. <command>-fs NAMENODE -mkdir -p dir2/dir1</command>
  9513. <command>-fs NAMENODE -touchz dir2/file0</command>
  9514. <command>-fs NAMENODE -touchz dir2/dir1/file1</command>
  9515. <command>-fs NAMENODE -touchz dir2/dir1/file2</command>
  9516. <command>-fs NAMENODE -chmod -R 777 dir0 dir2</command>
  9517. <command>-fs NAMENODE -ls -R dir*</command>
  9518. </test-commands>
  9519. <cleanup-commands>
  9520. <command>-fs NAMENODE -rm -r dir*</command>
  9521. </cleanup-commands>
  9522. <comparators>
  9523. <comparator>
  9524. <type>RegexpComparator</type>
  9525. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1</expected-output>
  9526. </comparator>
  9527. <comparator>
  9528. <type>RegexpComparator</type>
  9529. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file1</expected-output>
  9530. </comparator>
  9531. <comparator>
  9532. <type>RegexpComparator</type>
  9533. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file2</expected-output>
  9534. </comparator>
  9535. <comparator>
  9536. <type>RegexpComparator</type>
  9537. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/file0</expected-output>
  9538. </comparator>
  9539. <comparator>
  9540. <type>RegexpComparator</type>
  9541. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1</expected-output>
  9542. </comparator>
  9543. <comparator>
  9544. <type>RegexpComparator</type>
  9545. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1/file1</expected-output>
  9546. </comparator>
  9547. <comparator>
  9548. <type>RegexpComparator</type>
  9549. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1/file2</expected-output>
  9550. </comparator>
  9551. <comparator>
  9552. <type>RegexpComparator</type>
  9553. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/file0</expected-output>
  9554. </comparator>
  9555. </comparators>
  9556. </test>
  9557. <test> <!-- TESTED -->
  9558. <description>chmod: change permission(normal mode) of multiple directories in absolute path recursively using globbing</description>
  9559. <test-commands>
  9560. <command>-fs NAMENODE -mkdir /dir0</command>
  9561. <command>-fs NAMENODE -mkdir /dir0/dir1</command>
  9562. <command>-fs NAMENODE -touchz /dir0/file0</command>
  9563. <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
  9564. <command>-fs NAMENODE -touchz /dir0/dir1/file2</command>
  9565. <command>-fs NAMENODE -mkdir /dir2</command>
  9566. <command>-fs NAMENODE -mkdir /dir2/dir1</command>
  9567. <command>-fs NAMENODE -touchz /dir2/file0</command>
  9568. <command>-fs NAMENODE -touchz /dir2/dir1/file1</command>
  9569. <command>-fs NAMENODE -touchz /dir2/dir1/file2</command>
  9570. <command>-fs NAMENODE -chmod -R a+rwx /dir*</command>
  9571. <command>-fs NAMENODE -ls -R /dir*</command>
  9572. </test-commands>
  9573. <cleanup-commands>
  9574. <command>-fs NAMENODE -rm -r /dir*</command>
  9575. </cleanup-commands>
  9576. <comparators>
  9577. <comparator>
  9578. <type>RegexpComparator</type>
  9579. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1</expected-output>
  9580. </comparator>
  9581. <comparator>
  9582. <type>RegexpComparator</type>
  9583. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file1</expected-output>
  9584. </comparator>
  9585. <comparator>
  9586. <type>RegexpComparator</type>
  9587. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file2</expected-output>
  9588. </comparator>
  9589. <comparator>
  9590. <type>RegexpComparator</type>
  9591. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file0</expected-output>
  9592. </comparator>
  9593. <comparator>
  9594. <type>RegexpComparator</type>
  9595. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1</expected-output>
  9596. </comparator>
  9597. <comparator>
  9598. <type>RegexpComparator</type>
  9599. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1/file1</expected-output>
  9600. </comparator>
  9601. <comparator>
  9602. <type>RegexpComparator</type>
  9603. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1/file2</expected-output>
  9604. </comparator>
  9605. <comparator>
  9606. <type>RegexpComparator</type>
  9607. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/file0</expected-output>
  9608. </comparator>
  9609. </comparators>
  9610. </test>
  9611. <test> <!-- TESTED -->
  9612. <description>chmod: change permission(normal mode) of multiple directories in relative path recursively using globbing</description>
  9613. <test-commands>
  9614. <command>-fs NAMENODE -mkdir -p dir0</command>
  9615. <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
  9616. <command>-fs NAMENODE -touchz dir0/file0</command>
  9617. <command>-fs NAMENODE -touchz dir0/dir1/file1</command>
  9618. <command>-fs NAMENODE -touchz dir0/dir1/file2</command>
  9619. <command>-fs NAMENODE -mkdir -p dir2</command>
  9620. <command>-fs NAMENODE -mkdir -p dir2/dir1</command>
  9621. <command>-fs NAMENODE -touchz dir2/file0</command>
  9622. <command>-fs NAMENODE -touchz dir2/dir1/file1</command>
  9623. <command>-fs NAMENODE -touchz dir2/dir1/file2</command>
  9624. <command>-fs NAMENODE -chmod -R a+rwx dir*</command>
  9625. <command>-fs NAMENODE -ls -R dir*</command>
  9626. </test-commands>
  9627. <cleanup-commands>
  9628. <command>-fs NAMENODE -rm -r dir*</command>
  9629. </cleanup-commands>
  9630. <comparators>
  9631. <comparator>
  9632. <type>RegexpComparator</type>
  9633. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1</expected-output>
  9634. </comparator>
  9635. <comparator>
  9636. <type>RegexpComparator</type>
  9637. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file1</expected-output>
  9638. </comparator>
  9639. <comparator>
  9640. <type>RegexpComparator</type>
  9641. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file2</expected-output>
  9642. </comparator>
  9643. <comparator>
  9644. <type>RegexpComparator</type>
  9645. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/file0</expected-output>
  9646. </comparator>
  9647. <comparator>
  9648. <type>RegexpComparator</type>
  9649. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1</expected-output>
  9650. </comparator>
  9651. <comparator>
  9652. <type>RegexpComparator</type>
  9653. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1/file1</expected-output>
  9654. </comparator>
  9655. <comparator>
  9656. <type>RegexpComparator</type>
  9657. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1/file2</expected-output>
  9658. </comparator>
  9659. <comparator>
  9660. <type>RegexpComparator</type>
  9661. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/file0</expected-output>
  9662. </comparator>
  9663. </comparators>
  9664. </test>
  9665. <test> <!-- TESTED -->
  9666. <description>chmod: change permission(normal mode) of multiple directories in absolute path recursively without globbing</description>
  9667. <test-commands>
  9668. <command>-fs NAMENODE -mkdir /dir0</command>
  9669. <command>-fs NAMENODE -mkdir /dir0/dir1</command>
  9670. <command>-fs NAMENODE -touchz /dir0/file0</command>
  9671. <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
  9672. <command>-fs NAMENODE -touchz /dir0/dir1/file2</command>
  9673. <command>-fs NAMENODE -mkdir /dir2</command>
  9674. <command>-fs NAMENODE -mkdir /dir2/dir1</command>
  9675. <command>-fs NAMENODE -touchz /dir2/file0</command>
  9676. <command>-fs NAMENODE -touchz /dir2/dir1/file1</command>
  9677. <command>-fs NAMENODE -touchz /dir2/dir1/file2</command>
  9678. <command>-fs NAMENODE -chmod -R a+rwx /dir0 /dir2</command>
  9679. <command>-fs NAMENODE -ls -R /dir*</command>
  9680. </test-commands>
  9681. <cleanup-commands>
  9682. <command>-fs NAMENODE -rm -r /dir*</command>
  9683. </cleanup-commands>
  9684. <comparators>
  9685. <comparator>
  9686. <type>RegexpComparator</type>
  9687. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1</expected-output>
  9688. </comparator>
  9689. <comparator>
  9690. <type>RegexpComparator</type>
  9691. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file1</expected-output>
  9692. </comparator>
  9693. <comparator>
  9694. <type>RegexpComparator</type>
  9695. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file2</expected-output>
  9696. </comparator>
  9697. <comparator>
  9698. <type>RegexpComparator</type>
  9699. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/file0</expected-output>
  9700. </comparator>
  9701. <comparator>
  9702. <type>RegexpComparator</type>
  9703. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1</expected-output>
  9704. </comparator>
  9705. <comparator>
  9706. <type>RegexpComparator</type>
  9707. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1/file1</expected-output>
  9708. </comparator>
  9709. <comparator>
  9710. <type>RegexpComparator</type>
  9711. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/dir1/file2</expected-output>
  9712. </comparator>
  9713. <comparator>
  9714. <type>RegexpComparator</type>
  9715. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir2/file0</expected-output>
  9716. </comparator>
  9717. </comparators>
  9718. </test>
  9719. <test> <!-- TESTED -->
  9720. <description>chmod: change permission(normal mode) of multiple directories in relative path recursively without globbing</description>
  9721. <test-commands>
  9722. <command>-fs NAMENODE -mkdir -p dir0</command>
  9723. <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
  9724. <command>-fs NAMENODE -touchz dir0/file0</command>
  9725. <command>-fs NAMENODE -touchz dir0/dir1/file1</command>
  9726. <command>-fs NAMENODE -touchz dir0/dir1/file2</command>
  9727. <command>-fs NAMENODE -mkdir -p dir2</command>
  9728. <command>-fs NAMENODE -mkdir -p dir2/dir1</command>
  9729. <command>-fs NAMENODE -touchz dir2/file0</command>
  9730. <command>-fs NAMENODE -touchz dir2/dir1/file1</command>
  9731. <command>-fs NAMENODE -touchz dir2/dir1/file2</command>
  9732. <command>-fs NAMENODE -chmod -R a+rwx dir0 dir2</command>
  9733. <command>-fs NAMENODE -ls -R dir*</command>
  9734. </test-commands>
  9735. <cleanup-commands>
  9736. <command>-fs NAMENODE -rm -r dir*</command>
  9737. </cleanup-commands>
  9738. <comparators>
  9739. <comparator>
  9740. <type>RegexpComparator</type>
  9741. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1</expected-output>
  9742. </comparator>
  9743. <comparator>
  9744. <type>RegexpComparator</type>
  9745. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file1</expected-output>
  9746. </comparator>
  9747. <comparator>
  9748. <type>RegexpComparator</type>
  9749. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/dir1/file2</expected-output>
  9750. </comparator>
  9751. <comparator>
  9752. <type>RegexpComparator</type>
  9753. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir0/file0</expected-output>
  9754. </comparator>
  9755. <comparator>
  9756. <type>RegexpComparator</type>
  9757. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1</expected-output>
  9758. </comparator>
  9759. <comparator>
  9760. <type>RegexpComparator</type>
  9761. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1/file1</expected-output>
  9762. </comparator>
  9763. <comparator>
  9764. <type>RegexpComparator</type>
  9765. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/dir1/file2</expected-output>
  9766. </comparator>
  9767. <comparator>
  9768. <type>RegexpComparator</type>
  9769. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*dir2/file0</expected-output>
  9770. </comparator>
  9771. </comparators>
  9772. </test>
  9773. <test> <!-- TESTED -->
  9774. <description>chmod: invalid value in octal mode of file in absolute path</description>
  9775. <test-commands>
  9776. <command>-fs NAMENODE -touchz /file1</command>
  9777. <command>-fs NAMENODE -chmod 999 /file1</command>
  9778. </test-commands>
  9779. <cleanup-commands>
  9780. <command>-fs NAMENODE -rm /file1</command>
  9781. </cleanup-commands>
  9782. <comparators>
  9783. <comparator>
  9784. <type>RegexpComparator</type>
  9785. <expected-output>^-chmod: chmod : mode '999' does not match the expected pattern.</expected-output>
  9786. </comparator>
  9787. </comparators>
  9788. </test>
  9789. <test> <!-- TESTED -->
  9790. <description>chmod: invalid value in octal mode of file in relative path</description>
  9791. <test-commands>
  9792. <command>-fs NAMENODE -touchz file1</command>
  9793. <command>-fs NAMENODE -chmod 999 file1</command>
  9794. </test-commands>
  9795. <cleanup-commands>
  9796. <command>-fs NAMENODE -rm file1</command>
  9797. </cleanup-commands>
  9798. <comparators>
  9799. <comparator>
  9800. <type>RegexpComparator</type>
  9801. <expected-output>^-chmod: chmod : mode '999' does not match the expected pattern.</expected-output>
  9802. </comparator>
  9803. </comparators>
  9804. </test>
  9805. <test> <!-- TESTED -->
  9806. <description>chmod: invalid value in normal mode of file in absolute path</description>
  9807. <test-commands>
  9808. <command>-fs NAMENODE -touchz /file1</command>
  9809. <command>-fs NAMENODE -chmod r+def /file1</command>
  9810. </test-commands>
  9811. <cleanup-commands>
  9812. <command>-fs NAMENODE -rm /file1</command>
  9813. </cleanup-commands>
  9814. <comparators>
  9815. <comparator>
  9816. <type>RegexpComparator</type>
  9817. <expected-output>^-chmod: chmod : mode \'r\+def\' does not match the expected pattern.</expected-output>
  9818. </comparator>
  9819. </comparators>
  9820. </test>
  9821. <test> <!-- TESTED -->
  9822. <description>chmod: invalid value in normal mode of file in relative path</description>
  9823. <test-commands>
  9824. <command>-fs NAMENODE -touchz file1</command>
  9825. <command>-fs NAMENODE -chmod r+def file1</command>
  9826. </test-commands>
  9827. <cleanup-commands>
  9828. <command>-fs NAMENODE -rm file1</command>
  9829. </cleanup-commands>
  9830. <comparators>
  9831. <comparator>
  9832. <type>RegexpComparator</type>
  9833. <expected-output>^-chmod: chmod : mode \'r\+def\' does not match the expected pattern.</expected-output>
  9834. </comparator>
  9835. </comparators>
  9836. </test>
  9837. <test> <!-- TESTED -->
  9838. <description>chmod: change permission(octal mode) of file in hdfs:// path</description>
  9839. <test-commands>
  9840. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  9841. <command>-fs NAMENODE -chmod 777 hdfs:///file1</command>
  9842. <command>-fs NAMENODE -ls hdfs:///file1</command>
  9843. </test-commands>
  9844. <cleanup-commands>
  9845. <command>-fs NAMENODE -rm hdfs:///file1</command>
  9846. </cleanup-commands>
  9847. <comparators>
  9848. <comparator>
  9849. <type>RegexpComparator</type>
  9850. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file1</expected-output>
  9851. </comparator>
  9852. </comparators>
  9853. </test>
  9854. <test> <!-- TESTED -->
  9855. <description>chmod: change permission(octal mode) of directory in hdfs:// path</description>
  9856. <test-commands>
  9857. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  9858. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
  9859. <command>-fs NAMENODE -touchz hdfs:///dir0/file0</command>
  9860. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file1</command>
  9861. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file2</command>
  9862. <command>-fs NAMENODE -chmod 777 hdfs:///dir0/dir1</command>
  9863. <command>-fs NAMENODE -ls -R hdfs:///dir0</command>
  9864. </test-commands>
  9865. <cleanup-commands>
  9866. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  9867. </cleanup-commands>
  9868. <comparators>
  9869. <comparator>
  9870. <type>RegexpComparator</type>
  9871. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1</expected-output>
  9872. </comparator>
  9873. <comparator>
  9874. <type>RegexpComparator</type>
  9875. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file1</expected-output>
  9876. </comparator>
  9877. <comparator>
  9878. <type>RegexpComparator</type>
  9879. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file2</expected-output>
  9880. </comparator>
  9881. <comparator>
  9882. <type>RegexpComparator</type>
  9883. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file0</expected-output>
  9884. </comparator>
  9885. </comparators>
  9886. </test>
  9887. <test> <!-- TESTED -->
  9888. <description>chmod: change permission(normal mode) of file in hdfs:// path</description>
  9889. <test-commands>
  9890. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  9891. <command>-fs NAMENODE -chmod a+rw hdfs:///file1</command>
  9892. <command>-fs NAMENODE -ls hdfs:///file1</command>
  9893. </test-commands>
  9894. <cleanup-commands>
  9895. <command>-fs NAMENODE -rm hdfs:///file1</command>
  9896. </cleanup-commands>
  9897. <comparators>
  9898. <comparator>
  9899. <type>RegexpComparator</type>
  9900. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file1</expected-output>
  9901. </comparator>
  9902. </comparators>
  9903. </test>
  9904. <test> <!-- TESTED -->
  9905. <description>chmod: change permission(normal mode) of directory in hdfs:// path</description>
  9906. <test-commands>
  9907. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  9908. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
  9909. <command>-fs NAMENODE -touchz hdfs:///dir0/file0</command>
  9910. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file1</command>
  9911. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file2</command>
  9912. <command>-fs NAMENODE -chmod a+rwx hdfs:///dir0/dir1</command>
  9913. <command>-fs NAMENODE -ls -R hdfs:///dir0</command>
  9914. </test-commands>
  9915. <cleanup-commands>
  9916. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  9917. </cleanup-commands>
  9918. <comparators>
  9919. <comparator>
  9920. <type>RegexpComparator</type>
  9921. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1</expected-output>
  9922. </comparator>
  9923. <comparator>
  9924. <type>RegexpComparator</type>
  9925. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file1</expected-output>
  9926. </comparator>
  9927. <comparator>
  9928. <type>RegexpComparator</type>
  9929. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file2</expected-output>
  9930. </comparator>
  9931. <comparator>
  9932. <type>RegexpComparator</type>
  9933. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file0</expected-output>
  9934. </comparator>
  9935. </comparators>
  9936. </test>
  9937. <test> <!-- TESTED -->
  9938. <description>chmod: change permission(octal mode) of directory in hdfs:// path recursively </description>
  9939. <test-commands>
  9940. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  9941. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
  9942. <command>-fs NAMENODE -touchz hdfs:///dir0/file0</command>
  9943. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file1</command>
  9944. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file2</command>
  9945. <command>-fs NAMENODE -chmod -R 777 hdfs:///dir0/dir1</command>
  9946. <command>-fs NAMENODE -ls -R hdfs:///dir0</command>
  9947. </test-commands>
  9948. <cleanup-commands>
  9949. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  9950. </cleanup-commands>
  9951. <comparators>
  9952. <comparator>
  9953. <type>RegexpComparator</type>
  9954. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1</expected-output>
  9955. </comparator>
  9956. <comparator>
  9957. <type>RegexpComparator</type>
  9958. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file1</expected-output>
  9959. </comparator>
  9960. <comparator>
  9961. <type>RegexpComparator</type>
  9962. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file2</expected-output>
  9963. </comparator>
  9964. <comparator>
  9965. <type>RegexpComparator</type>
  9966. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file0</expected-output>
  9967. </comparator>
  9968. </comparators>
  9969. </test>
  9970. <test> <!-- TESTED -->
  9971. <description>chmod: change permission(normal mode) of directory in hdfs:// path recursively</description>
  9972. <test-commands>
  9973. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  9974. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
  9975. <command>-fs NAMENODE -touchz hdfs:///dir0/file0</command>
  9976. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file1</command>
  9977. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file2</command>
  9978. <command>-fs NAMENODE -chmod -R a+rwx hdfs:///dir0/dir1</command>
  9979. <command>-fs NAMENODE -ls -R hdfs:///dir0</command>
  9980. </test-commands>
  9981. <cleanup-commands>
  9982. <command>-fs NAMENODE -rm -r hdfs:///dir0</command>
  9983. </cleanup-commands>
  9984. <comparators>
  9985. <comparator>
  9986. <type>RegexpComparator</type>
  9987. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1</expected-output>
  9988. </comparator>
  9989. <comparator>
  9990. <type>RegexpComparator</type>
  9991. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file1</expected-output>
  9992. </comparator>
  9993. <comparator>
  9994. <type>RegexpComparator</type>
  9995. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file2</expected-output>
  9996. </comparator>
  9997. <comparator>
  9998. <type>RegexpComparator</type>
  9999. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file0</expected-output>
  10000. </comparator>
  10001. </comparators>
  10002. </test>
  10003. <test> <!-- TESTED -->
  10004. <description>chmod: change permission(octal mode) of non existent file in hdfs:// path</description>
  10005. <test-commands>
  10006. <command>-fs NAMENODE -chmod 777 hdfs:///file1</command>
  10007. </test-commands>
  10008. <cleanup-commands>
  10009. <command>-fs NAMENODE -rm hdfs:///file1</command>
  10010. </cleanup-commands>
  10011. <comparators>
  10012. <comparator>
  10013. <type>RegexpComparator</type>
  10014. <expected-output>^chmod: `hdfs:///file1': No such file or directory</expected-output>
  10015. </comparator>
  10016. </comparators>
  10017. </test>
  10018. <test> <!-- TESTED -->
  10019. <description>chmod: change permission(normal mode) of non existent file in hdfs:// path</description>
  10020. <test-commands>
  10021. <command>-fs NAMENODE -chmod a+rw hdfs:///file1</command>
  10022. </test-commands>
  10023. <cleanup-commands>
  10024. <command>-fs NAMENODE -rm hdfs:///file1</command>
  10025. </cleanup-commands>
  10026. <comparators>
  10027. <comparator>
  10028. <type>RegexpComparator</type>
  10029. <expected-output>^chmod: `hdfs:///file1': No such file or directory</expected-output>
  10030. </comparator>
  10031. </comparators>
  10032. </test>
  10033. <test> <!-- TESTED -->
  10034. <description>chmod: change permission(octal mode) of multiple files in hdfs:// path using globbing</description>
  10035. <test-commands>
  10036. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  10037. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  10038. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  10039. <command>-fs NAMENODE -touchz hdfs:///file4</command>
  10040. <command>-fs NAMENODE -chmod 777 hdfs:///file* </command>
  10041. <command>-fs NAMENODE -ls -R hdfs:///file*</command>
  10042. </test-commands>
  10043. <cleanup-commands>
  10044. <command>-fs NAMENODE -rm hdfs:///file*</command>
  10045. </cleanup-commands>
  10046. <comparators>
  10047. <comparator>
  10048. <type>RegexpComparator</type>
  10049. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file1</expected-output>
  10050. </comparator>
  10051. <comparator>
  10052. <type>RegexpComparator</type>
  10053. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file2</expected-output>
  10054. </comparator>
  10055. <comparator>
  10056. <type>RegexpComparator</type>
  10057. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file3</expected-output>
  10058. </comparator>
  10059. <comparator>
  10060. <type>RegexpComparator</type>
  10061. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file4</expected-output>
  10062. </comparator>
  10063. </comparators>
  10064. </test>
  10065. <test> <!-- TESTED -->
  10066. <description>chmod: change permission(octal mode) of multiple directories in hdfs:// path using globbing</description>
  10067. <test-commands>
  10068. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  10069. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
  10070. <command>-fs NAMENODE -touchz hdfs:///dir0/file0</command>
  10071. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file1</command>
  10072. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file2</command>
  10073. <command>-fs NAMENODE -mkdir hdfs:///dir2</command>
  10074. <command>-fs NAMENODE -mkdir hdfs:///dir2/dir1</command>
  10075. <command>-fs NAMENODE -touchz hdfs:///dir2/file0</command>
  10076. <command>-fs NAMENODE -touchz hdfs:///dir2/dir1/file1</command>
  10077. <command>-fs NAMENODE -touchz hdfs:///dir2/dir1/file2</command>
  10078. <command>-fs NAMENODE -chmod 777 hdfs:///dir*</command>
  10079. <command>-fs NAMENODE -ls -R hdfs:///dir*</command>
  10080. </test-commands>
  10081. <cleanup-commands>
  10082. <command>-fs NAMENODE -rm -r hdfs:///dir*</command>
  10083. </cleanup-commands>
  10084. <comparators>
  10085. <comparator>
  10086. <type>RegexpComparator</type>
  10087. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1</expected-output>
  10088. </comparator>
  10089. <comparator>
  10090. <type>RegexpComparator</type>
  10091. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file1</expected-output>
  10092. </comparator>
  10093. <comparator>
  10094. <type>RegexpComparator</type>
  10095. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file2</expected-output>
  10096. </comparator>
  10097. <comparator>
  10098. <type>RegexpComparator</type>
  10099. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file0</expected-output>
  10100. </comparator>
  10101. <comparator>
  10102. <type>RegexpComparator</type>
  10103. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1</expected-output>
  10104. </comparator>
  10105. <comparator>
  10106. <type>RegexpComparator</type>
  10107. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1/file1</expected-output>
  10108. </comparator>
  10109. <comparator>
  10110. <type>RegexpComparator</type>
  10111. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1/file2</expected-output>
  10112. </comparator>
  10113. <comparator>
  10114. <type>RegexpComparator</type>
  10115. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/file0</expected-output>
  10116. </comparator>
  10117. </comparators>
  10118. </test>
  10119. <test> <!-- TESTED -->
  10120. <description>chmod: change permission(octal mode) of multiple files in hdfs:// path without globbing</description>
  10121. <test-commands>
  10122. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  10123. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  10124. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  10125. <command>-fs NAMENODE -touchz hdfs:///file4</command>
  10126. <command>-fs NAMENODE -chmod 777 hdfs:///file1 hdfs:///file2 hdfs:///file3 hdfs:///file4 </command>
  10127. <command>-fs NAMENODE -ls -R hdfs:///file*</command>
  10128. </test-commands>
  10129. <cleanup-commands>
  10130. <command>-fs NAMENODE -rm hdfs:///file*</command>
  10131. </cleanup-commands>
  10132. <comparators>
  10133. <comparator>
  10134. <type>RegexpComparator</type>
  10135. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file1</expected-output>
  10136. </comparator>
  10137. <comparator>
  10138. <type>RegexpComparator</type>
  10139. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file2</expected-output>
  10140. </comparator>
  10141. <comparator>
  10142. <type>RegexpComparator</type>
  10143. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file3</expected-output>
  10144. </comparator>
  10145. <comparator>
  10146. <type>RegexpComparator</type>
  10147. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file4</expected-output>
  10148. </comparator>
  10149. </comparators>
  10150. </test>
  10151. <test> <!-- TESTED -->
  10152. <description>chmod: change permission(octal mode) of multiple directories in hdfs:// path without globbing</description>
  10153. <test-commands>
  10154. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  10155. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
  10156. <command>-fs NAMENODE -touchz hdfs:///dir0/file0</command>
  10157. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file1</command>
  10158. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file2</command>
  10159. <command>-fs NAMENODE -mkdir hdfs:///dir2</command>
  10160. <command>-fs NAMENODE -mkdir hdfs:///dir2/dir1</command>
  10161. <command>-fs NAMENODE -touchz hdfs:///dir2/file0</command>
  10162. <command>-fs NAMENODE -touchz hdfs:///dir2/dir1/file1</command>
  10163. <command>-fs NAMENODE -touchz hdfs:///dir2/dir1/file2</command>
  10164. <command>-fs NAMENODE -chmod 777 hdfs:///dir0 hdfs:///dir2</command>
  10165. <command>-fs NAMENODE -ls -R hdfs:///dir*</command>
  10166. </test-commands>
  10167. <cleanup-commands>
  10168. <command>-fs NAMENODE -rm -r hdfs:///dir*</command>
  10169. </cleanup-commands>
  10170. <comparators>
  10171. <comparator>
  10172. <type>RegexpComparator</type>
  10173. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1</expected-output>
  10174. </comparator>
  10175. <comparator>
  10176. <type>RegexpComparator</type>
  10177. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file1</expected-output>
  10178. </comparator>
  10179. <comparator>
  10180. <type>RegexpComparator</type>
  10181. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file2</expected-output>
  10182. </comparator>
  10183. <comparator>
  10184. <type>RegexpComparator</type>
  10185. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file0</expected-output>
  10186. </comparator>
  10187. <comparator>
  10188. <type>RegexpComparator</type>
  10189. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1</expected-output>
  10190. </comparator>
  10191. <comparator>
  10192. <type>RegexpComparator</type>
  10193. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1/file1</expected-output>
  10194. </comparator>
  10195. <comparator>
  10196. <type>RegexpComparator</type>
  10197. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1/file2</expected-output>
  10198. </comparator>
  10199. <comparator>
  10200. <type>RegexpComparator</type>
  10201. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/file0</expected-output>
  10202. </comparator>
  10203. </comparators>
  10204. </test>
  10205. <test> <!-- TESTED -->
  10206. <description>chmod: change permission(normal mode) of multiple files in hdfs:// path using globbing</description>
  10207. <test-commands>
  10208. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  10209. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  10210. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  10211. <command>-fs NAMENODE -touchz hdfs:///file4</command>
  10212. <command>-fs NAMENODE -chmod a+rw hdfs:///file* </command>
  10213. <command>-fs NAMENODE -ls -R hdfs:///file*</command>
  10214. </test-commands>
  10215. <cleanup-commands>
  10216. <command>-fs NAMENODE -rm hdfs:///file*</command>
  10217. </cleanup-commands>
  10218. <comparators>
  10219. <comparator>
  10220. <type>RegexpComparator</type>
  10221. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file1</expected-output>
  10222. </comparator>
  10223. <comparator>
  10224. <type>RegexpComparator</type>
  10225. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file2</expected-output>
  10226. </comparator>
  10227. <comparator>
  10228. <type>RegexpComparator</type>
  10229. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file3</expected-output>
  10230. </comparator>
  10231. <comparator>
  10232. <type>RegexpComparator</type>
  10233. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file4</expected-output>
  10234. </comparator>
  10235. </comparators>
  10236. </test>
  10237. <test> <!-- TESTED -->
  10238. <description>chmod: change permission(normal mode) of multiple directories in hdfs:// path using globbing</description>
  10239. <test-commands>
  10240. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  10241. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
  10242. <command>-fs NAMENODE -touchz hdfs:///dir0/file0</command>
  10243. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file1</command>
  10244. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file2</command>
  10245. <command>-fs NAMENODE -mkdir hdfs:///dir2</command>
  10246. <command>-fs NAMENODE -mkdir hdfs:///dir2/dir1</command>
  10247. <command>-fs NAMENODE -touchz hdfs:///dir2/file0</command>
  10248. <command>-fs NAMENODE -touchz hdfs:///dir2/dir1/file1</command>
  10249. <command>-fs NAMENODE -touchz hdfs:///dir2/dir1/file2</command>
  10250. <command>-fs NAMENODE -chmod a+rwx hdfs:///dir*</command>
  10251. <command>-fs NAMENODE -ls -R hdfs:///dir*</command>
  10252. </test-commands>
  10253. <cleanup-commands>
  10254. <command>-fs NAMENODE -rm -r hdfs:///dir*</command>
  10255. </cleanup-commands>
  10256. <comparators>
  10257. <comparator>
  10258. <type>RegexpComparator</type>
  10259. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1</expected-output>
  10260. </comparator>
  10261. <comparator>
  10262. <type>RegexpComparator</type>
  10263. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file1</expected-output>
  10264. </comparator>
  10265. <comparator>
  10266. <type>RegexpComparator</type>
  10267. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file2</expected-output>
  10268. </comparator>
  10269. <comparator>
  10270. <type>RegexpComparator</type>
  10271. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file0</expected-output>
  10272. </comparator>
  10273. <comparator>
  10274. <type>RegexpComparator</type>
  10275. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1</expected-output>
  10276. </comparator>
  10277. <comparator>
  10278. <type>RegexpComparator</type>
  10279. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1/file1</expected-output>
  10280. </comparator>
  10281. <comparator>
  10282. <type>RegexpComparator</type>
  10283. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1/file2</expected-output>
  10284. </comparator>
  10285. <comparator>
  10286. <type>RegexpComparator</type>
  10287. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/file0</expected-output>
  10288. </comparator>
  10289. </comparators>
  10290. </test>
  10291. <test> <!-- TESTED -->
  10292. <description>chmod: change permission(normal mode) of multiple files in hdfs:// path without globbing</description>
  10293. <test-commands>
  10294. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  10295. <command>-fs NAMENODE -touchz hdfs:///file2</command>
  10296. <command>-fs NAMENODE -touchz hdfs:///file3</command>
  10297. <command>-fs NAMENODE -touchz hdfs:///file4</command>
  10298. <command>-fs NAMENODE -chmod a+rw hdfs:///file1 hdfs:///file2 hdfs:///file3 hdfs:///file4 </command>
  10299. <command>-fs NAMENODE -ls -R hdfs:///file*</command>
  10300. </test-commands>
  10301. <cleanup-commands>
  10302. <command>-fs NAMENODE -rm hdfs:///file*</command>
  10303. </cleanup-commands>
  10304. <comparators>
  10305. <comparator>
  10306. <type>RegexpComparator</type>
  10307. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file1</expected-output>
  10308. </comparator>
  10309. <comparator>
  10310. <type>RegexpComparator</type>
  10311. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file2</expected-output>
  10312. </comparator>
  10313. <comparator>
  10314. <type>RegexpComparator</type>
  10315. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file3</expected-output>
  10316. </comparator>
  10317. <comparator>
  10318. <type>RegexpComparator</type>
  10319. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///file4</expected-output>
  10320. </comparator>
  10321. </comparators>
  10322. </test>
  10323. <test> <!-- TESTED -->
  10324. <description>chmod: change permission(normal mode) of multiple directories in hdfs:// path without globbing</description>
  10325. <test-commands>
  10326. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  10327. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
  10328. <command>-fs NAMENODE -touchz hdfs:///dir0/file0</command>
  10329. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file1</command>
  10330. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file2</command>
  10331. <command>-fs NAMENODE -mkdir hdfs:///dir2</command>
  10332. <command>-fs NAMENODE -mkdir hdfs:///dir2/dir1</command>
  10333. <command>-fs NAMENODE -touchz hdfs:///dir2/file0</command>
  10334. <command>-fs NAMENODE -touchz hdfs:///dir2/dir1/file1</command>
  10335. <command>-fs NAMENODE -touchz hdfs:///dir2/dir1/file2</command>
  10336. <command>-fs NAMENODE -chmod a+rwx hdfs:///dir0 hdfs:///dir2</command>
  10337. <command>-fs NAMENODE -ls -R hdfs:///dir*</command>
  10338. </test-commands>
  10339. <cleanup-commands>
  10340. <command>-fs NAMENODE -rm -r hdfs:///dir*</command>
  10341. </cleanup-commands>
  10342. <comparators>
  10343. <comparator>
  10344. <type>RegexpComparator</type>
  10345. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1</expected-output>
  10346. </comparator>
  10347. <comparator>
  10348. <type>RegexpComparator</type>
  10349. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file1</expected-output>
  10350. </comparator>
  10351. <comparator>
  10352. <type>RegexpComparator</type>
  10353. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file2</expected-output>
  10354. </comparator>
  10355. <comparator>
  10356. <type>RegexpComparator</type>
  10357. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file0</expected-output>
  10358. </comparator>
  10359. <comparator>
  10360. <type>RegexpComparator</type>
  10361. <expected-output>^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1</expected-output>
  10362. </comparator>
  10363. <comparator>
  10364. <type>RegexpComparator</type>
  10365. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1/file1</expected-output>
  10366. </comparator>
  10367. <comparator>
  10368. <type>RegexpComparator</type>
  10369. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1/file2</expected-output>
  10370. </comparator>
  10371. <comparator>
  10372. <type>RegexpComparator</type>
  10373. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/file0</expected-output>
  10374. </comparator>
  10375. </comparators>
  10376. </test>
  10377. <test> <!-- TESTED -->
  10378. <description>chmod: change permission(octal mode) of multiple directories in hdfs:// path recursively using globbing</description>
  10379. <test-commands>
  10380. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  10381. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
  10382. <command>-fs NAMENODE -touchz hdfs:///dir0/file0</command>
  10383. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file1</command>
  10384. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file2</command>
  10385. <command>-fs NAMENODE -mkdir hdfs:///dir2</command>
  10386. <command>-fs NAMENODE -mkdir hdfs:///dir2/dir1</command>
  10387. <command>-fs NAMENODE -touchz hdfs:///dir2/file0</command>
  10388. <command>-fs NAMENODE -touchz hdfs:///dir2/dir1/file1</command>
  10389. <command>-fs NAMENODE -touchz hdfs:///dir2/dir1/file2</command>
  10390. <command>-fs NAMENODE -chmod -R 777 hdfs:///dir*</command>
  10391. <command>-fs NAMENODE -ls -R hdfs:///dir*</command>
  10392. </test-commands>
  10393. <cleanup-commands>
  10394. <command>-fs NAMENODE -rm -r hdfs:///dir*</command>
  10395. </cleanup-commands>
  10396. <comparators>
  10397. <comparator>
  10398. <type>RegexpComparator</type>
  10399. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1</expected-output>
  10400. </comparator>
  10401. <comparator>
  10402. <type>RegexpComparator</type>
  10403. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file1</expected-output>
  10404. </comparator>
  10405. <comparator>
  10406. <type>RegexpComparator</type>
  10407. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file2</expected-output>
  10408. </comparator>
  10409. <comparator>
  10410. <type>RegexpComparator</type>
  10411. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file0</expected-output>
  10412. </comparator>
  10413. <comparator>
  10414. <type>RegexpComparator</type>
  10415. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1</expected-output>
  10416. </comparator>
  10417. <comparator>
  10418. <type>RegexpComparator</type>
  10419. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1/file1</expected-output>
  10420. </comparator>
  10421. <comparator>
  10422. <type>RegexpComparator</type>
  10423. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1/file2</expected-output>
  10424. </comparator>
  10425. <comparator>
  10426. <type>RegexpComparator</type>
  10427. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/file0</expected-output>
  10428. </comparator>
  10429. </comparators>
  10430. </test>
  10431. <test> <!-- TESTED -->
  10432. <description>chmod: change permission(octal mode) of multiple directories in hdfs:// path recursively without globbing</description>
  10433. <test-commands>
  10434. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  10435. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
  10436. <command>-fs NAMENODE -touchz hdfs:///dir0/file0</command>
  10437. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file1</command>
  10438. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file2</command>
  10439. <command>-fs NAMENODE -mkdir hdfs:///dir2</command>
  10440. <command>-fs NAMENODE -mkdir hdfs:///dir2/dir1</command>
  10441. <command>-fs NAMENODE -touchz hdfs:///dir2/file0</command>
  10442. <command>-fs NAMENODE -touchz hdfs:///dir2/dir1/file1</command>
  10443. <command>-fs NAMENODE -touchz hdfs:///dir2/dir1/file2</command>
  10444. <command>-fs NAMENODE -chmod -R 777 hdfs:///dir0 hdfs:///dir2</command>
  10445. <command>-fs NAMENODE -ls -R hdfs:///dir*</command>
  10446. </test-commands>
  10447. <cleanup-commands>
  10448. <command>-fs NAMENODE -rm -r hdfs:///dir*</command>
  10449. </cleanup-commands>
  10450. <comparators>
  10451. <comparator>
  10452. <type>RegexpComparator</type>
  10453. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1</expected-output>
  10454. </comparator>
  10455. <comparator>
  10456. <type>RegexpComparator</type>
  10457. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file1</expected-output>
  10458. </comparator>
  10459. <comparator>
  10460. <type>RegexpComparator</type>
  10461. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file2</expected-output>
  10462. </comparator>
  10463. <comparator>
  10464. <type>RegexpComparator</type>
  10465. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file0</expected-output>
  10466. </comparator>
  10467. <comparator>
  10468. <type>RegexpComparator</type>
  10469. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1</expected-output>
  10470. </comparator>
  10471. <comparator>
  10472. <type>RegexpComparator</type>
  10473. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1/file1</expected-output>
  10474. </comparator>
  10475. <comparator>
  10476. <type>RegexpComparator</type>
  10477. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1/file2</expected-output>
  10478. </comparator>
  10479. <comparator>
  10480. <type>RegexpComparator</type>
  10481. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/file0</expected-output>
  10482. </comparator>
  10483. </comparators>
  10484. </test>
  10485. <test> <!-- TESTED -->
  10486. <description>chmod: change permission(normal mode) of multiple directories in hdfs:// path recursively using globbing</description>
  10487. <test-commands>
  10488. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  10489. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
  10490. <command>-fs NAMENODE -touchz hdfs:///dir0/file0</command>
  10491. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file1</command>
  10492. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file2</command>
  10493. <command>-fs NAMENODE -mkdir hdfs:///dir2</command>
  10494. <command>-fs NAMENODE -mkdir hdfs:///dir2/dir1</command>
  10495. <command>-fs NAMENODE -touchz hdfs:///dir2/file0</command>
  10496. <command>-fs NAMENODE -touchz hdfs:///dir2/dir1/file1</command>
  10497. <command>-fs NAMENODE -touchz hdfs:///dir2/dir1/file2</command>
  10498. <command>-fs NAMENODE -chmod -R a+rwx hdfs:///dir*</command>
  10499. <command>-fs NAMENODE -ls -R hdfs:///dir*</command>
  10500. </test-commands>
  10501. <cleanup-commands>
  10502. <command>-fs NAMENODE -rm -r hdfs:///dir*</command>
  10503. </cleanup-commands>
  10504. <comparators>
  10505. <comparator>
  10506. <type>RegexpComparator</type>
  10507. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1</expected-output>
  10508. </comparator>
  10509. <comparator>
  10510. <type>RegexpComparator</type>
  10511. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file1</expected-output>
  10512. </comparator>
  10513. <comparator>
  10514. <type>RegexpComparator</type>
  10515. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file2</expected-output>
  10516. </comparator>
  10517. <comparator>
  10518. <type>RegexpComparator</type>
  10519. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file0</expected-output>
  10520. </comparator>
  10521. <comparator>
  10522. <type>RegexpComparator</type>
  10523. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1</expected-output>
  10524. </comparator>
  10525. <comparator>
  10526. <type>RegexpComparator</type>
  10527. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1/file1</expected-output>
  10528. </comparator>
  10529. <comparator>
  10530. <type>RegexpComparator</type>
  10531. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1/file2</expected-output>
  10532. </comparator>
  10533. <comparator>
  10534. <type>RegexpComparator</type>
  10535. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/file0</expected-output>
  10536. </comparator>
  10537. </comparators>
  10538. </test>
  10539. <test> <!-- TESTED -->
  10540. <description>chmod: change permission(normal mode) of multiple directories in hdfs:// path recursively without globbing</description>
  10541. <test-commands>
  10542. <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
  10543. <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
  10544. <command>-fs NAMENODE -touchz hdfs:///dir0/file0</command>
  10545. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file1</command>
  10546. <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file2</command>
  10547. <command>-fs NAMENODE -mkdir hdfs:///dir2</command>
  10548. <command>-fs NAMENODE -mkdir hdfs:///dir2/dir1</command>
  10549. <command>-fs NAMENODE -touchz hdfs:///dir2/file0</command>
  10550. <command>-fs NAMENODE -touchz hdfs:///dir2/dir1/file1</command>
  10551. <command>-fs NAMENODE -touchz hdfs:///dir2/dir1/file2</command>
  10552. <command>-fs NAMENODE -chmod -R a+rwx hdfs:///dir0 hdfs:///dir2</command>
  10553. <command>-fs NAMENODE -ls -R hdfs:///dir*</command>
  10554. </test-commands>
  10555. <cleanup-commands>
  10556. <command>-fs NAMENODE -rm -r hdfs:///dir*</command>
  10557. </cleanup-commands>
  10558. <comparators>
  10559. <comparator>
  10560. <type>RegexpComparator</type>
  10561. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1</expected-output>
  10562. </comparator>
  10563. <comparator>
  10564. <type>RegexpComparator</type>
  10565. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file1</expected-output>
  10566. </comparator>
  10567. <comparator>
  10568. <type>RegexpComparator</type>
  10569. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/dir1/file2</expected-output>
  10570. </comparator>
  10571. <comparator>
  10572. <type>RegexpComparator</type>
  10573. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir0/file0</expected-output>
  10574. </comparator>
  10575. <comparator>
  10576. <type>RegexpComparator</type>
  10577. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1</expected-output>
  10578. </comparator>
  10579. <comparator>
  10580. <type>RegexpComparator</type>
  10581. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1/file1</expected-output>
  10582. </comparator>
  10583. <comparator>
  10584. <type>RegexpComparator</type>
  10585. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/dir1/file2</expected-output>
  10586. </comparator>
  10587. <comparator>
  10588. <type>RegexpComparator</type>
  10589. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*hdfs:///dir2/file0</expected-output>
  10590. </comparator>
  10591. </comparators>
  10592. </test>
  10593. <test> <!-- TESTED -->
  10594. <description>chmod: invalid value in octal mode of file in hdfs:// path</description>
  10595. <test-commands>
  10596. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  10597. <command>-fs NAMENODE -chmod 999 hdfs:///file1</command>
  10598. </test-commands>
  10599. <cleanup-commands>
  10600. <command>-fs NAMENODE -rm hdfs:///file1</command>
  10601. </cleanup-commands>
  10602. <comparators>
  10603. <comparator>
  10604. <type>RegexpComparator</type>
  10605. <expected-output>^-chmod: chmod : mode '999' does not match the expected pattern.</expected-output>
  10606. </comparator>
  10607. </comparators>
  10608. </test>
  10609. <test> <!-- TESTED -->
  10610. <description>chmod: invalid value in normal mode of file in hdfs:// path</description>
  10611. <test-commands>
  10612. <command>-fs NAMENODE -touchz hdfs:///file1</command>
  10613. <command>-fs NAMENODE -chmod rdef hdfs:///file1</command>
  10614. </test-commands>
  10615. <cleanup-commands>
  10616. <command>-fs NAMENODE -rm hdfs:///file1</command>
  10617. </cleanup-commands>
  10618. <comparators>
  10619. <comparator>
  10620. <type>RegexpComparator</type>
  10621. <expected-output>^-chmod: chmod : mode \'rdef\' does not match the expected pattern.</expected-output>
  10622. </comparator>
  10623. </comparators>
  10624. </test>
  10625. <!-- Tests for chmod -->
  10626. <test> <!-- TESTED -->
  10627. <description>chmod: change permission(octal mode) of file in Namenode's path</description>
  10628. <test-commands>
  10629. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  10630. <command>-fs NAMENODE -chmod 777 NAMENODE/file1</command>
  10631. <command>-fs NAMENODE -ls NAMENODE/file1</command>
  10632. </test-commands>
  10633. <cleanup-commands>
  10634. <command>-fs NAMENODE -rm NAMENODE/file1</command>
  10635. </cleanup-commands>
  10636. <comparators>
  10637. <comparator>
  10638. <type>RegexpComparator</type>
  10639. <expected-output>^-rwxrwxrwx( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file1</expected-output>
  10640. </comparator>
  10641. </comparators>
  10642. </test>
  10643. <test> <!-- TESTED -->
  10644. <description>chmod: change permission(octal mode) of directory in Namenode's path</description>
  10645. <test-commands>
  10646. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  10647. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1</command>
  10648. <command>-fs NAMENODE -touchz NAMENODE/dir0/file0</command>
  10649. <command>-fs NAMENODE -touchz NAMENODE/dir0/dir1/file1</command>
  10650. <command>-fs NAMENODE -touchz NAMENODE/dir0/dir1/file2</command>
  10651. <command>-fs NAMENODE -chmod 777 NAMENODE/dir0/dir1</command>
  10652. <command>-fs NAMENODE -ls -R NAMENODE/dir0</command>
  10653. </test-commands>
  10654. <cleanup-commands>
  10655. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  10656. </cleanup-commands>
  10657. <comparators>
  10658. <comparator>
  10659. <type>RegexpComparator</type>
  10660. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/dir1</expected-output>
  10661. </comparator>
  10662. <comparator>
  10663. <type>RegexpComparator</type>
  10664. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/dir1/file1</expected-output>
  10665. </comparator>
  10666. <comparator>
  10667. <type>RegexpComparator</type>
  10668. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/dir1/file2</expected-output>
  10669. </comparator>
  10670. <comparator>
  10671. <type>RegexpComparator</type>
  10672. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/file0</expected-output>
  10673. </comparator>
  10674. </comparators>
  10675. </test>
  10676. <test> <!-- TESTED -->
  10677. <description>chmod: change permission(normal mode) of file in Namenode's path</description>
  10678. <test-commands>
  10679. <command>-fs NAMENODE -touchz NAMENODE/file1</command>
  10680. <command>-fs NAMENODE -chmod a+rw NAMENODE/file1</command>
  10681. <command>-fs NAMENODE -ls NAMENODE/file1</command>
  10682. </test-commands>
  10683. <cleanup-commands>
  10684. <command>-fs NAMENODE -rm NAMENODE/file1</command>
  10685. </cleanup-commands>
  10686. <comparators>
  10687. <comparator>
  10688. <type>RegexpComparator</type>
  10689. <expected-output>^-rw-rw-rw-( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/file1</expected-output>
  10690. </comparator>
  10691. </comparators>
  10692. </test>
  10693. <test> <!-- TESTED -->
  10694. <description>chmod: change permission(normal mode) of directory in Namenode's path</description>
  10695. <test-commands>
  10696. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  10697. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1</command>
  10698. <command>-fs NAMENODE -touchz NAMENODE/dir0/file0</command>
  10699. <command>-fs NAMENODE -touchz NAMENODE/dir0/dir1/file1</command>
  10700. <command>-fs NAMENODE -touchz NAMENODE/dir0/dir1/file2</command>
  10701. <command>-fs NAMENODE -chmod a+rwx NAMENODE/dir0/dir1</command>
  10702. <command>-fs NAMENODE -ls -R NAMENODE/dir0</command>
  10703. </test-commands>
  10704. <cleanup-commands>
  10705. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  10706. </cleanup-commands>
  10707. <comparators>
  10708. <comparator>
  10709. <type>RegexpComparator</type>
  10710. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/dir1</expected-output>
  10711. </comparator>
  10712. <comparator>
  10713. <type>RegexpComparator</type>
  10714. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/dir1/file1</expected-output>
  10715. </comparator>
  10716. <comparator>
  10717. <type>RegexpComparator</type>
  10718. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/dir1/file2</expected-output>
  10719. </comparator>
  10720. <comparator>
  10721. <type>RegexpComparator</type>
  10722. <expected-output>^-rw-r--r--( )*1( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/file0</expected-output>
  10723. </comparator>
  10724. </comparators>
  10725. </test>
  10726. <test> <!-- TESTED -->
  10727. <description>chmod: change permission(octal mode) of directory in Namenode's path recursively </description>
  10728. <test-commands>
  10729. <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
  10730. <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1</command>
  10731. <command>-fs NAMENODE -touchz NAMENODE/dir0/file0</command>
  10732. <command>-fs NAMENODE -touchz NAMENODE/dir0/dir1/file1</command>
  10733. <command>-fs NAMENODE -touchz NAMENODE/dir0/dir1/file2</command>
  10734. <command>-fs NAMENODE -chmod -R 777 NAMENODE/dir0/dir1</command>
  10735. <command>-fs NAMENODE -ls -R NAMENODE/dir0</command>
  10736. </test-commands>
  10737. <cleanup-commands>
  10738. <command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
  10739. </cleanup-commands>
  10740. <comparators>
  10741. <comparator>
  10742. <type>RegexpComparator</type>
  10743. <expected-output>^drwxrwxrwx( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*NAMENODE/dir0/dir1</expected-output>
  10744. </comparator>
  10745. <comparator>
  10746. <type>RegexpComparat