forked from ungleich-public/cdist
		
	Merge remote-tracking branch 'telmich/master'
This commit is contained in:
		
				commit
				
					
						fea602a2c7
					
				
			
		
					 3 changed files with 115 additions and 113 deletions
				
			
		| 
						 | 
				
			
			@ -1,7 +1,61 @@
 | 
			
		|||
2.0.3:
 | 
			
		||||
 | 
			
		||||
- fix emulator / require
 | 
			
		||||
- sanity checks
 | 
			
		||||
- sanity checks: implement tests
 | 
			
		||||
 | 
			
		||||
   stage_run()
 | 
			
		||||
      - ensure that for every object in
 | 
			
		||||
         cdist.core.Object.list_objects() is passed into
 | 
			
		||||
         self.object_run()
 | 
			
		||||
         - instantiate + overwrite + test
 | 
			
		||||
 | 
			
		||||
   object_prepare():
 | 
			
		||||
      - calls (in this order):
 | 
			
		||||
         self.run_type_explorer(cdist_object)
 | 
			
		||||
         self.run_type_manifest(cdist_object)
 | 
			
		||||
         cdist_object.prepared = True
 | 
			
		||||
      - object is prepared after function call
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
   stage_prepare():
 | 
			
		||||
      - calls (in this order):
 | 
			
		||||
         self.link_emulator()
 | 
			
		||||
         self.run_global_explorers()
 | 
			
		||||
         self.run_initial_manifest()
 | 
			
		||||
 | 
			
		||||
      - ensure that all objects are created :-)
 | 
			
		||||
         - as defined in inital manifest + type manifests
 | 
			
		||||
         
 | 
			
		||||
   deploy_to()
 | 
			
		||||
      - ensure self.stage_prepare() and self.stage_run() are
 | 
			
		||||
         run. [ORDER]
 | 
			
		||||
         - instantiate + overwrite + test
 | 
			
		||||
 | 
			
		||||
   deploy_and_cleanup()
 | 
			
		||||
      - ensure self.deploy_to() + self.cleanup() are are run
 | 
			
		||||
         run. [ORDER]
 | 
			
		||||
         - instantiate + overwrite + test
 | 
			
		||||
 | 
			
		||||
   transfer_object_parameter()
 | 
			
		||||
      - check that object parameters are transferred
 | 
			
		||||
      - paths are setup correctly
 | 
			
		||||
         - test via mock of remote_mkdir and transfer_path
 | 
			
		||||
      - ensure self.remote_mkdir, self.transfer_path are run. [ORDER]
 | 
			
		||||
         - instantiate + overwrite + test
 | 
			
		||||
   
 | 
			
		||||
   transfer_global_explorers()
 | 
			
		||||
      - paths are setup correctly
 | 
			
		||||
         - test via mock of self.remote_mkdir() and self.transfer_path()
 | 
			
		||||
      - ensure self.remote_mkdir, self.transfer_path are run. [ORDER]
 | 
			
		||||
         - instantiate + overwrite + test
 | 
			
		||||
   
 | 
			
		||||
   transfer_type_explorers():
 | 
			
		||||
      - Explorers are not transferred twice
 | 
			
		||||
      - paths are setup correctly
 | 
			
		||||
         - test via mock of self.remote_mkdir() and self.transfer_path()
 | 
			
		||||
      - Explorers are transferred
 | 
			
		||||
         - test via mock of self.remote_mkdir() and self.transfer_path()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
--------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,63 @@
 | 
			
		|||
