From b54813f3915efa918c0aaef67b4b184fad7abe6d Mon Sep 17 00:00:00 2001 From: Andrei Ismail Date: Sun, 12 Jul 2015 16:42:13 +0300 Subject: [PATCH] #310 Copying the code in /tmp/proxysql-tests before running the test .. so that it can be mounted as a volume inside the docker container. --- test/proxysql_base_test.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/proxysql_base_test.py b/test/proxysql_base_test.py index 22e91f435..7698ed1da 100644 --- a/test/proxysql_base_test.py +++ b/test/proxysql_base_test.py @@ -1,5 +1,7 @@ +import os import random import re +import shutil import subprocess import time from unittest import TestCase @@ -180,6 +182,13 @@ class ProxySQLBaseTest(TestCase): # left them in limbo. cls._shutdown_docker_services() + try: + shutil.rmtree('/tmp/proxysql-tests') + except: + pass + os.mkdir('/tmp/proxysql-tests') + os.system("cp -R " + os.path.dirname(__file__) + "/../* /tmp/proxysql-tests") + cls._startup_docker_services() if cls.INTERACTIVE_TEST: @@ -212,6 +221,8 @@ class ProxySQLBaseTest(TestCase): # in order to debug the problem causing it to crash). cls._stop_proxysql_pings() cls._shutdown_docker_services() + + shutil.rmtree('/tmp/proxysql-tests/') @classmethod def run_query_proxysql(cls, query, db, return_result=True,