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.
 
 
 
 

121 lines
2.6 KiB

  1. [
  2. {
  3. "title": "gen ident",
  4. "cmd": [ "genident", "name=A Test User" ],
  5. "exit": 0
  6. },
  7. {
  8. "special": "set hostid",
  9. "hostid": "ceaa4862-dd00-41ba-9787-7480ec1b2679"
  10. },
  11. {
  12. "title": "create host",
  13. "cmd": [ "hosts" ]
  14. },
  15. {
  16. "special": "set hostid",
  17. "hostid": "efdb5d9c-d123-4b30-aaa8-45a9ea8f6053"
  18. },
  19. {
  20. "title": "create host",
  21. "cmd": [ "hosts" ]
  22. },
  23. {
  24. "title": "add tag a",
  25. "cmd": [ "modify", "+tag=foo", "+dc:creator=John-Mark Gurney", "newfile.txt" ]
  26. },
  27. {
  28. "title": "add tag b",
  29. "cmd": [ "modify", "+tag=bar", "+dc:creator=John-Mark Gurney", "+other=baz", "test.txt" ]
  30. },
  31. {
  32. "special": "verify store object cnt",
  33. "comment": "should have two file and two metadata and two hosts",
  34. "count": 6
  35. },
  36. {
  37. "title": "search tag foo",
  38. "cmd": [ "search", "file", "+tag=foo" ],
  39. "stdout_re": "/newfile.txt\n$"
  40. },
  41. {
  42. "title": "search tag bar",
  43. "cmd": [ "search", "file", "+tag=bar" ],
  44. "stdout_re": "/test.txt\n$"
  45. },
  46. {
  47. "title": "search no tag bar",
  48. "cmd": [ "search", "file", "-tag=bar" ],
  49. "stdout_re": "/newfile.txt\n$"
  50. },
  51. {
  52. "title": "search no other",
  53. "cmd": [ "search", "file", "-other" ],
  54. "stdout_re": "/newfile.txt\n$"
  55. },
  56. {
  57. "title": "add tag c",
  58. "cmd": [ "modify", "+bleh=baz", "newfile.txt" ]
  59. },
  60. {
  61. "title": "add tag d",
  62. "cmd": [ "modify", "+tag=bar", "newfile.txt" ]
  63. },
  64. {
  65. "special": "set hostid",
  66. "hostid": "ceaa4862-dd00-41ba-9787-7480ec1b2679"
  67. },
  68. {
  69. "title": "test that no mapping works",
  70. "cmd": [ "search", "file", "+other" ],
  71. "stdout_re": "^efdb5d9c-d123-4b30-aaa8-45a9ea8f6053:/.*/test.txt\n$"
  72. },
  73. {
  74. "special": "set hostid",
  75. "hostid": "efdb5d9c-d123-4b30-aaa8-45a9ea8f6053"
  76. },
  77. {
  78. "title": "host mapping works",
  79. "cmd": [ "mapping", "--create", ".", "ceaa4862-dd00-41ba-9787-7480ec1b2679:/foobar" ]
  80. },
  81. {
  82. "special": "set hostid",
  83. "hostid": "ceaa4862-dd00-41ba-9787-7480ec1b2679"
  84. },
  85. {
  86. "title": "search other, mapped properly",
  87. "cmd": [ "search", "file", "+other" ],
  88. "stdout_re": "^/foobar/test.txt\n$"
  89. },
  90. {
  91. "title": "search other, mapped properly",
  92. "cmd": [ "search", "file" ],
  93. "stdout": "/foobar/newfile.txt\n/foobar/test.txt\n"
  94. },
  95. {
  96. "title": "add tag with space",
  97. "cmd": [ "modify", "+tag=car baz", "test.txt" ]
  98. },
  99. {
  100. "title": "search tags",
  101. "cmd": [ "search", "tags", "tag" ],
  102. "stdout": "tag=bar\ntag=car baz\ntag=foo\n"
  103. },
  104. {
  105. "title": "search bogus",
  106. "cmd": [ "search", "lskdjflaskjdoijef", "tag" ],
  107. "exit": 1,
  108. "stderr": "unknown search type: 'lskdjflaskjdoijef'\n"
  109. },
  110. {
  111. "title": "search exclusion properly",
  112. "cmd": [ "search", "file", "-tag" ],
  113. "stdout": ""
  114. },
  115. {
  116. "title": "search exclusion w/ inclusion properly",
  117. "cmd": [ "search", "file", "+tag=bar", "-other" ],
  118. "stdout": "/foobar/newfile.txt\n"
  119. }
  120. ]