From: Thierry Parmentelat Date: Thu, 29 May 2008 15:23:41 +0000 (+0000) Subject: clean_all_sites performs deep cleaning - useful when used in conjunction with the... X-Git-Tag: tests-4.3-0~170 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=6a3d332f76020150e2ba053e19cafaa4b84f9ed0;p=tests.git clean_all_sites performs deep cleaning - useful when used in conjunction with the plcapi test script --- diff --git a/system/Makefile b/system/Makefile index 10f2063..06f2817 100644 --- a/system/Makefile +++ b/system/Makefile @@ -1,16 +1,26 @@ tags: find . '(' -name '*.py' -o -name 'qemu-*' ')' | grep -v '.svn/' | xargs etags +.PHONY: tags -LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' --exclude 'arg*' +#################### + +########## make sync PLCHOST=hostname VSERVER=vservername +ifdef PLCHOST +ifdef BUILDNAME +PLCSSH:=root@$(PLCHOST):$(BUILDNAME) +endif +endif + +LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' --exclude 'arg*' RSYNC_EXCLUDES := --exclude .svn --exclude CVS --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES) RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,) RSYNC := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES) sync: -ifeq (,$(RSYNC_URL)) - echo "sync: You must define target host as RSYNC_URL on the command line" - echo " e.g. make sync RSYNC_URL=root@testbox1:workdir" ; exit 1 +ifeq (,$(PLCSSH)) + echo "sync: You must define PLCHOST and BUILDNAME on the command line" + echo " e.g. make sync PLCHOST=private.one-lab.org BUILDNAME=" ; exit 1 else - +$(RSYNC) ./ $(RSYNC_URL)/ + +$(RSYNC) ./ $(PLCSSH) endif diff --git a/system/TestApiserver.py b/system/TestApiserver.py index 006c990..5d49a23 100644 --- a/system/TestApiserver.py +++ b/system/TestApiserver.py @@ -37,6 +37,7 @@ server_methods = [ ('GetNodes' , []), ('DeletePerson' , True), ('AddPersonKey' , True), ('GetPlcRelease', {'build': {'target-arch':'i386'}}), + ('GetSites', []), ] class TestApiserver: diff --git a/system/TestPlc.py b/system/TestPlc.py index d1f2320..e7c9556 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -72,7 +72,8 @@ class TestPlc: 'check_initscripts', 'check_tcp',SEP, 'force_gather_logs', 'force_kill_qemus', 'force_record_tracker','force_free_tracker' ] other_steps = [ 'stop_all_vservers','fresh_install', 'cache_rpm', 'stop', 'vs_start', SEP, - 'clean_initscripts', 'clean_sites', 'clean_nodes', + 'clean_initscripts', 'clean_all_sites', + 'clean_sites', 'clean_nodes', 'clean_slices', 'clean_keys', SEP, 'show_boxes', 'list_all_qemus', 'list_qemus', SEP, 'db_dump' , 'db_restore', ' cleanup_tracker', @@ -390,6 +391,13 @@ class TestPlc: test_site.create_users() return True + def clean_all_sites (self): + print 'auth_root',self.auth_root() + site_ids = [s['site_id'] for s in self.apiserver.GetSites(self.auth_root(), {}, ['site_id'])] + for site_id in site_ids: + print 'Deleting site_id',site_id + self.apiserver.DeleteSite(self.auth_root(),site_id) + def nodes (self): return self.do_nodes() def clean_nodes (self):