Skip to content

Commit 5086831

Browse files
committed
fcos/v1_6_exp: Remove validations
1 parent 6695988 commit 5086831

File tree

2 files changed

+0
-64
lines changed

2 files changed

+0
-64
lines changed

config/fcos/v1_6_exp/validate.go

-12
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,3 @@ func (user GrubUser) Validate(c path.ContextPath) (r report.Report) {
9898
}
9999
return
100100
}
101-
102-
func (m Module) Validate(c path.ContextPath) (r report.Report) {
103-
if m.Name == "" {
104-
r.AddOnError(c.Append("name"), common.ErrSelinuxNameNotSpecified)
105-
}
106-
107-
if m.Contents.Inline == nil || *m.Contents.Inline == "" {
108-
r.AddOnError(c.Append("contents"), common.ErrSelinuxContentsNotSpecified)
109-
}
110-
111-
return r
112-
}

config/fcos/v1_6_exp/validate_test.go

-52
Original file line numberDiff line numberDiff line change
@@ -479,55 +479,3 @@ func TestValidateConfig(t *testing.T) {
479479
})
480480
}
481481
}
482-
483-
func TestValidateModule(t *testing.T) {
484-
tests := []struct {
485-
in Module
486-
out error
487-
errPath path.ContextPath
488-
}{
489-
{
490-
// valid module
491-
in: Module{
492-
Contents: Resource{
493-
Inline: util.StrToPtr("some contents"),
494-
},
495-
Name: "some name",
496-
},
497-
out: nil,
498-
errPath: path.New("yaml"),
499-
},
500-
{
501-
// contents is not specified
502-
in: Module{
503-
Contents: Resource{
504-
Inline: util.StrToPtr(""),
505-
},
506-
Name: "some name",
507-
},
508-
out: common.ErrSelinuxContentsNotSpecified,
509-
errPath: path.New("yaml", "contents"),
510-
},
511-
{
512-
// name is not specified
513-
in: Module{
514-
Name: "",
515-
Contents: Resource{
516-
Inline: util.StrToPtr("some contents"),
517-
},
518-
},
519-
out: common.ErrSelinuxNameNotSpecified,
520-
errPath: path.New("yaml", "name"),
521-
},
522-
}
523-
524-
for i, test := range tests {
525-
t.Run(fmt.Sprintf("validate %d", i), func(t *testing.T) {
526-
actual := test.in.Validate(path.New("yaml"))
527-
baseutil.VerifyReport(t, test.in, actual)
528-
expected := report.Report{}
529-
expected.AddOnError(test.errPath, test.out)
530-
assert.Equal(t, expected, actual, "bad report")
531-
})
532-
}
533-
}

0 commit comments

Comments
 (0)