[ { "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 duplicate ms:tag's", "cmd": [ "modify", "+ms:tag=foo", "+ms:tag=foo", "newfile.txt" ] }, { "title": "but dup tags are not dup'd", "cmd": [ "list", "newfile.txt" ], "stdout_re": "dc:creator:\tJohn-Mark Gurney\nhashes:\tsha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\nms:tag:\tfoo\nsig:\t.*\ntag:\t\n" }, { "title": "drop ms:tag", "cmd": [ "modify", "-ms:tag=foo", "newfile.txt" ] }, { "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 }, { "title": "that two files can be tagged at once", "cmd": [ "modify", "+random=", "--", "t/newfile.txt", "test.txt" ] }, { "title": "that two files can be un-tagged at once", "cmd": [ "modify", "-random=", "t/newfile.txt", "test.txt" ] }, { "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: file not found: 'modified=foo', or invalid tag specification.\n" }, { "special": "iter is unique" }, { "title": "dump is correct", "cmd": [ "dump" ], "exit": 0, "stdout_check": [ { "name": "Changed Name", "type": "identity" }, { "filename": "newfile.txt", "hashes": [ "sha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c" ], "size": 19, "type": "file" }, { "foo": [ "bar=baz" ], "hashes": [ "sha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c" ], "type": "metadata" }, { "filename": "test.txt", "hashes": [ "sha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c" ], "size": 19, "type": "file" }, { "filename": "newfile.txt", "hashes": [ "sha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c" ], "size": 19, "type": "file" }, { "filename": "newfile.txt", "hashes": [ "sha512:b0551b2fb5d045a74d36a08ac49aea66790ea4fb5e84f9326a32db44fc78ca0676e65a8d1f0d98f62589eeaef105f303c81f07f3f862ad3bace7960fe59de4d5" ], "size": 17, "type": "file" } ] }, { "title": "that import can be done", "cmd": [ "import" ], "stdin": "{\"created_by_ref\": \"e7ad5ea1-1203-4951-9dca-ec852a7b8166\", \"foo\": [\"bar=baz\"], \"hashes\": [\"sha512:90f8342520f0ac57fb5a779f5d331c2fa87aa40f8799940257f9ba619940951e67143a8d746535ed0284924b2b7bc1478f095198800ba96d01847d7b56ca465c\"], \"modified\": \"2022-08-21T00:13:51.245871Z\", \"sig\": \"g7k4plXjzz9y8YwJM2ncCIxaqlBpdbITPvKlDtfO7LSFmbZ-qcj0M0lN9h8twNU-n163dNsDGmQA4_s8pJB0liBHDwkjpYQvxfeztQDWNaVN7Xnh2MOj-wBzUbLTVnsJULXwVQrUjngzWjjGQ3jy6gwA\", \"tag\": [\"\"], \"type\": \"metadata\", \"uuid\": \"25ec10e6-c3d0-4363-a762-899dade7f93c\"}\n{\"created_by_ref\": \"2de7a389-410c-4755-8c62-f3254c7e971e\", \"dir\": \"\", \"filename\": \"FreeBSD-14.0-CURRENT-arm64-aarch64-ROCK64-20220331-d53927b0bae-254105.img.xz\", \"hashes\": [\"sha512:3eba2aa09a79fd7adec32ace93c6725e75b91a55192b5bfa827b893fae1c2cdbc040e282138387797f245c1f27da5e8ff7a02f59ff75c73b3d999d1e0a8752ad\"], \"id\": \"d9e8fc1a-9794-5e70-b67b-11d708ec8947\", \"modified\": \"2022-08-02T07:52:50.216428Z\", \"mtime\": \"2022-03-31T10:15:14.000000Z\", \"sig\": \"F3Ch1BQB57RAgFNKNF5btCRZS3jFmafhvcdoWuu6WHo5JzyhuQ7jNvZkv4tzgWqlMfPecLJMMmSAMcwqorykDWi854ZfKUm3F-JOTk8R7qRKdHd23rwVGDEXtVHv-kynkh8WemPsfc2V1HT8JKG9NhwA\", \"size\": 551750948, \"type\": \"file\", \"uuid\": \"89544934-6ed9-46ca-b8d0-77c5209f798d\"}\n" }, { "special": "verify store object cnt", "comment": "and the objects were imported", "count": 7 }, { "title": "than an object can be dropped", "cmd": [ "drop", "25ec10e6-c3d0-4363-a762-899dade7f93c" ] }, { "special": "verify store object cnt", "comment": "and the object was dropped", "count": 6 }, { "title": "than an object can be dropped", "cmd": [ "drop", "89544934-6ed9-46ca-b8d0-77c5209f798d" ] }, { "special": "verify store object cnt", "comment": "and the object was dropped", "count": 5 } ]