예제 #1
0
// Verifies that it is possible to get the extra specifications for a share type
func TestGetExtraSpecs(t *testing.T) {
	th.SetupHTTP()
	defer th.TeardownHTTP()

	MockGetExtraSpecsResponse(t)

	st, err := sharetypes.GetExtraSpecs(client.ServiceClient(), "shareTypeID").Extract()
	th.AssertNoErr(t, err)

	th.AssertEquals(t, st["snapshot_support"], "True")
	th.AssertEquals(t, st["driver_handles_share_servers"], "True")
	th.AssertEquals(t, st["my_custom_extra_spec"], "False")
}
예제 #2
0
func TestShareTypeExtraSpecs(t *testing.T) {
	client, err := clients.NewSharedFileSystemV2Client()
	if err != nil {
		t.Fatalf("Unable to create shared file system client: %v", err)
	}

	shareType, err := CreateShareType(t, client)
	if err != nil {
		t.Fatalf("Unable to create share type: %v", err)
	}

	extraSpecs, err := sharetypes.GetExtraSpecs(client, shareType.ID).Extract()
	if err != nil {
		t.Fatalf("Unable to retrieve share type: %s", shareType.Name)
	}

	if extraSpecs["driver_handles_share_servers"] != "True" {
		t.Fatal("driver_handles_share_servers was expected to be true")
	}

	PrintShareType(t, shareType)

	defer DeleteShareType(t, client, shareType)
}