mirror of
https://github.com/apache/impala.git
synced 2025-12-19 18:12:08 -05:00
IMPALA-12471 PART-2: Add check for mysqld socket file
This patch adds a check for the existance of mysqld.sock file in directory: /var/run/mysqld/ inside the mysqld docker container. If the file is not present then the test is skipped. Testing: tested manually with and without the mysqld.sock file. Change-Id: I393fd03fa6efd4c11781d219f66978a4f556c668 Reviewed-on: http://gerrit.cloudera.org:8080/20780 Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
committed by
Impala Public Jenkins
parent
b03e8ef95c
commit
aeb9a82060
7
testdata/bin/setup-mysql-env.sh
vendored
7
testdata/bin/setup-mysql-env.sh
vendored
@@ -53,6 +53,13 @@ if [ $mysqld_status = "stopped" ];then
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Check if mysqld.sock exists
|
||||
if [ $(docker exec -i mysql ls /var/run/mysqld/mysqld.sock > /dev/null 2>&1;\
|
||||
echo $?) -gt 0 ]; then
|
||||
echo "Error: File /var/run/mysqld/mysqld.sock not found"
|
||||
exit 30
|
||||
fi
|
||||
|
||||
# Add permission to mysql socket file
|
||||
docker exec -i mysql chmod 777 /var/run/mysqld/mysqld.sock
|
||||
|
||||
|
||||
@@ -81,6 +81,8 @@ class TestMySqlExtJdbcTables(CustomClusterTestSuite):
|
||||
pytest.skip("These tests requireadd the docker to be added to sudoer's group")
|
||||
elif e.returncode == 20:
|
||||
pytest.skip("Can't connect to local MySQL server")
|
||||
elif e.returncode == 30:
|
||||
pytest.skip("File /var/run/mysqld/mysqld.sock not found")
|
||||
else:
|
||||
assert False, "Failed to setup MySQL testing environment"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user