PageRenderTime 68ms CodeModel.GetById 27ms RepoModel.GetById 0ms 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

Large files files are truncated, but you can click here to view the full file

  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/…

Large files files are truncated, but you can click here to view the full file