MetaData Sharing
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

189 lines
6.0 KiB

  1. [
  2. {
  3. "title": "Test no ident",
  4. "cmd": [ "list", "afile" ],
  5. "exit": 1,
  6. "stderr": "ERROR: Identity not created, create w/ genident.\n"
  7. },
  8. {
  9. "title": "gen ident",
  10. "cmd": [ "genident", "name=A Test User" ],
  11. "exit": 0
  12. },
  13. {
  14. "title": "gen ident",
  15. "cmd": [ "genident", "name=A Test User" ],
  16. "exit": 1,
  17. "stderr": "Error: Identity already created.\n"
  18. },
  19. {
  20. "title": "print ident",
  21. "cmd": [ "ident" ],
  22. "comment": "XXX - expand modified, pubkey and sig, and fix to base58 encode",
  23. "stdout_re": "^type:\tidentity\nuuid:\t[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\nmodified:\t[0-9]{4,}-[01][0-9]-[0-3][0-9] .*\nname:\tA Test User\npubkey:\t.*\nsig:\t.*\n",
  24. "exit": 0
  25. },
  26. {
  27. "title": "update ident",
  28. "cmd": [ "ident", "name=Changed Name" ],
  29. "exit": 0
  30. },
  31. {
  32. "title": "ident updated",
  33. "cmd": [ "ident" ],
  34. "comment": "create vars store bindings between tests?",
  35. "stdout_re": "^type:\tidentity\nuuid:\t[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\nmodified:\t[0-9]{4,}-[01][0-9]-[0-3][0-9] .*\nname:\tChanged Name\npubkey:\t.*\nsig:\t.*\n",
  36. "exit": 0
  37. },
  38. {
  39. "title": "pub key is base58 encoded",
  40. "cmd": [ "pubkey" ],
  41. "stdout_re": "^[1-9A-HJ-NP-Za-km-z]+\n$",
  42. "exit": 0
  43. },
  44. {
  45. "title": "Test file with no tag",
  46. "cmd": [ "list", "newfile.txt" ],
  47. "exit": 1,
  48. "stderr": "ERROR: file not found: 'newfile.txt'\n"
  49. },
  50. {
  51. "title": "invalid tag",
  52. "cmd": [ "modify", "+tag", "newfile.txt" ],
  53. "exit": 1,
  54. "stderr": "ERROR: invalid tag, needs an \"=\".\n"
  55. },
  56. {
  57. "title": "add tag",
  58. "cmd": [ "modify", "+tag=", "+dc:creator=John-Mark Gurney", "newfile.txt" ]
  59. },
  60. {
  61. "special": "verify store object cnt",
  62. "comment": "should only have one file and one metadata",
  63. "count": 2
  64. },
  65. {
  66. "title": "verify first tags are present",
  67. "cmd": [ "list", "newfile.txt" ],
  68. "stdout_re": "dc:creator:\tJohn-Mark Gurney\nhashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
  69. },
  70. {
  71. "title": "add tag",
  72. "cmd": [ "modify", "+dc:creator=Another user", "newfile.txt" ]
  73. },
  74. {
  75. "title": "another dc:creator tag is present",
  76. "cmd": [ "list", "newfile.txt" ],
  77. "stdout_re": "dc:creator:\tAnother user\ndc:creator:\tJohn-Mark Gurney\nhashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
  78. },
  79. {
  80. "title": "remove specific tag",
  81. "cmd": [ "modify", "-dc:creator=Another user", "newfile.txt" ]
  82. },
  83. {
  84. "title": "another dc:creator tag is present",
  85. "cmd": [ "list", "newfile.txt" ],
  86. "stdout_re": "dc:creator:\tJohn-Mark Gurney\nhashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
  87. },
  88. {
  89. "title": "remove all dc:creator tags",
  90. "cmd": [ "modify", "-dc:creator", "newfile.txt" ]
  91. },
  92. {
  93. "title": "that all dc:creator tags are removed",
  94. "cmd": [ "list", "newfile.txt" ],
  95. "stdout_re": "hashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
  96. },
  97. {
  98. "title": "tag value w/ equals",
  99. "cmd": [ "modify", "+foo=bar=baz", "newfile.txt" ]
  100. },
  101. {
  102. "title": "print file",
  103. "cmd": [ "list", "newfile.txt" ],
  104. "stdout_re": "foo:\tbar=baz\nhashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
  105. },
  106. {
  107. "title": "test file is not present",
  108. "cmd": [ "list", "test.txt" ],
  109. "exit": 1,
  110. "stderr": "ERROR: file not found: 'test.txt'\n"
  111. },
  112. {
  113. "special": "copy newfile.txt to test.txt"
  114. },
  115. {
  116. "title": "copied file now has same metadata",
  117. "cmd": [ "list", "test.txt" ],
  118. "stdout_re": "foo:\tbar=baz\nhashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
  119. },
  120. {
  121. "special": "verify store object cnt",
  122. "comment": "should have two file and one metadata",
  123. "count": 3
  124. },
  125. {
  126. "special": "change newfile.txt"
  127. },
  128. {
  129. "title": "newfile file is now not present",
  130. "cmd": [ "list", "newfile.txt" ],
  131. "exit": 1,
  132. "stderr": "ERROR: file not found: 'newfile.txt'\n"
  133. },
  134. {
  135. "title": "old file still has same metadata",
  136. "cmd": [ "list", "test.txt" ],
  137. "stdout_re": "foo:\tbar=baz\nhashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
  138. },
  139. {
  140. "special": "verify store object cnt",
  141. "comment": "should have two file and one metadata",
  142. "count": 3
  143. },
  144. {
  145. "title": "test.txt in subdir t has same metadata",
  146. "cmd": [ "list", "t/newfile.txt" ],
  147. "stdout_re": "foo:\tbar=baz\nhashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
  148. },
  149. {
  150. "special": "verify store object cnt",
  151. "comment": "and a obj was created for subdir",
  152. "count": 4
  153. },
  154. {
  155. "special": "set hostid",
  156. "comment": "and that a modified hostid",
  157. "hostid": "ceaa4862-dd00-41ba-9787-7480ec1b2679"
  158. },
  159. {
  160. "title": "test.txt in subdir t has same metadata",
  161. "cmd": [ "list", "t/newfile.txt" ],
  162. "stdout_re": "foo:\tbar=baz\nhashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
  163. },
  164. {
  165. "special": "verify store object cnt",
  166. "comment": "and a obj was created for the new host",
  167. "count": 5
  168. },
  169. {
  170. "title": "a common tag is disallowed",
  171. "cmd": [ "modify", "+modified=foo", "test.txt" ],
  172. "exit": 1,
  173. "stderr": "ERROR: invalid tag: ['modified'].\n"
  174. },
  175. {
  176. "title": "must be a + or -",
  177. "cmd": [ "modify", "modified=foo", "test.txt" ],
  178. "exit": 1,
  179. "stderr": "ERROR: tag needs to start with a \"+\" (add) or a \"-\" (remove).\n"
  180. },
  181. {
  182. "skip": 1,
  183. "title": "dump is correct",
  184. "cmd": [ "dump" ],
  185. "exit": 0,
  186. "stdout": "ERROR: tag needs to start with a \"+\" (add) or a \"-\" (remove).\n"
  187. }
  188. ]