def setUp(self): """ Sets up the test requirements """ super(VirtualboxProviderTest, self).setUp() # check if appropriate cloud provider and profile files are present profile_str = 'virtualbox-config' providers = self.run_cloud('--list-providers') log.debug("providers: %s", providers) if profile_str not in providers: self.skipTest( 'Configuration file for {0} was not found. Check {0}.conf files ' 'in tests/integration/files/conf/cloud.*.d/ to run these tests.'.format(PROVIDER_NAME) ) # check if personal access token, ssh_key_file, and ssh_key_names are present config_path = os.path.join( integration.FILES, 'conf', 'cloud.providers.d', PROVIDER_NAME + '.conf' ) log.debug("config_path: %s", config_path) providers = cloud_providers_config(config_path) log.debug("config: %s", providers) config_path = os.path.join( integration.FILES, 'conf', 'cloud.profiles.d', PROVIDER_NAME + '.conf' ) profiles = vm_profiles_config(config_path, providers) profile = profiles.get(PROFILE_NAME) if not profile: self.skipTest( 'Profile {0} was not found. Check {1}.conf files ' 'in tests/integration/files/conf/cloud.profiles.d/ to run these tests.'.format(PROFILE_NAME, PROVIDER_NAME) ) base_box_name = profile.get("clonefrom") if base_box_name != BASE_BOX_NAME: self.skipTest( 'Profile {0} does not have a base box to clone from. Check {1}.conf files ' 'in tests/integration/files/conf/cloud.profiles.d/ to run these tests.' 'And add a "clone_from: {2}" to the profile'.format(PROFILE_NAME, PROVIDER_NAME, BASE_BOX_NAME) )
def setUp(self): """ Sets up the test requirements """ super().setUp() # check if appropriate cloud provider and profile files are present profile_str = "virtualbox-config" providers = self.run_cloud("--list-providers") log.debug("providers: %s", providers) if profile_str not in providers: self.skipTest( "Configuration file for {0} was not found. Check {0}.conf files " "in tests/integration/files/conf/cloud.*.d/ to run these tests." .format(PROVIDER_NAME)) # check if personal access token, ssh_key_file, and ssh_key_names are present config_path = os.path.join(RUNTIME_VARS.FILES, "conf", "cloud.providers.d", PROVIDER_NAME + ".conf") log.debug("config_path: %s", config_path) providers = cloud_providers_config(config_path) log.debug("config: %s", providers) config_path = os.path.join(RUNTIME_VARS.FILES, "conf", "cloud.profiles.d", PROVIDER_NAME + ".conf") profiles = vm_profiles_config(config_path, providers) profile = profiles.get(PROFILE_NAME) if not profile: self.skipTest( "Profile {} was not found. Check {}.conf files " "in tests/integration/files/conf/cloud.profiles.d/ to run these tests." .format(PROFILE_NAME, PROVIDER_NAME)) base_box_name = profile.get("clonefrom") if base_box_name != BASE_BOX_NAME: self.skipTest( "Profile {} does not have a base box to clone from. Check {}.conf files " "in tests/integration/files/conf/cloud.profiles.d/ to run these tests." 'And add a "clone_from: {}" to the profile'.format( PROFILE_NAME, PROVIDER_NAME, BASE_BOX_NAME))
def process_vm_config(self): self.profiles_config = config.vm_profiles_config( self.options.vm_config )