forked from hashicorp/terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinternal_plugin_test.go
More file actions
34 lines (28 loc) · 1 KB
/
Copy pathinternal_plugin_test.go
File metadata and controls
34 lines (28 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// +build !core
package command
import "testing"
func TestInternalPlugin_InternalProviders(t *testing.T) {
// Note this is a randomish sample and does not check for all plugins
for _, name := range []string{"atlas", "consul", "docker", "template"} {
if _, ok := InternalProviders[name]; !ok {
t.Errorf("Expected to find %s in InternalProviders", name)
}
}
}
func TestInternalPlugin_InternalProvisioners(t *testing.T) {
for _, name := range []string{"chef", "file", "local-exec", "remote-exec"} {
if _, ok := InternalProvisioners[name]; !ok {
t.Errorf("Expected to find %s in InternalProvisioners", name)
}
}
}
func TestInternalPlugin_BuildPluginCommandString(t *testing.T) {
actual, err := BuildPluginCommandString("provisioner", "remote-exec")
if err != nil {
t.Fatalf(err.Error())
}
expected := "-TFSPACE-internal-plugin-TFSPACE-provisioner-TFSPACE-remote-exec"
if actual[len(actual)-len(expected):] != expected {
t.Errorf("Expected command to end with %s; got:\n%s\n", expected, actual)
}
}