mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-11 09:40:17 -04:00
29 lines
568 B
Go
29 lines
568 B
Go
// Copyright IBM Corp. 2013, 2025
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package packer
|
|
|
|
import (
|
|
"os/exec"
|
|
"testing"
|
|
)
|
|
|
|
func TestProvisioner_NoExist(t *testing.T) {
|
|
c := NewClient(&PluginClientConfig{Cmd: exec.Command("i-should-not-exist")})
|
|
defer c.Kill()
|
|
|
|
_, err := c.Provisioner()
|
|
if err == nil {
|
|
t.Fatal("should have error")
|
|
}
|
|
}
|
|
|
|
func TestProvisioner_Good(t *testing.T) {
|
|
c := NewClient(&PluginClientConfig{Cmd: helperProcess("provisioner")})
|
|
defer c.Kill()
|
|
|
|
_, err := c.Provisioner()
|
|
if err != nil {
|
|
t.Fatalf("should not have error: %s", err)
|
|
}
|
|
}
|