minor fix: run tests in python venv

Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
This commit is contained in:
Shilpa Jagannath 2020-04-30 12:37:33 +05:30
parent 0270dc4aaa
commit 71b657b9d2
3 changed files with 19 additions and 16 deletions

View File

@ -2,4 +2,4 @@ tasks:
- workunit:
clients:
client.0:
- rgw/test_rgw_reshard.py
- rgw/run-reshard.sh

18
qa/workunits/rgw/run-reshard.sh Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -ex
#assume working ceph environment (radosgw-admin in path) and rgw on localhost:80
mydir=`dirname $0`
python3 -m venv $mydir
source $mydir/bin/activate
pip install pip --upgrade
pip install boto3
## run test
$mydir/bin/python3 $mydir/test_rgw_reshard.py
deactivate
echo OK.

View File

@ -48,21 +48,6 @@ def exec_cmd(cmd):
return False
def install_reqs():
out = exec_cmd('cat /etc/*release')
result = {}
for row in out.decode('utf8').split('\n'):
if '=' in row:
k, v = row.split('=')
result[k.strip()] = v.strip('""')
if result['NAME'] == 'Ubuntu':
exec_cmd('sudo apt install -y python3-pip')
else:
exec_cmd('sudo yum install -y python3-pip')
exec_cmd('sudo pip3 install boto3')
install_reqs()
import boto3