@@ -19,6 +19,14 @@ const (
19
19
20
20
var errLinterFailed = errors .New ("linter failed" )
21
21
22
+ type VerificationLevel = string
23
+
24
+ const (
25
+ VerificationLevelReadyForTesting VerificationLevel = "ready_for_testing"
26
+ VerificationLevelCommunityTested VerificationLevel = "community_tested"
27
+ VerificationLevelVerified VerificationLevel = "verified"
28
+ )
29
+
22
30
type vendorID = string
23
31
24
32
type Vendor struct {
@@ -36,9 +44,10 @@ type Device struct {
36
44
}
37
45
38
46
type BlueprintOption struct {
39
- Blueprint yaml.Node `yaml:"blueprint"`
40
- DisplayName yaml.Node `yaml:"display_name"`
41
- Description yaml.Node `yaml:"description"`
47
+ Blueprint yaml.Node `yaml:"blueprint"`
48
+ DisplayName yaml.Node `yaml:"display_name"`
49
+ Description yaml.Node `yaml:"description"`
50
+ VerificationLevel yaml.Node `yaml:"verification_level"`
42
51
}
43
52
44
53
func main () {
@@ -280,6 +289,23 @@ func validateBlueprintOptions(name string, node yaml.Node) (bool, error) {
280
289
return false , err
281
290
}
282
291
292
+ if ! checkRequiredAndNotEmpty (name + ".verification_level" , opt .VerificationLevel ) {
293
+ return false , err
294
+ }
295
+
296
+ switch opt .VerificationLevel .Value {
297
+ case VerificationLevelVerified ,
298
+ VerificationLevelReadyForTesting ,
299
+ VerificationLevelCommunityTested :
300
+ default :
301
+ logDeviceWarning (
302
+ opt .VerificationLevel .Line ,
303
+ opt .VerificationLevel .Column ,
304
+ "invalid value verification_level should be only verified, community_tested or ready_for_testing" ,
305
+ )
306
+ return false , nil
307
+ }
308
+
283
309
if len (opts ) > 1 {
284
310
if ! checkRequiredAndNotEmpty (name + ".display_name" , opt .DisplayName ) {
285
311
return false , nil
0 commit comments