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