~heber013/ubuntu-system-tests/add-install-package-option

« back to all changes in this revision

Viewing changes to ubuntu_system_tests/host/targets.py

  • Committer: Heber Parrucci
  • Date: 2018-02-15 21:48:06 UTC
  • Revision ID: heber.parrucci@canonical.com-20180215214806-aenfkgp22eqak779
Adding option to install packages as part of the setup

Show diffs side-by-side

added added

removed removed

Lines of Context:
160
160
            result.status = 1
161
161
        return result
162
162
 
163
 
    def _push_setup_script(self):
 
163
    def push_setup_script(self, script='target_setup.py'):
164
164
        src = os.path.join(
165
 
            os.path.dirname(os.path.realpath(__file__)), 'target_setup.py')
166
 
        dst = os.path.join('/tmp/target_setup.py')
 
165
            os.path.dirname(os.path.realpath(__file__)), script)
 
166
        dst = os.path.join('/tmp/{}'.format(script))
167
167
        self.put(src, dst)
168
168
        if self.run_sudo('chmod 744 {}'.format(dst)).status:
169
169
            raise RuntimeError(
178
178
            self.put(src, '/tmp/target_config.json')
179
179
 
180
180
    def _run_target_setup(self):
181
 
        self._push_setup_script()
 
181
        self.push_setup_script()
182
182
        self._push_setup_config()
183
183
        command = '/usr/bin/python3 /tmp/target_setup.py --config_path /tmp/target_config.json ' \
184
184
                  '--username %s' % self.config_stack.get('device_username')