[ { "title": "gen ident", "cmd": [ "genident", "name=A Test User" ], "exit": 0 }, { "special": "set hostid", "hostid": "ceaa4862-dd00-41ba-9787-7480ec1b2679" }, { "title": "create host", "cmd": [ "hosts" ] }, { "special": "set hostid", "hostid": "efdb5d9c-d123-4b30-aaa8-45a9ea8f6053" }, { "title": "create host", "cmd": [ "hosts" ] }, { "title": "search --help works", "cmd": [ "search", "--help" ], "stdout_re": "^usage:.*" }, { "title": "search --unkonwn errors with usage", "cmd": [ "search", "--unkown" ], "exit": 1, "stderr_re": "^Unknown option: --unkown\nusage:.*" }, { "title": "add tag a", "cmd": [ "modify", "+tag=foo", "+dc:creator=John-Mark Gurney", "newfile.txt" ] }, { "special": "store now" }, { "title": "add tag b", "cmd": [ "modify", "+tag=bar", "+dc:creator=John-Mark Gurney", "+other=baz", "test.txt" ] }, { "special": "verify store object cnt", "comment": "should have two file and two metadata and two hosts", "count": 6 }, { "title": "invalid meta:", "cmd": [ "search", "file", "+meta:modified" ], "stderr": "invalid meta: specification: 'meta:modified'\n", "exit": 1 }, { "special": "format next cmd" }, { "title": "search on meta:modified", "cmd": [ "search", "file", "+meta:modified>{nowiso}" ], "stdout_re": "/test.txt\n$" }, { "special": "format next cmd" }, { "title": "search on meta:modified", "cmd": [ "search", "file", "+meta:modified<{nowiso}" ], "stdout_re": "/newfile.txt\n$" }, { "title": "search tag bar", "cmd": [ "search", "file", "+tag=bar" ], "stdout_re": "/test.txt\n$" }, { "title": "search no tag bar", "cmd": [ "search", "file", "-tag=bar" ], "stdout_re": "/newfile.txt\n$" }, { "title": "search no other", "cmd": [ "search", "file", "-other" ], "stdout_re": "/newfile.txt\n$" }, { "title": "add tag c", "cmd": [ "modify", "+bleh=baz", "newfile.txt" ] }, { "title": "add tag d", "cmd": [ "modify", "+tag=bar", "newfile.txt" ] }, { "special": "set hostid", "hostid": "ceaa4862-dd00-41ba-9787-7480ec1b2679" }, { "title": "test that no mapping works", "cmd": [ "search", "file", "+other" ], "stdout_re": "^efdb5d9c-d123-4b30-aaa8-45a9ea8f6053:/.*/test.txt\n$" }, { "special": "set hostid", "hostid": "efdb5d9c-d123-4b30-aaa8-45a9ea8f6053" }, { "title": "host mapping works", "cmd": [ "mapping", "--create", ".", "ceaa4862-dd00-41ba-9787-7480ec1b2679:/foobar" ] }, { "special": "set hostid", "hostid": "ceaa4862-dd00-41ba-9787-7480ec1b2679" }, { "title": "search other, mapped properly", "cmd": [ "search", "file", "+other" ], "stdout_re": "^/foobar/test.txt\n$" }, { "title": "search other, mapped properly", "cmd": [ "search", "file" ], "stdout": "/foobar/newfile.txt\n/foobar/test.txt\n" }, { "title": "add tag with space", "cmd": [ "modify", "+tag=car baz", "test.txt" ] }, { "title": "search tags", "cmd": [ "search", "tags", "tag" ], "stdout": "tag=bar\ntag=car baz\ntag=foo\n" }, { "title": "search bogus", "cmd": [ "search", "lskdjflaskjdoijef", "tag" ], "exit": 1, "stderr": "unknown search type: 'lskdjflaskjdoijef'\n" }, { "title": "search exclusion properly", "cmd": [ "search", "file", "-tag" ], "stdout": "" }, { "title": "search exclusion w/ inclusion properly", "cmd": [ "search", "file", "+tag=bar", "-other" ], "stdout": "/foobar/newfile.txt\n" }, { "title": "create a file with space in it", "special": "create file", "file": "file name space.txt", "contents": "a file name with space in it.\n" }, { "title": "create a file with newline in it", "special": "create file", "file": "new\nline'.txt", "contents": "a file name with new line in it.\n" }, { "title": "create another file with newline in it", "special": "create file", "file": "another\nnew\nline\".txt", "contents": "another file name with new line in it.\n" }, { "title": "create yet another file with newline in it", "special": "create file", "file": "yet another\nnew\nline\".txt", "contents": "yet file name with new line in it.\n" }, { "title": "add special tag", "cmd": [ "modify", "+special=tag", "file name space.txt", "new\nline'.txt", "another\nnew\nline\".txt", "yet another\nnew\nline\".txt" ] }, { "title": "without any special args, it is skipped with one warning", "cmd": [ "search", "file", "+special=tag" ], "stdout_re": "^.*file name space.txt\n$", "stderr": "Warning: file with neline in name was skipped.\n" }, { "title": "with --xargs arg", "cmd": [ "search", "--xargs", "file", "+special=tag" ], "stdout_re": "^'.*file name space.txt'\n.*new\\\\\n\"line'.txt\"\n.*another\\\\\nnew\\\\\n'line\".txt'\n'.*yet another'\\\\\nnew\\\\\n'line\".txt'\n$" } ]