back to 100% tests working
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
		
					parent
					
						
							
								fb4f8784b6
							
						
					
				
			
			
				commit
				
					
						91ecfa7d3f
					
				
			
		
					 5 changed files with 12 additions and 10 deletions
				
			
		| 
						 | 
					@ -41,14 +41,16 @@ class Emulator(object):
 | 
				
			||||||
        self.object_id      = False
 | 
					        self.object_id      = False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.global_path    = os.environ['__global']
 | 
					        self.global_path    = os.environ['__global']
 | 
				
			||||||
        self.object_source  = os.environ['__cdist_manifest']
 | 
					 | 
				
			||||||
        self.target_host    = os.environ['__target_host']
 | 
					        self.target_host    = os.environ['__target_host']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # Internally only
 | 
				
			||||||
 | 
					        self.object_source  = os.environ['__cdist_manifest']
 | 
				
			||||||
        self.type_base_path = os.environ['__cdist_type_base_path']
 | 
					        self.type_base_path = os.environ['__cdist_type_base_path']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.object_base_path = os.path.join(self.global_path, "object")
 | 
					        self.object_base_path = os.path.join(self.global_path, "object")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.type_name      = os.path.basename(argv[0])
 | 
					        self.type_name      = os.path.basename(argv[0])
 | 
				
			||||||
        self.cdist_type     = core.Type(self.type_base_path, self.type_name)
 | 
					        self.cdist_type     = core.CdistType(self.type_base_path, self.type_name)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.__init_log()
 | 
					        self.__init_log()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -156,7 +158,7 @@ class Emulator(object):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                requirement_type_name, requirement_object_id = core.CdistObject.split_name(requirement)
 | 
					                requirement_type_name, requirement_object_id = core.CdistObject.split_name(requirement)
 | 
				
			||||||
                # Instantiate type which fails if type does not exist
 | 
					                # Instantiate type which fails if type does not exist
 | 
				
			||||||
                requirement_type = core.Type(self.type_base_path, requirement_type_name)
 | 
					                requirement_type = core.CdistType(self.type_base_path, requirement_type_name)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if requirement_object_id:
 | 
					                if requirement_object_id:
 | 
				
			||||||
                    # Validate object_id if any
 | 
					                    # Validate object_id if any
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -143,7 +143,7 @@ class Local(object):
 | 
				
			||||||
    def link_emulator(self, exec_path):
 | 
					    def link_emulator(self, exec_path):
 | 
				
			||||||
        """Link emulator to types"""
 | 
					        """Link emulator to types"""
 | 
				
			||||||
        src = os.path.abspath(exec_path)
 | 
					        src = os.path.abspath(exec_path)
 | 
				
			||||||
        for cdist_type in core.Type.list_types(self.type_path):
 | 
					        for cdist_type in core.CdistType.list_types(self.type_path):
 | 
				
			||||||
            dst = os.path.join(self.bin_path, cdist_type.name)
 | 
					            dst = os.path.join(self.bin_path, cdist_type.name)
 | 
				
			||||||
            self.log.debug("Linking emulator: %s to %s", src, dst)
 | 
					            self.log.debug("Linking emulator: %s to %s", src, dst)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,8 +48,8 @@ class CodeTestCase(test.CdistTestCase):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.remote_base_path = self.mkdtemp()
 | 
					        self.remote_base_path = self.mkdtemp()
 | 
				
			||||||
        self.user = getpass.getuser()
 | 
					        self.user = getpass.getuser()
 | 
				
			||||||
        remote_exec = "ssh -o User=%s -q" % "root" # self.user
 | 
					        remote_exec = "ssh -o User=%s -q" % self.user
 | 
				
			||||||
        remote_copy = "scp -o User=%s -q" % "root" # self.user
 | 
					        remote_copy = "scp -o User=%s -q" % self.user
 | 
				
			||||||
        self.remote = remote.Remote(self.target_host, self.remote_base_path, remote_exec, remote_copy)
 | 
					        self.remote = remote.Remote(self.target_host, self.remote_base_path, remote_exec, remote_copy)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.code = code.Code(self.target_host, self.local, self.remote)
 | 
					        self.code = code.Code(self.target_host, self.local, self.remote)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -49,10 +49,8 @@ class ExplorerClassTestCase(test.CdistTestCase):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.remote_base_path = self.mkdtemp()
 | 
					        self.remote_base_path = self.mkdtemp()
 | 
				
			||||||
        self.user = getpass.getuser()
 | 
					        self.user = getpass.getuser()
 | 
				
			||||||
        #remote_exec = "ssh -o User=%s -q" % self.user
 | 
					        remote_exec = "ssh -o User=%s -q" % self.user
 | 
				
			||||||
        #remote_copy = "scp -o User=%s -q" % self.user
 | 
					        remote_copy = "scp -o User=%s -q" % self.user
 | 
				
			||||||
        remote_exec = "ssh -o User=%s -q" % "root"
 | 
					 | 
				
			||||||
        remote_copy = "scp -o User=%s -q" % "root"
 | 
					 | 
				
			||||||
        self.remote = remote.Remote(self.target_host, self.remote_base_path, remote_exec, remote_copy)
 | 
					        self.remote = remote.Remote(self.target_host, self.remote_base_path, remote_exec, remote_copy)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.explorer = explorer.Explorer(self.target_host, self.local, self.remote)
 | 
					        self.explorer = explorer.Explorer(self.target_host, self.local, self.remote)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -25,6 +25,8 @@ import shutil
 | 
				
			||||||
from cdist import test
 | 
					from cdist import test
 | 
				
			||||||
from cdist import core
 | 
					from cdist import core
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import cdist
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import os.path as op
 | 
					import os.path as op
 | 
				
			||||||
my_dir = op.abspath(op.dirname(__file__))
 | 
					my_dir = op.abspath(op.dirname(__file__))
 | 
				
			||||||
fixtures = op.join(my_dir, 'fixtures')
 | 
					fixtures = op.join(my_dir, 'fixtures')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue