def test_fail_execution_invoke_tooling(self): start_path = os.path.join(self.tooling.user_dir, 'start') _write_file(start_path, EXIT_ONE, 0744) services = self.factory.service.parse_require_config( DUMMY_NO_SERVICE_CONFIG_DATA, self.tooling) self.tooling.invoke_tooling(services)
def test_user_service_invoke_tooling(self): service_dir = os.path.join(self.tooling.user_dir, 'jon1') os.mkdir(service_dir) _write_file(os.path.join(service_dir, 'start'), EXIT_ZERO, 0744) services = self.factory.service.parse_require_config( DUMMY_SERVICE_CONFIG_DATA, self.tooling) self.tooling.invoke_tooling(services)
def test_find_user_tooling(self): start_path = os.path.join(self.tooling.user_dir, 'start') _write_file(start_path, EXIT_ZERO, 0744) # this is expected to fail because we don't allow user tooling # anymore, it can probably go away but is kept for now # because there are other user tooling tests and code # that need to be torn out too self.assertRaises(AAError, self.tooling.find_tooling, '')
def test_rhev_base64encoded(self): _write_file(CLOUD_INFO_FILE, "RHEV") _write_file(self.user_data_file, base64.b64encode(DUMMY_USER_DATA)) audrey.user_data_rhev.DELTA_CLOUD_USER_DATA = self.user_data_file audrey.user_data.discover().read()
def test_rhev_mount_floppy_fail(self): audrey.user_data_rhev.run_cmd = mock_run_cmd_mount_floppy_fail _write_file(CLOUD_INFO_FILE, 'RHEV') _write_file(self.user_data_file, DUMMY_USER_DATA) audrey.user_data_rhev.DELTA_CLOUD_USER_DATA = self.user_data_file self.assertRaises(AAError, audrey.user_data.discover().read)
def test_rhev(self): _write_file(CLOUD_INFO_FILE, 'RHEV') _write_file(self.user_data_file, DUMMY_USER_DATA) audrey.user_data_rhev.DELTA_CLOUD_USER_DATA = self.user_data_file audrey.user_data.discover().read()
def test_404_from_provides(self): _write_file(CLOUD_INFO_FILE, 'EC2') audrey.csclient.PROVIDES_URL = 'gimmie-404' main()
def test_invalid_provides_name(self): _write_file(CLOUD_INFO_FILE, 'EC2') audrey.csclient.PROVIDES_URL = '/invalidparams' self.assertRaises(SystemExit, main)
def test_invalid_tar_unpack_tooling(self): tar_file = os.path.join(self.tooling.user_dir, 'invalid_tar') _write_file(tar_file, 'NotRealTarFileContents') self.assertRaises(AAErrorInvalidTar, Tooling, tar_file, self.tool_dir)
def test_no_connectivity(self): _write_file(CLOUD_INFO_FILE, 'EC2') audrey.csclient.VERSION_URL = 'raiseException' self.assertRaises(AAError, main) audrey.csclient.VERSION_URL = 'version'
def test_fail_invalid_cloudinfo(self): _write_file(CLOUD_INFO_FILE, "INVALID") self.assertRaises(AAError, main)
def test_no_connectivity(self): _write_file(CLOUD_INFO_FILE, "EC2") audrey.csclient.VERSION_URL = "raiseException" self.assertRaises(AAError, main) audrey.csclient.VERSION_URL = "version"
def test_404_from_configs(self): _write_file(CLOUD_INFO_FILE, 'EC2') audrey.csclient.CONFIGS_URL = 'gimmie-404' # should succeed, we don't bail on 404 # in api version 2 main()
def test_main(self): _write_file(CLOUD_INFO_FILE, 'EC2') main()
def test_404_from_configs(self): _write_file(CLOUD_INFO_FILE, 'EC2') audrey.csclient.CONFIGS_URL = 'gimmie-404' self.assertRaises(AAError, main)
def test_vsphere_base64encoded(self): _write_file(CLOUD_INFO_FILE, "VSPHERE") _write_file(self.user_data_file, base64.b64encode(DUMMY_USER_DATA)) audrey.user_data_vsphere.DELTA_CLOUD_USER_DATA = self.user_data_file audrey.user_data.discover().read()
def test_rhev_invalid_user_data_file(self): _write_file(CLOUD_INFO_FILE, "RHEV") audrey.user_data_rhev.DELTA_CLOUD_USER_DATA = "/invalid_file_path" self.assertRaises(AAError, audrey.user_data.discover().read)
def test_404_from_tooling(self): _write_file(CLOUD_INFO_FILE, "EC2") audrey.csclient.TOOLING_URL = "gimmie-404" self.assertRaises(AAErrorGetTooling, main)
def test_vsphere_mount_cdrom_fail(self): audrey.user_data_vsphere.run_cmd = mock_run_cmd_mount_cdrom_fail _write_file(CLOUD_INFO_FILE, "vsphere") _write_file(self.user_data_file, DUMMY_USER_DATA) audrey.user_data_rhev.delta_cloud_user_data = self.user_data_file self.assertRaises(AAError, audrey.user_data.discover().read)
def test_404_from_provides(self): _write_file(CLOUD_INFO_FILE, "EC2") audrey.csclient.PROVIDES_URL = "gimmie-404" main()
def test_fail_invalid_cloudinfo(self): _write_file(CLOUD_INFO_FILE, 'INVALID') self.assertRaises(AAError, main)
def test_404_from_provides(self): _write_file(CLOUD_INFO_FILE, "EC2") audrey.csclient.PROVIDES_URL = "gimmie-404" self.assertRaises(AAError, main)
def test_404_from_tooling(self): _write_file(CLOUD_INFO_FILE, 'EC2') audrey.csclient.TOOLING_URL = 'gimmie-404' self.assertRaises(AAErrorGetTooling, main)
def test_invalid_provides_name(self): _write_file(CLOUD_INFO_FILE, "EC2") audrey.csclient.PROVIDES_URL = "/invalidparams" self.assertRaises(SystemExit, main)
def test_404_from_provides(self): _write_file(CLOUD_INFO_FILE, 'EC2') audrey.csclient.PROVIDES_URL = 'gimmie-404' self.assertRaises(AAError, main)
def test_rhev_invalid_user_data_file(self): _write_file(CLOUD_INFO_FILE, 'RHEV') audrey.user_data_rhev.DELTA_CLOUD_USER_DATA = '/invalid_file_path' self.assertRaises(AAError, audrey.user_data.discover().read)
def test_vsphere_invalid_user_data_file(self): _write_file(CLOUD_INFO_FILE, 'VSPHERE') audrey.user_data_vsphere.DELTA_CLOUD_USER_DATA = '/invalid_file_path' self.assertRaises(AAError, audrey.user_data.discover().read)
def test_rhev_mount_floppy_fail(self): audrey.user_data_rhev.run_cmd = mock_run_cmd_mount_floppy_fail _write_file(CLOUD_INFO_FILE, "RHEV") _write_file(self.user_data_file, DUMMY_USER_DATA) audrey.user_data_rhev.DELTA_CLOUD_USER_DATA = self.user_data_file self.assertRaises(AAError, audrey.user_data.discover().read)
def test_vsphere_mount_cdrom_fail(self): audrey.user_data_vsphere.run_cmd = mock_run_cmd_mount_cdrom_fail _write_file(CLOUD_INFO_FILE, 'vsphere') _write_file(self.user_data_file, DUMMY_USER_DATA) audrey.user_data_rhev.delta_cloud_user_data = self.user_data_file self.assertRaises(AAError, audrey.user_data.discover().read)
def test_find_redhat_service_tooling(self): service_dir = os.path.join(self.tooling.redhat_dir, 'test_service') os.mkdir(self.tooling.redhat_dir) os.mkdir(service_dir) _write_file(os.path.join(service_dir, 'start'), EXIT_ZERO, 0744) self.tooling.find_tooling('test_service')
def test_rhev_base64encoded(self): _write_file(CLOUD_INFO_FILE, 'RHEV') _write_file(self.user_data_file, base64.b64encode(DUMMY_USER_DATA)) audrey.user_data_rhev.DELTA_CLOUD_USER_DATA = self.user_data_file audrey.user_data.discover().read()
def test_rhev(self): _write_file(CLOUD_INFO_FILE, "RHEV") _write_file(self.user_data_file, DUMMY_USER_DATA) audrey.user_data_rhev.DELTA_CLOUD_USER_DATA = self.user_data_file audrey.user_data.discover().read()
def test_vsphere_base64encoded(self): _write_file(CLOUD_INFO_FILE, 'VSPHERE') _write_file(self.user_data_file, base64.b64encode(DUMMY_USER_DATA)) audrey.user_data_vsphere.DELTA_CLOUD_USER_DATA = self.user_data_file audrey.user_data.discover().read()
def test_vsphere_invalid_user_data_file(self): _write_file(CLOUD_INFO_FILE, "VSPHERE") audrey.user_data_vsphere.DELTA_CLOUD_USER_DATA = "/invalid_file_path" self.assertRaises(AAError, audrey.user_data.discover().read)