The nova.tests.test_nfs Module

Unit tests for the NFS driver module

class DumbVolume

Bases: object

fields = {}
class NfsDriverTestCase(methodName='runTest')

Bases: nova.test.TestCase

Test case for NFS driver

ONE_GB_IN_BYTES = 1073741824
TEST_FILE_NAME = 'test.txt'
TEST_LOCAL_PATH = '/mnt/nfs/volume-123'
TEST_MNT_POINT = '/mnt/nfs'
TEST_MNT_POINT_BASE = '/mnt/test'
TEST_NFS_EXPORT1 = 'nfs-host1:/export'
TEST_NFS_EXPORT2 = 'nfs-host2:/export'
TEST_SHARES_CONFIG_FILE = '/etc/cinder/test-shares.conf'
TEST_SIZE_IN_GB = 1
setUp()
stub_out_not_replaying(obj, attr_name)
tearDown()
test_create_nonsparsed_volume()
test_create_sparsed_volume()
test_create_volume_should_ensure_nfs_mounted()

create_volume should ensure shares provided in config are mounted

test_create_volume_should_return_provider_location()

create_volume should return provider_location with found share

test_delete_should_ensure_share_mounted()

delete_volume should ensure that corresponding share is mounted

test_delete_should_not_delete_if_provider_location_not_provided()

delete_volume shouldn’t try to delete if provider_location missed

test_delete_should_not_delete_if_there_is_no_file()

delete_volume should not try to delete if file missed

test_delete_volume()

delete_volume simple test case

test_ensure_share_mounted()

_ensure_share_mounted simple use case

test_ensure_shares_mounted_should_not_save_mounting_with_error()

_ensure_shares_mounted should not save share if failed to mount

test_ensure_shares_mounted_should_save_mounting_successfully()

_ensure_shares_mounted should save share if mounted with success

test_find_share()

_find_share simple use case

test_find_share_should_throw_error_if_there_is_no_enough_place()

_find_share should throw error if there is no share to host vol

test_find_share_should_throw_error_if_there_is_no_mounted_shares()

_find_share should throw error if there is no mounted shares

test_get_available_capacity_with_df()

_get_available_capacity should calculate correct value

test_get_available_capacity_with_du()

_get_available_capacity should calculate correct value

test_get_hash_str()

_get_hash_str should calculation correct value

test_get_mount_point_for_share()

_get_mount_point_for_share should calculate correct value

test_load_shares_config()
test_local_path()

local_path common use case

test_mount_nfs_should_create_mountpoint_if_not_yet()

_mount_nfs should create mountpoint if it doesn’t exist

test_mount_nfs_should_mount_correctly()

_mount_nfs common case usage

test_mount_nfs_should_not_create_mountpoint_if_already()

_mount_nfs should not create mountpoint if it already exists

test_mount_nfs_should_reraise_already_mounted_error()

_mount_nfs should not suppress already mounted error if ensure=False

test_mount_nfs_should_suppress_already_mounted_error()

_mount_nfs should suppress already mounted error if ensure=True

test_path_exists_should_return_false()

_path_exists should return True if stat doesn’t return 0

test_path_exists_should_return_true()

_path_exists should return True if stat returns 0

test_setup_should_throw_error_if_shares_config_not_configured()

do_setup should throw error if shares config is not configured

test_setup_should_throw_exception_if_nfs_client_is_not_installed()

do_setup should throw error if nfs client is not installed

Previous topic

The nova.tests.test_nexenta Module

Next topic

The nova.tests.test_notifications Module

This Page