Exemplo n.º 1
0
 def setUpClass(cls):
     print(
         ' \n >>>> ==== Running Test 3 - Verify Compose with secret, postgres, custom-extensions'
         + ' ===== ')
     print(' >>>> ==== using IMAGE = ' + cls.docker_image + ' ===== ')
     DockerUtil.empty_test_folder("tmp")
     # Setup test dir as volume to by mounted by container
     # exts =  DockerUtil.create_test_dir("tmp/exts")
     if os.name == 'nt':
         DockerUtil.create_test_dir("tmp\\exts")
         os.system('copy /y .\\testdata\\*.zip .\\tmp\\exts')
         os.system('copy /y .\\testdata\\secret.properties .\\tmp')
     else:
         DockerUtil.create_test_dir("tmp/exts")
         os.system('cp ./testdata/*.zip ./tmp/exts/')
         os.system('cp ./testdata/secret.properties ./tmp/')
     DockerUtil.generate_compose_yml(cls.test_yml, cls.docker_image)
     # Run docker compose
     os.system(cls.composeCmd + " up -d")
     client = docker.from_env()
     cls.container = client.containers.get("mctest3_mc_1")
     # wait for MC to come up
     try:
         DockerUtil.wait_for_containers([cls.container], cls.max_wait_time)
     except Exception, e:
         print(">>>> MC server failed to start")
         cls.tearDownClass()
         raise e
    def setUpClass(cls):
        print(' \n >>>> ==== Running Test Keystore - Verify Compose with keystore download HTTP' + ' ===== ') 
        print( ' >>>> ==== using IMAGE = ' + cls.docker_image + ' ===== ')
        DockerUtil.empty_test_folder("tmp")

        # Setup test dir as volume to by mounted by container
        if os.name == 'nt':
            DockerUtil.create_test_dir("tmp")
            os.system('xcopy /E /I /Y .\\testdata\\web .\\tmp\\web')
        else:
            DockerUtil.create_test_dir("tmp")
            os.system('cp -r ./testdata/web ./tmp/web')
        DockerUtil.generate_compose_yml(cls.test_yml, cls.docker_image, 'keystore-http.yml')
        
        # Run docker compose
        os.system(cls.composeCmd + " up -d")
        client = docker.from_env()
        cls.container = client.containers.get("mctest_keystore_http_mc_1")
Exemplo n.º 3
0
 def setUpClass(cls):
     print(' \n >>>> ==== Running Test 2 - Verify Mounted Volume')
     print(' >>>> ==== using IMAGE = ' + cls.docker_image + ' ===== ')
     DockerUtil.empty_test_folder("tmp")
     # Setup test dir as volume to by mounted by container
     appdata = DockerUtil.create_test_dir("tmp/appdata")
     exts = DockerUtil.create_test_dir("tmp/extensions")
     mount = {}
     mount[appdata] = {'bind': '/opt/connect/appdata', 'mode': 'rw'}
     mount[exts] = {'bind': '/opt/connect/custom-extensions', 'mode': 'ro'}
     # run docker image with -v option
     client = docker.from_env()
     cls.container = client.containers.run(cls.docker_image,
                                           volumes=mount,
                                           detach=True,
                                           name="mctest2")
     # wait for MC to come up
     try:
         DockerUtil.wait_for_containers([cls.container], 60)
     except Exception, e:
         print(">>>> MC server failed to start")
         cls.tearDownClass()
         raise e