tests:
 | 
			
		||||
 | 
			
		||||
   __init__():
 | 
			
		||||
      - sets up env: __target_host
 | 
			
		||||
 | 
			
		||||
   run_initial_manifest():
 | 
			
		||||
      - parameter is actually used (from __init__)
 | 
			
		||||
      - ensure changing the manifest actually runs a different manifest
 | 
			
		||||
      -> give ConfigInstall Constructor different manifest
 | 
			
		||||
         -> different manifest is executed.
 | 
			
		||||
      - test all submitted (from core to type manifest) variables:
 | 
			
		||||
         - ENVIRONMENT
 | 
			
		||||
         - they are set
 | 
			
		||||
         - they contain the correct values
 | 
			
		||||
 | 
			
		||||
   run_type_manifest():
 | 
			
		||||
      - test all submitted (from core to type manifest) variables:
 | 
			
		||||
         - ENVIRONMENT
 | 
			
		||||
         - they are set
 | 
			
		||||
         - they contain the correct values
 | 
			
		||||
      - same tests as for test_initial_manifest_*?
 | 
			
		||||
 | 
			
		||||
   run_manifest():
 | 
			
		||||
      - test all submitted variables:
 | 
			
		||||
         - ENVIRONMENT
 | 
			
		||||
            - including __debug, if debug
 | 
			
		||||
         - they are set
 | 
			
		||||
         - they contain the correct values
 | 
			
		||||
      - does $require work?
 | 
			
		||||
      - check that exception raised, if manifest is not existent
 | 
			
		||||
 | 
			
		||||
   object_run():
 | 
			
		||||
      - ensure no object is run twice
 | 
			
		||||
      - ensure requirements are taken into account?
 | 
			
		||||
         - and order of run is adjusted
 | 
			
		||||
      - check (from extern?) that all needed variables are setup
 | 
			
		||||
      - ensure no code-{local, remote} is created, 
 | 
			
		||||
         if gencode is not producing code
 | 
			
		||||
      - ensure THAT code-{local, remote} contains what gencode created
 | 
			
		||||
      - abort if gencode-* fails
 | 
			
		||||
      - abort if code-* fails
 | 
			
		||||
         - abort == raise(FooException)
 | 
			
		||||
      - gencode-*: ensure ENVIRONMENT is setup correctly
 | 
			
		||||
 | 
			
		||||
   run_type_explorer()
 | 
			
		||||
      - ensure ALL type explores have been run
 | 
			
		||||
      - ensure output is saved to correct path
 | 
			
		||||
      - ensure a type with {0,1,2} explorers works ?
 | 
			
		||||
         - none, one, multiple
 | 
			
		||||
      - ensure ENVIRONMENT is setup correctly
 | 
			
		||||
      - fails if ANY of the given explorer fails
 | 
			
		||||
 | 
			
		||||
   run_global_explorers():
 | 
			
		||||
      - ensure ALL type explores have been run
 | 
			
		||||
      - ensure output is saved to correct path
 | 
			
		||||
      - ensure a type with {0,1,2} explorers works ?
 | 
			
		||||
         - none, one, multiple
 | 
			
		||||
      - ensure ENVIRONMENT is setup correctly
 | 
			
		||||
      - fails if ANY of the given explorer fails
 | 
			
		||||
      
 | 
			
		||||
Code fixes needed:
 | 
			
		||||
 | 
			
		||||
   - shutil, os.mkdir, etc. everywhere: catch/reraise exceptions correctly
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,8 +1,5 @@
 | 
			
		|||
Tests needed for config_install:
 | 
			
		||||
 | 
			
		||||
   __init__():
 | 
			
		||||
      - sets up env: __target_host
 | 
			
		||||
 | 
			
		||||
   cleanup()
 | 
			
		||||
      - Fail if cache_dir from previous run cannot be deleted
 | 
			
		||||
      - Fail if cache_dir cannot be created from current out_dir
 | 
			
		||||
