def test_remove_worker(self): ctx = get_local_context() t.install(ctx) t.start(ctx) t.stop(ctx) t.uninstall(ctx) agent_config = ctx.properties['cloudify_agent'] plugins = _extract_registered_plugins(agent_config['name']) # make sure the worker has stopped self.assertEqual(0, len(plugins)) # make sure files are deleted service_file_path = "/etc/init.d/celeryd-{0}".format( agent_config['name']) defaults_file_path = "/etc/default/celeryd-{0}".format( agent_config['name']) worker_home = agent_config['base_dir'] runner = FabricRunner(ctx, agent_config) self.assertFalse(runner.exists(service_file_path)) self.assertFalse(runner.exists(defaults_file_path)) self.assertFalse(runner.exists(worker_home))
def test_download_resource_on_host(self): ctx = get_local_context() runner = FabricRunner(ctx) tasks.download_resource_on_host( ctx.logger, runner, AGENT_PACKAGE_URL, 'Ubuntu-agent.tar.gz') r = runner.exists('Ubuntu-agent.tar.gz') self.assertTrue(r)
def test_download_resource_on_host(self): ctx = get_local_context() runner = FabricRunner(ctx) tasks.download_resource_on_host(ctx.logger, runner, AGENT_PACKAGE_URL, 'Ubuntu-agent.tar.gz') r = runner.exists('Ubuntu-agent.tar.gz') self.assertTrue(r)
def test_download_resource_on_host(self): properties = { 'cloudify_agent': { 'user': '******', 'host': VAGRANT_MACHINE_IP, 'key': '~/.vagrant.d/insecure_private_key', 'port': 2222, 'distro': 'Ubuntu', 'distro_codename': 'trusty' } } ctx = get_remote_context(properties) runner = FabricRunner(ctx, ctx.node.properties['cloudify_agent']) tasks.download_resource_on_host( ctx.logger, runner, AGENT_PACKAGE_URL, 'Ubuntu-agent.tar.gz') r = runner.exists('Ubuntu-agent.tar.gz') self.assertTrue(r)
def test_download_resource_on_host(self): properties = { 'cloudify_agent': { 'user': '******', 'host': VAGRANT_MACHINE_IP, 'key': '~/.vagrant.d/insecure_private_key', 'port': 2222, 'distro': 'Ubuntu', 'distro_codename': 'trusty' } } ctx = get_remote_context(properties) runner = FabricRunner(ctx, ctx.node.properties['cloudify_agent']) tasks.download_resource_on_host(ctx.logger, runner, AGENT_PACKAGE_URL, 'Ubuntu-agent.tar.gz') r = runner.exists('Ubuntu-agent.tar.gz') self.assertTrue(r)