packer/provisioner/powershell/execution_policy_test.go
hashicorp-copywrite[bot] abc4bfffce
Merge pull request #13632 from hashicorp/compliance/add-headers
[COMPLIANCE] Add/Update Copyright Headers
2026-06-03 14:37:46 +05:30

24 lines
521 B
Go

// Copyright IBM Corp. 2024, 2025
// SPDX-License-Identifier: BUSL-1.1
package powershell
import (
"testing"
)
func TestExecutionPolicy_Decode(t *testing.T) {
config := map[string]interface{}{
"inline": []interface{}{"foo", "bar"},
"execution_policy": "allsigned",
}
p := new(Provisioner)
err := p.Prepare(config)
if err != nil {
t.Fatal(err)
}
if p.config.ExecutionPolicy != ExecutionPolicyAllsigned {
t.Fatalf("Expected AllSigned execution policy; got: %s", p.config.ExecutionPolicy)
}
}