Пример #1
0
 def test_get_docker_env_2(self, fake_check_output, fake_config_value):
     fake_config_value.return_value = 'root'
     fake_check_output.return_value = """Variables are already set"""
     expected = {'DOCKER_TLS_VERIFY': '1',
                 'DOCKER_HOST': 'tcp://192.168.59.103:2376',
                 'DOCKER_CERT_PATH': '/Users/root/.boot2docker/certs/boot2docker-vm'}
     result = get_docker_env()
     self.assertItemsEqual(result, expected)
Пример #2
0
 def test_get_docker_env_2(self, fake_check_output, fake_config_value):
     fake_config_value.return_value = 'root'
     fake_check_output.return_value = """    export DOCKER_TLS_VERIFY=1
     export DOCKER_HOST=tcp://192.168.59.103:2376
     export DOCKER_CERT_PATH=/Users/root/.docker/machine/machines/dusty/cert.pem"""
     expected = {'DOCKER_TLS_VERIFY': '1',
                 'DOCKER_HOST': 'tcp://192.168.59.103:2376',
                 'DOCKER_CERT_PATH': '/Users/root/.docker/machine/machines/dusty/cert.pem'}
     result = get_docker_env()
     self.assertItemsEqual(result, expected)
Пример #3
0
 def test_get_docker_env_2(self, fake_check_output, fake_config_value):
     fake_config_value.return_value = 'root'
     fake_check_output.return_value = """    export DOCKER_TLS_VERIFY=1
     export DOCKER_HOST=tcp://192.168.59.103:2376
     export DOCKER_CERT_PATH=/Users/root/.docker/machine/machines/dusty/cert.pem"""
     expected = {
         'DOCKER_TLS_VERIFY':
         '1',
         'DOCKER_HOST':
         'tcp://192.168.59.103:2376',
         'DOCKER_CERT_PATH':
         '/Users/root/.docker/machine/machines/dusty/cert.pem'
     }
     result = get_docker_env()
     self.assertItemsEqual(result, expected)
Пример #4
0
 def exec_docker_patch(self, *args):
     docker_executable = subprocess.check_output('which docker', shell=True).rstrip('\n')
     args = [docker_executable] + [a for a in args]
     self.exec_docker_processes.append(subprocess.Popen(args=args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=get_docker_env()))
Пример #5
0
 def exec_docker_patch(self, *args):
     docker_executable = subprocess.check_output("which docker", shell=True).rstrip("\n")
     args = [docker_executable] + [a for a in args]
     self.exec_docker_processes.append(
         subprocess.Popen(args=args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=get_docker_env())
     )