Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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, '')
Exemplo n.º 4
0
 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()
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
 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()
Exemplo n.º 7
0
 def test_404_from_provides(self):
     _write_file(CLOUD_INFO_FILE, 'EC2')
     audrey.csclient.PROVIDES_URL = 'gimmie-404'
     main()
Exemplo n.º 8
0
 def test_invalid_provides_name(self):
     _write_file(CLOUD_INFO_FILE, 'EC2')
     audrey.csclient.PROVIDES_URL = '/invalidparams'
     self.assertRaises(SystemExit, main)
Exemplo n.º 9
0
 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)
Exemplo n.º 10
0
 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'
Exemplo n.º 11
0
 def test_fail_invalid_cloudinfo(self):
     _write_file(CLOUD_INFO_FILE, "INVALID")
     self.assertRaises(AAError, main)
Exemplo n.º 12
0
 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"
Exemplo n.º 13
0
 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()
Exemplo n.º 14
0
 def test_main(self):
     _write_file(CLOUD_INFO_FILE, 'EC2')
     main()
Exemplo n.º 15
0
 def test_404_from_configs(self):
     _write_file(CLOUD_INFO_FILE, 'EC2')
     audrey.csclient.CONFIGS_URL = 'gimmie-404'
     self.assertRaises(AAError, main)
Exemplo n.º 16
0
 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()
Exemplo n.º 17
0
 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)
Exemplo n.º 18
0
 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)
Exemplo n.º 19
0
 def test_404_from_tooling(self):
     _write_file(CLOUD_INFO_FILE, "EC2")
     audrey.csclient.TOOLING_URL = "gimmie-404"
     self.assertRaises(AAErrorGetTooling, main)
Exemplo n.º 20
0
 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)
Exemplo n.º 21
0
 def test_404_from_provides(self):
     _write_file(CLOUD_INFO_FILE, "EC2")
     audrey.csclient.PROVIDES_URL = "gimmie-404"
     main()
Exemplo n.º 22
0
 def test_fail_invalid_cloudinfo(self):
     _write_file(CLOUD_INFO_FILE, 'INVALID')
     self.assertRaises(AAError, main)
Exemplo n.º 23
0
 def test_404_from_provides(self):
     _write_file(CLOUD_INFO_FILE, "EC2")
     audrey.csclient.PROVIDES_URL = "gimmie-404"
     self.assertRaises(AAError, main)
Exemplo n.º 24
0
 def test_404_from_tooling(self):
     _write_file(CLOUD_INFO_FILE, 'EC2')
     audrey.csclient.TOOLING_URL = 'gimmie-404'
     self.assertRaises(AAErrorGetTooling, main)
Exemplo n.º 25
0
 def test_invalid_provides_name(self):
     _write_file(CLOUD_INFO_FILE, "EC2")
     audrey.csclient.PROVIDES_URL = "/invalidparams"
     self.assertRaises(SystemExit, main)
Exemplo n.º 26
0
 def test_404_from_provides(self):
     _write_file(CLOUD_INFO_FILE, 'EC2')
     audrey.csclient.PROVIDES_URL = 'gimmie-404'
     self.assertRaises(AAError, main)
Exemplo n.º 27
0
 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)
Exemplo n.º 28
0
 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)
Exemplo n.º 29
0
 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)
Exemplo n.º 30
0
 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)
Exemplo n.º 31
0
 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')
Exemplo n.º 32
0
 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()
Exemplo n.º 33
0
 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()
Exemplo n.º 34
0
 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()
Exemplo n.º 35
0
 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)