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.
 
 
 
 

141 lines
4.6 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": "change newfile.txt"
  116. },
  117. {
  118. "title": "newfile file is now not present",
  119. "cmd": [ "list", "newfile.txt" ],
  120. "exit": 1,
  121. "stderr": "ERROR: file not found: 'newfile.txt'\n"
  122. },
  123. {
  124. "title": "old file still has same metadata",
  125. "cmd": [ "list", "test.txt" ],
  126. "stdout_re": "foo:\tbar=baz\nhashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
  127. },
  128. {
  129. "title": "a common tag is disallowed",
  130. "cmd": [ "modify", "+modified=foo", "test.txt" ],
  131. "exit": 1,
  132. "stderr": "ERROR: invalid tag: ['modified'].\n"
  133. },
  134. {
  135. "title": "must be a + or -",
  136. "cmd": [ "modify", "modified=foo", "test.txt" ],
  137. "exit": 1,
  138. "stderr": "ERROR: tag needs to start with a \"+\" (add) or a \"-\" (remove).\n"
  139. }
  140. ]