20831: Revert making IsAdmin and IsInvited a pointer
[arvados.git] / sdk / go / arvados / vocabulary_test.go
index 84b9bf2295e62e6025e0c6f03847c4d3e666a9eb..af62833a312cab08c6d63d46e695c8ce96c2e5a3 100644 (file)
@@ -230,14 +230,17 @@ func (s *VocabularySuite) TestNewVocabulary(c *check.C) {
                        true, "",
                        &Vocabulary{
                                reservedTagKeys: map[string]bool{
-                                       "type":                  true,
-                                       "template_uuid":         true,
-                                       "groups":                true,
-                                       "username":              true,
-                                       "image_timestamp":       true,
+                                       "container_request":     true,
+                                       "container_uuid":        true,
+                                       "cwl_input":             true,
+                                       "cwl_output":            true,
                                        "docker-image-repo-tag": true,
                                        "filters":               true,
-                                       "container_request":     true,
+                                       "groups":                true,
+                                       "image_timestamp":       true,
+                                       "template_uuid":         true,
+                                       "type":                  true,
+                                       "username":              true,
                                },
                                StrictTags: false,
                                Tags: map[string]VocabularyTag{
@@ -298,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