|  | 
| 3 | 3 | @test "Pass when parsing a valid Kubernetes config YAML file" { | 
| 4 | 4 |   run bin/kubeval fixtures/valid.yaml | 
| 5 | 5 |   [ "$status" -eq 0 ] | 
| 6 |  | -  [ "$output" = "The file fixtures/valid.yaml contains a valid ReplicationController" ] | 
|  | 6 | +  [ "$output" = "PASS - fixtures/valid.yaml contains a valid ReplicationController" ] | 
| 7 | 7 | } | 
| 8 | 8 | 
 | 
| 9 | 9 | @test "Pass when parsing a valid Kubernetes config YAML file on stdin" { | 
| 10 | 10 |   run bash -c "cat fixtures/valid.yaml | bin/kubeval" | 
| 11 | 11 |   [ "$status" -eq 0 ] | 
| 12 |  | -  [ "$output" = "The file stdin contains a valid ReplicationController" ] | 
|  | 12 | +  [ "$output" = "PASS - stdin contains a valid ReplicationController" ] | 
| 13 | 13 | } | 
| 14 | 14 | 
 | 
| 15 | 15 | @test "Pass when parsing a valid Kubernetes config YAML file explicitly on stdin" { | 
| 16 | 16 |   run bash -c "cat fixtures/valid.yaml | bin/kubeval -" | 
| 17 | 17 |   [ "$status" -eq 0 ] | 
| 18 |  | -  [ "$output" = "The file stdin contains a valid ReplicationController" ] | 
|  | 18 | +  [ "$output" = "PASS - stdin contains a valid ReplicationController" ] | 
| 19 | 19 | } | 
| 20 | 20 | 
 | 
| 21 | 21 | @test "Pass when parsing a valid Kubernetes config JSON file" { | 
| 22 | 22 |   run bin/kubeval fixtures/valid.json | 
| 23 | 23 |   [ "$status" -eq 0 ] | 
| 24 |  | -  [ "$output" = "The file fixtures/valid.json contains a valid Deployment" ] | 
|  | 24 | +  [ "$output" = "PASS - fixtures/valid.json contains a valid Deployment" ] | 
| 25 | 25 | } | 
| 26 | 26 | 
 | 
| 27 | 27 | @test "Pass when parsing a Kubernetes file with string and integer quantities" { | 
| 28 | 28 |   run bin/kubeval fixtures/quantity.yaml | 
| 29 | 29 |   [ "$status" -eq 0 ] | 
| 30 |  | -  [ "$output" = "The file fixtures/quantity.yaml contains a valid LimitRange" ] | 
|  | 30 | +  [ "$output" = "PASS - fixtures/quantity.yaml contains a valid LimitRange" ] | 
| 31 | 31 | } | 
| 32 | 32 | 
 | 
| 33 | 33 | @test "Pass when parsing a valid Kubernetes config file with int_to_string vars" { | 
| 34 | 34 |   run bin/kubeval fixtures/int_or_string.yaml | 
| 35 | 35 |   [ "$status" -eq 0 ] | 
| 36 |  | -  [ "$output" = "The file fixtures/int_or_string.yaml contains a valid Service" ] | 
|  | 36 | +  [ "$output" = "PASS - fixtures/int_or_string.yaml contains a valid Service" ] | 
| 37 | 37 | } | 
| 38 | 38 | 
 | 
| 39 | 39 | @test "Pass when parsing a valid Kubernetes config file with null arrays" { | 
| 40 | 40 |   run bin/kubeval fixtures/null_array.yaml | 
| 41 | 41 |   [ "$status" -eq 0 ] | 
| 42 |  | -  [ "$output" = "The file fixtures/null_array.yaml contains a valid Deployment" ] | 
|  | 42 | +  [ "$output" = "PASS - fixtures/null_array.yaml contains a valid Deployment" ] | 
| 43 | 43 | } | 
| 44 | 44 | 
 | 
