diff options
author | Thomas Hipp <thipp@suse.de> | 2017-09-15 09:37:45 +0200 |
---|---|---|
committer | Thomas Hipp <thipp@suse.de> | 2017-09-15 10:01:36 +0200 |
commit | 651fe263818d1c4ad5ba8adf8c8485ce647dc40b (patch) | |
tree | fc73bb74bdcce03c48169ce624698bf240b55e6b /vendor/github.com/mitchellh/packer/builder/oracle/oci/step_instance_info_test.go | |
parent | 23635373aed10aab286a2436459670b686b581bb (diff) | |
download | terraform-provider-libvirt-651fe263818d1c4ad5ba8adf8c8485ce647dc40b.tar terraform-provider-libvirt-651fe263818d1c4ad5ba8adf8c8485ce647dc40b.tar.gz |
vendor: update deps
This updates all vendored packages. The Glide config has been changed to
try and stick to versions instead of commit IDs if possible.
Signed-off-by: Thomas Hipp <thipp@suse.de>
Diffstat (limited to 'vendor/github.com/mitchellh/packer/builder/oracle/oci/step_instance_info_test.go')
-rw-r--r-- | vendor/github.com/mitchellh/packer/builder/oracle/oci/step_instance_info_test.go | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/vendor/github.com/mitchellh/packer/builder/oracle/oci/step_instance_info_test.go b/vendor/github.com/mitchellh/packer/builder/oracle/oci/step_instance_info_test.go new file mode 100644 index 00000000..fdae8a0e --- /dev/null +++ b/vendor/github.com/mitchellh/packer/builder/oracle/oci/step_instance_info_test.go @@ -0,0 +1,52 @@ +package oci + +import ( + "errors" + "testing" + + "github.com/mitchellh/multistep" +) + +func TestInstanceInfo(t *testing.T) { + state := testState() + state.Put("instance_id", "ocid1...") + + step := new(stepInstanceInfo) + defer step.Cleanup(state) + + if action := step.Run(state); action != multistep.ActionContinue { + t.Fatalf("bad action: %#v", action) + } + + instanceIPRaw, ok := state.GetOk("instance_ip") + if !ok { + t.Fatalf("should have instance_ip") + } + + if instanceIPRaw.(string) != "ip" { + t.Fatalf("should've got ip ('%s' != 'ip')", instanceIPRaw.(string)) + } +} + +func TestInstanceInfo_GetInstanceIPErr(t *testing.T) { + state := testState() + state.Put("instance_id", "ocid1...") + + step := new(stepInstanceInfo) + defer step.Cleanup(state) + + driver := state.Get("driver").(*driverMock) + driver.GetInstanceIPErr = errors.New("error") + + if action := step.Run(state); action != multistep.ActionHalt { + t.Fatalf("bad action: %#v", action) + } + + if _, ok := state.GetOk("error"); !ok { + t.Fatalf("should have error") + } + + if _, ok := state.GetOk("instance_ip"); ok { + t.Fatalf("should NOT have instance_ip") + } +} |