Example #1
0
File: test.py Project: h0wser/p2os
def set_up_container():
    d = Docker()
    curr = os.getcwd()
    try:
        d.pull('allenh1', 'asw_test_env')
    except:
        d.build(os.path.realpath("../docker/Dockerfile"))
    info("Using repo in directory '%s'" % os.path.realpath(".."))
    d.map_directory(os.path.realpath(".."), repo_location)
    return d
Example #2
0
 def regenerate_manifests(self, regen_dict):
     info('Building docker image...')
     docker_file = resource_filename('repoman_docker', 'Dockerfile')
     dock = Docker(docker_file, 'gentoo_repoman')
     dock.build()
     info('Running docker image...')
     info('Generating manifests...')
     dock.map_directory('/home/%s/.gnupg' % os.getenv('USER'),
                        '/root/.gnupg')
     dock.map_directory(self.repo.repo_dir, '/tmp/ros-overlay')
     for key in regen_dict.keys():
         for pkg in regen_dict[key]:
             pkg_dir = '/tmp/ros-overlay/ros-{0}/{1}'.format(key, pkg)
             dock.add_bash_command('cd {0}'.format(pkg_dir))
             dock.add_bash_command('repoman manifest')
             dock.add_bash_command('cd /tmp/ros-overlay')
     dock.run(show_cmd=True)
Example #3
0
 def test_run(self):
     """Test Docker run"""
     docker_instance = Docker()
     docker_instance.build('tests/docker/Dockerfile')
     docker_instance.add_bash_command("echo Hello, docker")
     docker_instance.run()
Example #4
0
 def test_build(self):
     """Test Docker build"""
     docker_instance = Docker()
     with self.assertRaises(NoDockerfileSupplied):
         docker_instance.build('Dockerfile')
     docker_instance.build('tests/docker/Dockerfile')