summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2015-11-05 12:57:43 +0100
committerDavid Gageot <david@gageot.net>2015-11-05 18:57:03 +0100
commitf47ab21dd0054f5b6bf50af4e2d1241ba305f8f7 (patch)
treeaaa28c7894bf1292ef9b48973586b0040b899724
parent15d213dcd7397ebb9e1b86a488506c18151693f6 (diff)
FIX #2171 Fix faulty flag and add tests for SetConfigFromFlags
Signed-off-by: David Gageot <david@gageot.net>
-rw-r--r--drivers/openstack/openstack_test.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/openstack/openstack_test.go b/drivers/openstack/openstack_test.go
new file mode 100644
index 0000000..49134c0
--- /dev/null
+++ b/drivers/openstack/openstack_test.go
@@ -0,0 +1,29 @@
1package openstack
2
3import (
4 "testing"
5
6 "github.com/docker/machine/libmachine/drivers"
7 "github.com/stretchr/testify/assert"
8)
9
10func TestSetConfigFromFlags(t *testing.T) {
11 driver := NewDriver("default", "path")
12
13 checkFlags := &drivers.CheckDriverOptions{
14 FlagsValues: map[string]interface{}{
15 "openstack-auth-url": "http://url",
16 "openstack-username": "user",
17 "openstack-password": "pwd",
18 "openstack-tenant-id": "ID",
19 "openstack-flavor-id": "ID",
20 "openstack-image-id": "ID",
21 },
22 CreateFlags: driver.GetCreateFlags(),
23 }
24
25 err := driver.SetConfigFromFlags(checkFlags)
26
27 assert.NoError(t, err)
28 assert.Empty(t, checkFlags.InvalidFlags)
29}