| 45 | 45 | @test "Pass when parsing a valid Kubernetes config file with null strings" { | 
| 46 | 46 |   run bin/kubeval fixtures/null_string.yaml | 
| 47 | 47 |   [ "$status" -eq 0 ] | 
| 48 |  | -  [ "$output" = "The file fixtures/null_string.yaml contains a valid Service" ] | 
|  | 48 | +  [ "$output" = "PASS - fixtures/null_string.yaml contains a valid Service" ] | 
| 49 | 49 | } | 
| 50 | 50 | 
 | 
| 51 | 51 | @test "Pass when parsing a multi-document config file" { | 
|  | 
| 71 | 71 | @test "Return relevant error for non-existent file" { | 
| 72 | 72 |   run bin/kubeval fixtures/not-here | 
| 73 | 73 |   [ "$status" -eq 1 ] | 
| 74 |  | -  [ $(expr "$output" : "^Could not open file") -ne 0 ] | 
|  | 74 | +  [ $(expr "$output" : "^ERR  - Could not open file") -ne 0 ] | 
| 75 | 75 | } | 
| 76 | 76 | 
 | 
| 77 | 77 | @test "Pass when parsing a blank config file" { | 
| 78 | 78 |    run bin/kubeval fixtures/blank.yaml | 
| 79 | 79 |    [ "$status" -eq 0 ] | 
| 80 |  | -   [ "$output" = "The file fixtures/blank.yaml contains an empty YAML document" ] | 
|  | 80 | +   [ "$output" = "PASS - fixtures/blank.yaml contains an empty YAML document" ] | 
| 81 | 81 |  } | 
| 82 | 82 | 
 | 
| 83 | 83 |  @test "Pass when parsing a blank config file with a comment" { | 
| 84 | 84 |    run bin/kubeval fixtures/comment.yaml | 
| 85 | 85 |    [ "$status" -eq 0 ] | 
| 86 |  | -   [ "$output" = "The file fixtures/comment.yaml contains an empty YAML document" ] | 
|  | 86 | +   [ "$output" = "PASS - fixtures/comment.yaml contains an empty YAML document" ] | 
| 87 | 87 |  } | 
| 88 | 88 | 
 | 
| 89 | 89 | @test "Return relevant error for YAML missing kind key" { | 
|  | 
| 159 | 159 | @test "Only prints a single warning when --ignore-missing-schemas is supplied" { | 
| 160 | 160 |   run bin/kubeval --ignore-missing-schemas fixtures/valid.yaml fixtures/valid.yaml | 
| 161 | 161 |   [ "$status" -eq 0 ] | 
| 162 |  | -  [[ "${lines[0]}" == *"Warning: Set to ignore missing schemas"* ]] | 
| 163 |  | -  [[ "${lines[1]}" == *"The file fixtures/valid.yaml contains a valid ReplicationController"* ]] | 
| 164 |  | -  [[ "${lines[2]}" == *"The file fixtures/valid.yaml contains a valid ReplicationController"* ]] | 
|  | 162 | +  [[ "${lines[0]}" == *"WARN - Set to ignore missing schemas"* ]] | 
|  | 163 | +  [[ "${lines[1]}" == *"PASS - fixtures/valid.yaml contains a valid ReplicationController"* ]] | 
|  | 164 | +  [[ "${lines[2]}" == *"PASS - fixtures/valid.yaml contains a valid ReplicationController"* ]] | 
| 165 | 165 | } | 
| 166 | 166 | 
 | 
| 167 | 167 | @test "Does not print warnings if --quiet is supplied" { | 
| 168 | 168 |   run bin/kubeval --ignore-missing-schemas --quiet fixtures/valid.yaml | 
| 169 | 169 |   [ "$status" -eq 0 ] | 
| 170 |  | -  [ "$output" = "The file fixtures/valid.yaml contains a valid ReplicationController" ] | 
|  | 170 | +  [ "$output" = "PASS - fixtures/valid.yaml contains a valid ReplicationController" ] | 
| 171 | 171 | } | 
0 commit comments