MetaData Sharing
 
 
 
 

176 lines
5.7 KiB

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