| 
						 | 
				
			
			@ -11,120 +8,12 @@ Tests needed for config_install:
 | 
			
		|||
      - ensure logformat is changed: target host is prefixed:
 | 
			
		||||
         LOGLEVEL: target_host: MESSAGE
 | 
			
		||||
 | 
			
		||||
   run_initial_manifest():
 | 
			
		||||
      - parameter is actually used (from __init__)
 | 
			
		||||
      - ensure changing the manifest actually runs a different manifest
 | 
			
		||||
      -> give ConfigInstall Constructor different manifest
 | 
			
		||||
         -> different manifest is executed.
 | 
			
		||||
      - test all submitted (from core to type manifest) variables:
 | 
			
		||||
         - ENVIRONMENT
 | 
			
		||||
         - they are set
 | 
			
		||||
         - they contain the correct values
 | 
			
		||||
 | 
			
		||||
   run_type_manifest():
 | 
			
		||||
      - test all submitted (from core to type manifest) variables:
 | 
			
		||||
         - ENVIRONMENT
 | 
			
		||||
         - they are set
 | 
			
		||||
         - they contain the correct values
 | 
			
		||||
      - same tests as for test_initial_manifest_*?
 | 
			
		||||
 | 
			
		||||
   run_manifest():
 | 
			
		||||
      - test all submitted variables:
 | 
			
		||||
         - ENVIRONMENT
 | 
			
		||||
            - including __debug, if debug
 | 
			
		||||
         - they are set
 | 
			
		||||
         - they contain the correct values
 | 
			
		||||
      - does $require work?
 | 
			
		||||
      - check that exception raised, if manifest is not existent
 | 
			
		||||
 | 
			
		||||
   object_run():
 | 
			
		||||
      - ensure no object is run twice
 | 
			
		||||
      - ensure requirements are taken into account?
 | 
			
		||||
         - and order of run is adjusted
 | 
			
		||||
      - check (from extern?) that all needed variables are setup
 | 
			
		||||
      - ensure no code-{local, remote} is created, 
 | 
			
		||||
         if gencode is not producing code
 | 
			
		||||
      - ensure THAT code-{local, remote} contains what gencode created
 | 
			
		||||
      - abort if gencode-* fails
 | 
			
		||||
      - abort if code-* fails
 | 
			
		||||
         - abort == raise(FooException)
 | 
			
		||||
      - gencode-*: ensure ENVIRONMENT is setup correctly
 | 
			
		||||
 | 
			
		||||
   run_type_explorer()
 | 
			
		||||
      - ensure ALL type explores have been run
 | 
			
		||||
      - ensure output is saved to correct path
 | 
			
		||||
      - ensure a type with {0,1,2} explorers works ?
 | 
			
		||||
         - none, one, multiple
 | 
			
		||||
      - ensure ENVIRONMENT is setup correctly
 | 
			
		||||
      - fails if ANY of the given explorer fails
 | 
			
		||||
 | 
			
		||||
   run_global_explorers():
 | 
			
		||||
      - ensure ALL type explores have been run
 | 
			
		||||
      - ensure output is saved to correct path
 | 
			
		||||
      - ensure a type with {0,1,2} explorers works ?
 | 
			
		||||
         - none, one, multiple
 | 
			
		||||
      - ensure ENVIRONMENT is setup correctly
 | 
			
		||||
      - fails if ANY of the given explorer fails
 | 
			
		||||
      
 | 
			
		||||
   link_emulator():
 | 
			
		||||
      - ensure that links to ALL types are created
 | 
			
		||||
      - ensure that links points to correct executable
 | 
			
		||||
         - i.e. readlink() works
 | 
			
		||||
         - AND target of readlink is the correct executable
 | 
			
		||||
 | 
			
		||||
   stage_run()
 | 
			
		||||
      - ensure that for every object in
 | 
			
		||||
         cdist.core.Object.list_objects() is passed into
 | 
			
		||||
         self.object_run()
 | 
			
		||||
         - instantiate + overwrite + test
 | 
			
		||||
 | 
			
		||||
   object_prepare():
 | 
			
		||||
      - calls (in this order):
 | 
			
		||||
         self.run_type_explorer(cdist_object)
 | 
			
		||||
         self.run_type_manifest(cdist_object)
 | 
			
		||||
         cdist_object.prepared = True
 | 
			
		||||
      - object is prepared after function call
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
   stage_prepare():
 | 
			
		||||
      - calls (in this order):
 | 
			
		||||
         self.link_emulator()
 | 
			
		||||
         self.run_global_explorers()
 | 
			
		||||
         self.run_initial_manifest()
 | 
			
		||||
 | 
			
		||||
      - ensure that all objects are created :-)
 | 
			
		||||
         - as defined in inital manifest + type manifests
 | 
			
		||||
         
 | 
			
		||||
   deploy_to()
 | 
			
		||||
      - ensure self.stage_prepare() and self.stage_run() are
 | 
			
		||||
         run. [ORDER]
 | 
			
		||||
         - instantiate + overwrite + test
 | 
			
		||||
 | 
			
		||||
   deploy_and_cleanup()
 | 
			
		||||
      - ensure self.deploy_to() + self.cleanup() are are run
 | 
			
		||||
         run. [ORDER]
 | 
			
		||||
         - instantiate + overwrite + test
 | 
			
		||||
 | 
			
		||||
   transfer_object_parameter()
 | 
			
		||||
      - check that object parameters are transferred
 | 
			
		||||
      - paths are setup correctly
 | 
			
		||||
         - test via mock of remote_mkdir and transfer_path
 | 
			
		||||
      - ensure self.remote_mkdir, self.transfer_path are run. [ORDER]
 | 
			
		||||
         - instantiate + overwrite + test
 | 
			
		||||
   
 | 
			
		||||
   transfer_global_explorers()
 | 
			
		||||
      - paths are setup correctly
 | 
			
		||||
         - test via mock of self.remote_mkdir() and self.transfer_path()
 | 
			
		||||
      - ensure self.remote_mkdir, self.transfer_path are run. [ORDER]
 | 
			
		||||
         - instantiate + overwrite + test
 | 
			
		||||
   
 | 
			
		||||
   transfer_type_explorers():
 | 
			
		||||
      - Explorers are not transferred twice
 | 
			
		||||
      - paths are setup correctly
 | 
			
		||||
         - test via mock of self.remote_mkdir() and self.transfer_path()
 | 
			
		||||
      - Explorers are transferred
 | 
			
		||||
         - test via mock of self.remote_mkdir() and self.transfer_path()
 | 
			
		||||
 | 
			
		||||
   remote_mkdir()
 | 
			
		||||
      - is directory created
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -136,4 +25,3 @@ Tests needed for config_install:
 | 
			
		|||
 | 
			
		||||
emulator:
 | 
			
		||||
   may only be called with __ as prefix - fail otherwise!
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue