|
- [
- {
- "title": "Test no ident",
- "cmd": [ "list", "afile" ],
- "exit": 1,
- "stderr": "ERROR: Identity not created, create w/ genident.\n"
- },
- {
- "title": "gen ident",
- "cmd": [ "genident", "name=A Test User" ],
- "exit": 0
- },
- {
- "title": "gen ident",
- "cmd": [ "genident", "name=A Test User" ],
- "exit": 1,
- "stderr": "Error: Identity already created.\n"
- },
- {
- "title": "print ident",
- "cmd": [ "ident" ],
- "comment": "XXX - expand modified, pubkey and sig, and fix to base58 encode",
- "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",
- "exit": 0
- },
- {
- "title": "update ident",
- "cmd": [ "ident", "name=Changed Name" ],
- "exit": 0
- },
- {
- "title": "ident updated",
- "cmd": [ "ident" ],
- "comment": "create vars store bindings between tests?",
- "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",
- "exit": 0
- },
- {
- "title": "pub key is base58 encoded",
- "cmd": [ "pubkey" ],
- "stdout_re": "^[1-9A-HJ-NP-Za-km-z]+\n$",
- "exit": 0
- },
- {
- "title": "Test file with no tag",
- "cmd": [ "list", "newfile.txt" ],
- "exit": 1,
- "stderr": "ERROR: file not found: 'newfile.txt'\n"
- },
- {
- "title": "invalid tag",
- "cmd": [ "modify", "+tag", "newfile.txt" ],
- "exit": 1,
- "stderr": "ERROR: invalid tag, needs an \"=\".\n"
- },
- {
- "title": "add tag",
- "cmd": [ "modify", "+tag=", "+dc:creator=John-Mark Gurney", "newfile.txt" ]
- },
- {
- "special": "verify store object cnt",
- "comment": "should only have one file and one metadata",
- "count": 2
- },
- {
- "title": "verify first tags are present",
- "cmd": [ "list", "newfile.txt" ],
- "stdout_re": "dc:creator:\tJohn-Mark Gurney\nhashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
- },
- {
- "title": "add tag",
- "cmd": [ "modify", "+dc:creator=Another user", "newfile.txt" ]
- },
- {
- "title": "another dc:creator tag is present",
- "cmd": [ "list", "newfile.txt" ],
- "stdout_re": "dc:creator:\tAnother user\ndc:creator:\tJohn-Mark Gurney\nhashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
- },
- {
- "title": "remove specific tag",
- "cmd": [ "modify", "-dc:creator=Another user", "newfile.txt" ]
- },
- {
- "title": "another dc:creator tag is present",
- "cmd": [ "list", "newfile.txt" ],
- "stdout_re": "dc:creator:\tJohn-Mark Gurney\nhashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
- },
- {
- "title": "remove all dc:creator tags",
- "cmd": [ "modify", "-dc:creator", "newfile.txt" ]
- },
- {
- "title": "that all dc:creator tags are removed",
- "cmd": [ "list", "newfile.txt" ],
- "stdout_re": "hashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
- },
- {
- "title": "tag value w/ equals",
- "cmd": [ "modify", "+foo=bar=baz", "newfile.txt" ]
- },
- {
- "title": "print file",
- "cmd": [ "list", "newfile.txt" ],
- "stdout_re": "foo:\tbar=baz\nhashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
- },
- {
- "title": "test file is not present",
- "cmd": [ "list", "test.txt" ],
- "exit": 1,
- "stderr": "ERROR: file not found: 'test.txt'\n"
- },
- {
- "special": "copy newfile.txt to test.txt"
- },
- {
- "title": "copied file now has same metadata",
- "cmd": [ "list", "test.txt" ],
- "stdout_re": "foo:\tbar=baz\nhashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
- },
- {
- "special": "verify store object cnt",
- "comment": "should have two file and one metadata",
- "count": 3
- },
- {
- "special": "change newfile.txt"
- },
- {
- "title": "newfile file is now not present",
- "cmd": [ "list", "newfile.txt" ],
- "exit": 1,
- "stderr": "ERROR: file not found: 'newfile.txt'\n"
- },
- {
- "title": "old file still has same metadata",
- "cmd": [ "list", "test.txt" ],
- "stdout_re": "foo:\tbar=baz\nhashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
- },
- {
- "special": "verify store object cnt",
- "comment": "should have two file and one metadata",
- "count": 3
- },
- {
- "title": "test.txt in subdir t has same metadata",
- "cmd": [ "list", "t/newfile.txt" ],
- "stdout_re": "foo:\tbar=baz\nhashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
- },
- {
- "special": "verify store object cnt",
- "comment": "and a obj was created for subdir",
- "count": 4
- },
- {
- "special": "set hostid",
- "comment": "and that a modified hostid",
- "hostid": "ceaa4862-dd00-41ba-9787-7480ec1b2679"
- },
- {
- "title": "test.txt in subdir t has same metadata",
- "cmd": [ "list", "t/newfile.txt" ],
- "stdout_re": "foo:\tbar=baz\nhashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nsig:\t.*\ntag:\t\n"
- },
- {
- "special": "verify store object cnt",
- "comment": "and a obj was created for the new host",
- "count": 5
- },
- {
- "title": "a common tag is disallowed",
- "cmd": [ "modify", "+modified=foo", "test.txt" ],
- "exit": 1,
- "stderr": "ERROR: invalid tag: ['modified'].\n"
- },
- {
- "title": "must be a + or -",
- "cmd": [ "modify", "modified=foo", "test.txt" ],
- "exit": 1,
- "stderr": "ERROR: tag needs to start with a \"+\" (add) or a \"-\" (remove).\n"
- },
- {
- "skip": 1,
- "title": "dump is correct",
- "cmd": [ "dump" ],
- "exit": 0,
- "stdout": "ERROR: tag needs to start with a \"+\" (add) or a \"-\" (remove).\n"
- }
- ]
|