Skip to content

Commit

Permalink
Execute step uses provision.execute now
Browse files Browse the repository at this point in the history
  • Loading branch information
leospol committed Oct 31, 2019
1 parent d67b4d1 commit f65dd46
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
7 changes: 3 additions & 4 deletions tmt/steps/execute/__init__.py
Expand Up @@ -53,16 +53,15 @@ def go(self):

def sync_run_sh(self):
""" Place run.sh script to workdir """
# localhost provision does not support sync yet, let's do it here
# TODO: find better way to get source path of run.sh
src_path = os.path.dirname(tmt.steps.execute.__file__)
shutil.copy(os.path.join(src_path, 'run.sh'), self.workdir)
# sync added run.sh to quests
self.plan.provision.sync_workdir_to_guest()

def run(self, *args, **kwargs):
""" """
# temporary disabled till provision has an execute method
# return self.plan.provision.execute(*args, **kwargs)
subprocess.call(*args, **kwargs)
return self.plan.provision.execute(*args, **kwargs)

# API
def requires(self):
Expand Down
3 changes: 0 additions & 3 deletions tmt/steps/execute/base.py
Expand Up @@ -15,9 +15,6 @@ def go(self, plan_workdir):
""" Run tests """
super(ExecutorBase, self).go()

def _run(self, *args, **kwargs):
return self.step.run(*args, **kwargs)

# API
def requires(self):
""" Returns packages required to run tests"""
Expand Down
2 changes: 1 addition & 1 deletion tmt/steps/execute/shell.py
Expand Up @@ -16,7 +16,7 @@ def go(self, plan_workdir):
# we need run.sh synced to workdir
self.step.sync_run_sh()
cmd = f'{self.step.workdir}/run.sh -v {plan_workdir} {self.type}'
self._run(cmd, shell=True)
self.step.run(cmd)

# API
def requires(self):
Expand Down

0 comments on commit f65dd46

Please sign in to comment.