FIX #2171 Fix faulty flag and add tests for SetConfigFromFlags
Signed-off-by: David Gageot <david@gageot.net>
This commit is contained in:
parent
15d213dcd7
commit
f47ab21dd0
29
drivers/openstack/openstack_test.go
Normal file
29
drivers/openstack/openstack_test.go
Normal file
@ -0,0 +1,29 @@
|
||||
package openstack
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/docker/machine/libmachine/drivers"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestSetConfigFromFlags(t *testing.T) {
|
||||
driver := NewDriver("default", "path")
|
||||
|
||||
checkFlags := &drivers.CheckDriverOptions{
|
||||
FlagsValues: map[string]interface{}{
|
||||
"openstack-auth-url": "http://url",
|
||||
"openstack-username": "user",
|
||||
"openstack-password": "pwd",
|
||||
"openstack-tenant-id": "ID",
|
||||
"openstack-flavor-id": "ID",
|
||||
"openstack-image-id": "ID",
|
||||
},
|
||||
CreateFlags: driver.GetCreateFlags(),
|
||||
}
|
||||
|
||||
err := driver.SetConfigFromFlags(checkFlags)
|
||||
|
||||
assert.NoError(t, err)
|
||||
assert.Empty(t, checkFlags.InvalidFlags)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user