Commit fb7b7a86 authored by Łukasz Nowak's avatar Łukasz Nowak Committed by Łukasz Nowak

_testSQLBench: Use upcoming key from SlapOS

SlapOS will publish directly SQLBENCH_PATH in environment, so
start using it also trusting that PATH is correctly set to find proper perl,
with fetching old OPENSSL_BINARY and finding perl in the old wayas fallback.
parent 0a358cec
...@@ -43,17 +43,21 @@ class TestSQLBench(unittest.TestCase): ...@@ -43,17 +43,21 @@ class TestSQLBench(unittest.TestCase):
sql_connection_string = os.environ['erp5_sql_connection_string'] sql_connection_string = os.environ['erp5_sql_connection_string']
database_and_server, user, password = sql_connection_string.split(' ') database_and_server, user, password = sql_connection_string.split(' ')
database, host = database_and_server.split('@') database, host = database_and_server.split('@')
software_home = os.environ['OPENSSL_BINARY'].replace( sqlbench_path = os.environ.get('SQLBENCH_PATH')
"parts/openssl/bin/openssl", "") if not sqlbench_path:
mariadb_folder = software_home + '/parts/mariadb' software_home = os.environ['OPENSSL_BINARY'].replace(
perl_command = software_home + "/parts/perl/bin/perl" "parts/openssl/bin/openssl", "")
sqlbench_path = software_home + '/parts/mariadb/sql-bench'
perl_command = software_home + "/parts/perl/bin/perl"
else:
perl_command = 'perl'
command_list = [perl_command, command_list = [perl_command,
mariadb_folder + '/sql-bench/test-alter-table', sqlbench_path + '/test-alter-table',
'--database', database, '--database', database,
'--host', host, '--user', user, '--password', password] '--host', host, '--user', user, '--password', password]
print command_list print command_list
process = subprocess.Popen(command_list, process = subprocess.Popen(command_list,
cwd = mariadb_folder + '/sql-bench/', cwd = sqlbench_path,
stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, error = process.communicate() output, error = process.communicate()
self.assertEqual(0, len(error), error) self.assertEqual(0, len(error), error)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment