|
16 | 16 |
|
17 | 17 | RPC_BACKEND=$1
|
18 | 18 |
|
| 19 | +function generate_testr_results { |
| 20 | + if [ -f .testrepository/0 ]; then |
| 21 | + sudo .tox/py27-func-${RPC_BACKEND}/bin/testr last --subunit > $WORKSPACE/testrepository.subunit |
| 22 | + sudo mv $WORKSPACE/testrepository.subunit $BASE/logs/testrepository.subunit |
| 23 | + sudo .tox/py27-func-${RPC_BACKEND}/bin/python /usr/local/jenkins/slave_scripts/subunit2html.py $BASE/logs/testrepository.subunit $BASE/logs/testr_results.html |
| 24 | + sudo gzip -9 $BASE/logs/testrepository.subunit |
| 25 | + sudo gzip -9 $BASE/logs/testr_results.html |
| 26 | + sudo chown jenkins:jenkins $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz |
| 27 | + sudo chmod a+r $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz |
| 28 | + fi |
| 29 | +} |
| 30 | + |
| 31 | +# Allow jenkins to retrieve reports |
| 32 | +sudo chown -R jenkins:stack $BASE/new/oslo.messaging |
| 33 | + |
| 34 | +set +e |
| 35 | + |
| 36 | +# Install required packages |
19 | 37 | case $RPC_BACKEND in
|
20 |
| - amqp1|qpid) |
21 |
| - # Ensure authentification works before continuing, otherwise tests |
22 |
| - # will retries forever |
23 |
| - sudo yum install -y qpid-tools |
24 |
| - qpid-config --sasl-mechanism=PLAIN -a stackqpid/ [email protected] |
| 38 | + zeromq) |
| 39 | + sudo apt-get update -y |
| 40 | + sudo apt-get install -y redis-server python-redis |
| 41 | + ;; |
| 42 | + qpid) |
| 43 | + sudo apt-get update -y |
| 44 | + sudo apt-get install -y qpidd sasl2-bin |
| 45 | + ;; |
| 46 | + amqp1) |
| 47 | + # qpid-tools is needed to ensure authentification works before |
| 48 | + # starting tests, otherwise tests will retries forever |
| 49 | + sudo yum install -y qpid-cpp-server qpid-proton-c-devel python-qpid-proton cyrus-sasl-lib cyrus-sasl-plain |
| 50 | + ;; |
| 51 | + rabbit) |
| 52 | + sudo apt-get update -y |
| 53 | + sudo apt-get install -y rabbitmq-server |
25 | 54 | ;;
|
26 | 55 | esac
|
27 | 56 |
|
| 57 | +# Got to the oslo.messaging dir |
28 | 58 | cd $BASE/new/oslo.messaging
|
29 |
| -sudo -H -u stack tox -e py27-func-$RPC_BACKEND |
| 59 | + |
| 60 | +# Run tests |
| 61 | +echo "Running oslo.messaging functional test suite" |
| 62 | +# Preserve env for OS_ credentials |
| 63 | +sudo -E -H -u jenkins tox -e py27-func-$RPC_BACKEND |
| 64 | +EXIT_CODE=$? |
| 65 | +set -e |
| 66 | + |
| 67 | +# Collect and parse result |
| 68 | +generate_testr_results |
| 69 | +exit $EXIT_CODE |
0 commit comments