MetaData Sharing
 
 
 
 

141 lines
3.0 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. "special": "store now"
  29. },
  30. {
  31. "title": "add tag b",
  32. "cmd": [ "modify", "+tag=bar", "+dc:creator=John-Mark Gurney", "+other=baz", "test.txt" ]
  33. },
  34. {
  35. "special": "verify store object cnt",
  36. "comment": "should have two file and two metadata and two hosts",
  37. "count": 6
  38. },
  39. {
  40. "title": "invalid meta:",
  41. "cmd": [ "search", "file", "+meta:modified" ],
  42. "stderr": "invalid meta: specification: 'meta:modified'\n",
  43. "exit": 1
  44. },
  45. {
  46. "special": "format next cmd"
  47. },
  48. {
  49. "title": "search on meta:modified",
  50. "cmd": [ "search", "file", "+meta:modified>{nowiso}" ],
  51. "stdout_re": "/test.txt\n$"
  52. },
  53. {
  54. "special": "format next cmd"
  55. },
  56. {
  57. "title": "search on meta:modified",
  58. "cmd": [ "search", "file", "+meta:modified<{nowiso}" ],
  59. "stdout_re": "/newfile.txt\n$"
  60. },
  61. {
  62. "title": "search tag bar",
  63. "cmd": [ "search", "file", "+tag=bar" ],
  64. "stdout_re": "/test.txt\n$"
  65. },
  66. {
  67. "title": "search no tag bar",
  68. "cmd": [ "search", "file", "-tag=bar" ],
  69. "stdout_re": "/newfile.txt\n$"
  70. },
  71. {
  72. "title": "search no other",
  73. "cmd": [ "search", "file", "-other" ],
  74. "stdout_re": "/newfile.txt\n$"
  75. },
  76. {
  77. "title": "add tag c",
  78. "cmd": [ "modify", "+bleh=baz", "newfile.txt" ]
  79. },
  80. {
  81. "title": "add tag d",
  82. "cmd": [ "modify", "+tag=bar", "newfile.txt" ]
  83. },
  84. {
  85. "special": "set hostid",
  86. "hostid": "ceaa4862-dd00-41ba-9787-7480ec1b2679"
  87. },
  88. {
  89. "title": "test that no mapping works",
  90. "cmd": [ "search", "file", "+other" ],
  91. "stdout_re": "^efdb5d9c-d123-4b30-aaa8-45a9ea8f6053:/.*/test.txt\n$"
  92. },
  93. {
  94. "special": "set hostid",
  95. "hostid": "efdb5d9c-d123-4b30-aaa8-45a9ea8f6053"
  96. },
  97. {
  98. "title": "host mapping works",
  99. "cmd": [ "mapping", "--create", ".", "ceaa4862-dd00-41ba-9787-7480ec1b2679:/foobar" ]
  100. },
  101. {
  102. "special": "set hostid",
  103. "hostid": "ceaa4862-dd00-41ba-9787-7480ec1b2679"
  104. },
  105. {
  106. "title": "search other, mapped properly",
  107. "cmd": [ "search", "file", "+other" ],
  108. "stdout_re": "^/foobar/test.txt\n$"
  109. },
  110. {
  111. "title": "search other, mapped properly",
  112. "cmd": [ "search", "file" ],
  113. "stdout": "/foobar/newfile.txt\n/foobar/test.txt\n"
  114. },
  115. {
  116. "title": "add tag with space",
  117. "cmd": [ "modify", "+tag=car baz", "test.txt" ]
  118. },
  119. {
  120. "title": "search tags",
  121. "cmd": [ "search", "tags", "tag" ],
  122. "stdout": "tag=bar\ntag=car baz\ntag=foo\n"
  123. },
  124. {
  125. "title": "search bogus",
  126. "cmd": [ "search", "lskdjflaskjdoijef", "tag" ],
  127. "exit": 1,
  128. "stderr": "unknown search type: 'lskdjflaskjdoijef'\n"
  129. },
  130. {
  131. "title": "search exclusion properly",
  132. "cmd": [ "search", "file", "-tag" ],
  133. "stdout": ""
  134. },
  135. {
  136. "title": "search exclusion w/ inclusion properly",
  137. "cmd": [ "search", "file", "+tag=bar", "-other" ],
  138. "stdout": "/foobar/newfile.txt\n"
  139. }
  140. ]