Skip to content

Commit

Permalink
fix: eyaml tests - pub key is no longer required
Browse files Browse the repository at this point in the history
  • Loading branch information
luisdavim committed May 31, 2024
1 parent 8c1b962 commit a2440a7
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions internal/app/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,12 @@ func Test_eyamlSecrets(t *testing.T) {
want: false,
},
{
name: "decryptSecrets - not existing eyaml key",
name: "decryptSecrets - not existing private eyaml key",
args: args{
s: &Config{
EyamlEnabled: true,
EyamlPublicKeyPath: "./../../tests/keys/public_key.pkcs7.pem2",
EyamlPrivateKeyPath: "./../../tests/keys/private_key.pkcs7.pem",
EyamlPublicKeyPath: "./../../tests/keys/public_key.pkcs7.pem",
EyamlPrivateKeyPath: "./../../tests/keys/invalid_private_key.pkcs7.pem",
},
r: &Release{
Name: "release1",
Expand All @@ -240,6 +240,25 @@ func Test_eyamlSecrets(t *testing.T) {
},
want: false,
},
{
name: "decryptSecrets - not existing public eyaml key",
args: args{
s: &Config{
EyamlEnabled: true,
// https://github.com/voxpupuli/hiera-eyaml/commit/760fd05e7cbb34b5380f87a87290deb790ae0aaf
EyamlPublicKeyPath: "./../../tests/keys/invalid_public_key.pkcs7.pem",
EyamlPrivateKeyPath: "./../../tests/keys/private_key.pkcs7.pem",
},
r: &Release{
Name: "release1",
Namespace: "namespace",
Version: "1.0.0",
Enabled: True,
SecretsFile: "./../../tests/secrets/valid_eyaml_secrets.yaml",
},
},
want: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit a2440a7

Please sign in to comment.