Example #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)
Example #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)
Example #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, '')
Example #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()
Example #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)
Example #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()
Example #7
0
 def test_404_from_provides(self):
     _write_file(CLOUD_INFO_FILE, 'EC2')
     audrey.csclient.PROVIDES_URL = 'gimmie-404'
     main()
Example #8
0
 def test_invalid_provides_name(self):
     _write_file(CLOUD_INFO_FILE, 'EC2')
     audrey.csclient.PROVIDES_URL = '/invalidparams'
     self.assertRaises(SystemExit, main)
Example #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)
Example #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'
Example #11
0
 def test_fail_invalid_cloudinfo(self):
     _write_file(CLOUD_INFO_FILE, "INVALID")
     self.assertRaises(AAError, main)
Example #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"
Example #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()
Example #14
0
 def test_main(self):
     _write_file(CLOUD_INFO_FILE, 'EC2')
     main()
Example #15
0
 def test_404_from_configs(self):
     _write_file(CLOUD_INFO_FILE, 'EC2')
     audrey.csclient.CONFIGS_URL = 'gimmie-404'
     self.assertRaises(AAError, main)
Example #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()
Example #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)
Example #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)
Example #19
0
 def test_404_from_tooling(self):
     _write_file(CLOUD_INFO_FILE, "EC2")
     audrey.csclient.TOOLING_URL = "gimmie-404"
     self.assertRaises(AAErrorGetTooling, main)
Example #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)
Example #21
0
 def test_404_from_provides(self):
     _write_file(CLOUD_INFO_FILE, "EC2")
     audrey.csclient.PROVIDES_URL = "gimmie-404"
     main()
Example #22
0
 def test_fail_invalid_cloudinfo(self):
     _write_file(CLOUD_INFO_FILE, 'INVALID')
     self.assertRaises(AAError, main)
Example #23
0
 def test_404_from_provides(self):
     _write_file(CLOUD_INFO_FILE, "EC2")
     audrey.csclient.PROVIDES_URL = "gimmie-404"
     self.assertRaises(AAError, main)
Example #24
0
 def test_404_from_tooling(self):
     _write_file(CLOUD_INFO_FILE, 'EC2')
     audrey.csclient.TOOLING_URL = 'gimmie-404'
     self.assertRaises(AAErrorGetTooling, main)
Example #25
0
 def test_invalid_provides_name(self):
     _write_file(CLOUD_INFO_FILE, "EC2")
     audrey.csclient.PROVIDES_URL = "/invalidparams"
     self.assertRaises(SystemExit, main)
Example #26
0
 def test_404_from_provides(self):
     _write_file(CLOUD_INFO_FILE, 'EC2')
     audrey.csclient.PROVIDES_URL = 'gimmie-404'
     self.assertRaises(AAError, main)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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')
Example #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()
Example #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()
Example #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()
Example #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)