Merge branch '18790-log-client'
[arvados.git] / sdk / go / arvados / vocabulary_test.go
index c9e9d7b0dfbc8e3b5ce899a4a672bc0c43b768ce..af62833a312cab08c6d63d46e695c8ce96c2e5a3 100644 (file)
@@ -231,6 +231,7 @@ func (s *VocabularySuite) TestNewVocabulary(c *check.C) {
                        &Vocabulary{
                                reservedTagKeys: map[string]bool{
                                        "container_request":     true,
+                                       "container_uuid":        true,
                                        "cwl_input":             true,
                                        "cwl_output":            true,
                                        "docker-image-repo-tag": true,
@@ -300,6 +301,37 @@ func (s *VocabularySuite) TestNewVocabulary(c *check.C) {
        }
 }
 
+func (s *VocabularySuite) TestValidSystemProperties(c *check.C) {
+       s.testVoc.StrictTags = true
+       properties := map[string]interface{}{
+               "arv:gitBranch": "main",
+               "arv:OK":        true,
+               "arv:cost":      123,
+       }
+       c.Check(s.testVoc.Check(properties), check.IsNil)
+}
+
+func (s *VocabularySuite) TestSystemPropertiesPrefixTypo(c *check.C) {
+       s.testVoc.StrictTags = true
+       for _, key := range []string{
+               // Extra characters in prefix
+               "arv :foo",
+               " arv:foo",
+               // Wrong punctuation
+               "arv.foo",
+               "arv-foo",
+               "arv_foo",
+               // Wrong case
+               "Arv:foo",
+               // Wrong word
+               "arvados",
+               "arvados:foo",
+       } {
+               properties := map[string]interface{}{key: "value"}
+               c.Check(s.testVoc.Check(properties), check.NotNil)
+       }
+}
+
 func (s *VocabularySuite) TestValidationErrors(c *check.C) {
        tests := []struct {
                name       string