|
1 | | -schemaVersion: '2.0.0' |
| 1 | +--- |
| 2 | + |
| 3 | +schemaVersion: 2.0.0 |
| 4 | + |
2 | 5 | commandTests: |
3 | | - - name: "git" |
4 | | - command: "git" |
5 | | - args: ["--version"] |
6 | | - expectedOutput: ["^git version 2\\.[0-9]+\\.[0-9]+\\n$"] |
7 | | - |
8 | | - - name: "pre-commit" |
9 | | - command: "pre-commit" |
10 | | - args: ["-V"] |
11 | | - expectedOutput: ["^pre-commit ([0-9]+\\.){2}[0-9]+\\n$"] |
12 | | - |
13 | | - - name: "gcc" |
14 | | - command: "gcc" |
15 | | - args: ["--version"] |
16 | | - expectedOutput: ["^gcc \\(Alpine 12\\."] |
17 | | - |
18 | | - - name: "checkov" |
19 | | - command: "checkov" |
20 | | - args: ["--version"] |
21 | | - expectedOutput: ["^([0-9]+\\.){2}[0-9]+\\n$"] |
22 | | - |
23 | | - - name: "infracost" |
24 | | - command: "infracost" |
25 | | - args: ["--version"] |
26 | | - expectedOutput: ["^Infracost v([0-9]+\\.){2}[0-9]+"] |
27 | | - |
28 | | - - name: "opentofu" |
29 | | - command: "tofu" |
30 | | - args: ["-version"] |
31 | | - expectedOutput: ["^OpenTofu v([0-9]+\\.){2}[0-9]+\\n"] |
32 | | - |
33 | | - - name: "terraform" |
34 | | - command: "terraform" |
35 | | - args: ["-version"] |
36 | | - expectedOutput: ["^Terraform v([0-9]+\\.){2}[0-9]+\\n"] |
37 | | - |
38 | | - - name: "terraform-docs" |
39 | | - command: "terraform-docs" |
40 | | - args: ["--version"] |
41 | | - expectedOutput: ["^terraform-docs version v([0-9]+\\.){2}[0-9]+ [a-z0-9]+"] |
42 | | - |
43 | | - - name: "terragrunt" |
44 | | - command: "terragrunt" |
45 | | - args: ["--version"] |
46 | | - expectedOutput: ["^terragrunt version v([0-9]+\\.){2}[0-9]+\\n$"] |
47 | | - |
48 | | - - name: "terrascan" |
49 | | - command: "terrascan" |
50 | | - args: [ "version" ] |
51 | | - expectedOutput: [ "^version: v([0-9]+\\.){2}[0-9]+\\n$" ] |
52 | | - |
53 | | - - name: "tflint" |
54 | | - command: "tflint" |
55 | | - args: [ "--version" ] |
56 | | - expectedOutput: [ "TFLint version ([0-9]+\\.){2}[0-9]+\\n" ] |
57 | | - |
58 | | - - name: "tfsec" |
59 | | - command: "tfsec" |
60 | | - args: [ "--version" ] |
61 | | - expectedOutput: [ "([0-9]+\\.){2}[0-9]+\\n$" ] |
62 | | - |
63 | | - - name: "trivy" |
64 | | - command: "trivy" |
65 | | - args: [ "--version" ] |
66 | | - expectedOutput: [ "Version: ([0-9]+\\.){2}[0-9]+\\n" ] |
67 | | - |
68 | | - - name: "tfupdate" |
69 | | - command: "tfupdate" |
70 | | - args: [ "--version" ] |
71 | | - expectedOutput: [ "([0-9]+\\.){2}[0-9]+\\n$" ] |
72 | | - |
73 | | - - name: "hcledit" |
74 | | - command: "hcledit" |
75 | | - args: [ "version" ] |
76 | | - expectedOutput: [ "([0-9]+\\.){2}[0-9]+\\n$" ] |
77 | | - |
78 | | - - name: "entrypoint.sh" |
79 | | - envVars: |
80 | | - - key: "USERID" |
81 | | - value: "1000:1000" |
82 | | - command: "/entrypoint.sh" |
83 | | - args: [ "-V" ] |
84 | | - expectedError: ["^ERROR: uid:gid 1000:1000 lacks permissions to //\\n$"] |
85 | | - exitCode: 1 |
86 | | - |
87 | | - - name: "su-exec" |
88 | | - command: "su-exec" |
89 | | - expectedOutput: ["^Usage: su-exec user-spec command \\[args\\]\\n$"] |
90 | | - |
91 | | - - name: "ssh" |
92 | | - command: "ssh" |
93 | | - args: [ "-V" ] |
94 | | - expectedError: ["^OpenSSH_9\\.[0-9]+"] |
| 6 | +- name: git |
| 7 | + command: git |
| 8 | + args: |
| 9 | + - --version |
| 10 | + expectedOutput: |
| 11 | + - ^git version 2\.[0-9]+\.[0-9]+\n$ |
| 12 | + |
| 13 | +- name: pre-commit |
| 14 | + command: pre-commit |
| 15 | + args: |
| 16 | + - -V |
| 17 | + expectedOutput: |
| 18 | + - ^pre-commit ([0-9]+\.){2}[0-9]+\n$ |
| 19 | + |
| 20 | +- name: gcc |
| 21 | + command: gcc |
| 22 | + args: |
| 23 | + - --version |
| 24 | + expectedOutput: |
| 25 | + - ^gcc \(Alpine 12\. |
| 26 | + |
| 27 | +- name: checkov |
| 28 | + command: checkov |
| 29 | + args: |
| 30 | + - --version |
| 31 | + expectedOutput: |
| 32 | + - ^([0-9]+\.){2}[0-9]+\n$ |
| 33 | + |
| 34 | +- name: infracost |
| 35 | + command: infracost |
| 36 | + args: |
| 37 | + - --version |
| 38 | + expectedOutput: |
| 39 | + - ^Infracost v([0-9]+\.){2}[0-9]+ |
| 40 | + |
| 41 | +- name: opentofu |
| 42 | + command: tofu |
| 43 | + args: |
| 44 | + - --version |
| 45 | + expectedOutput: |
| 46 | + - ^OpenTofu v([0-9]+\.){2}[0-9]+\n |
| 47 | + |
| 48 | +- name: terraform |
| 49 | + command: terraform |
| 50 | + args: |
| 51 | + - --version |
| 52 | + expectedOutput: |
| 53 | + - ^Terraform v([0-9]+\.){2}[0-9]+\n |
| 54 | + |
| 55 | +- name: terraform-docs |
| 56 | + command: terraform-docs |
| 57 | + args: |
| 58 | + - --version |
| 59 | + expectedOutput: |
| 60 | + - ^terraform-docs version v([0-9]+\.){2}[0-9]+ [a-z0-9]+ |
| 61 | + |
| 62 | +- name: terragrunt |
| 63 | + command: terragrunt |
| 64 | + args: |
| 65 | + - --version |
| 66 | + expectedOutput: |
| 67 | + - ^terragrunt version v([0-9]+\.){2}[0-9]+\n$ |
| 68 | + |
| 69 | +- name: terrascan |
| 70 | + command: terrascan |
| 71 | + args: |
| 72 | + - --version |
| 73 | + expectedOutput: |
| 74 | + - >- |
| 75 | + ^version: v([0-9]+\.){2}[0-9]+\n$ |
| 76 | +
|
| 77 | +- name: tflint |
| 78 | + command: tflint |
| 79 | + args: |
| 80 | + - --version |
| 81 | + expectedOutput: |
| 82 | + - TFLint version ([0-9]+\.){2}[0-9]+\n |
| 83 | + |
| 84 | +- name: tfsec |
| 85 | + command: tfsec |
| 86 | + args: |
| 87 | + - --version |
| 88 | + expectedOutput: |
| 89 | + - ([0-9]+\.){2}[0-9]+\n$ |
| 90 | + |
| 91 | +- name: trivy |
| 92 | + command: trivy |
| 93 | + args: |
| 94 | + - --version |
| 95 | + expectedOutput: |
| 96 | + - >- |
| 97 | + Version: ([0-9]+\.){2}[0-9]+\n |
| 98 | +
|
| 99 | +- name: tfupdate |
| 100 | + command: tfupdate |
| 101 | + args: |
| 102 | + - --version |
| 103 | + expectedOutput: |
| 104 | + - ([0-9]+\.){2}[0-9]+\n$ |
| 105 | + |
| 106 | +- name: hcledit |
| 107 | + command: hcledit |
| 108 | + args: |
| 109 | + - --version |
| 110 | + expectedOutput: |
| 111 | + - ([0-9]+\.){2}[0-9]+\n$ |
| 112 | + |
| 113 | +- name: entrypoint.sh |
| 114 | + envVars: |
| 115 | + - key: USERID |
| 116 | + value: 1000:1000 |
| 117 | + command: /entrypoint.sh |
| 118 | + args: |
| 119 | + - -V |
| 120 | + expectedError: |
| 121 | + - >- |
| 122 | + ^ERROR: uid:gid 1000:1000 lacks permissions to //\n$ |
| 123 | + exitCode: 1 |
| 124 | + |
| 125 | +- name: su-exec |
| 126 | + command: su-exec |
| 127 | + expectedOutput: |
| 128 | + - >- |
| 129 | + ^Usage: su-exec user-spec command \[args\]\n$ |
| 130 | +
|
| 131 | +- name: ssh |
| 132 | + command: ssh |
| 133 | + args: |
| 134 | + - -V |
| 135 | + expectedError: |
| 136 | + - ^OpenSSH_9\.[0-9]+ |
95 | 137 |
|
96 | 138 | fileExistenceTests: |
97 | | - - name: 'terrascan init' |
98 | | - path: '/root/.terrascan/pkg/policies/opa/rego/github/github_repository/privateRepoEnabled.rego' |
99 | | - shouldExist: true |
100 | | - uid: 0 |
101 | | - gid: 0 |
| 139 | +- name: terrascan init |
| 140 | + # yamllint disable-line rule:line-length |
| 141 | + path: >- |
| 142 | + /root/.terrascan/pkg/policies/opa/rego/github/github_repository/privateRepoEnabled.rego |
| 143 | + shouldExist: true |
| 144 | + uid: 0 |
| 145 | + gid: 0 |
0 commit comments