+- job-template:
+ name: set-functest-env-{installer}-{stream}
+
+ project-type: freestyle
+
+ node: '{node}'
+
+ logrotate:
+ daysToKeep: 30
+ numToKeep: 10
+ artifactDaysToKeep: -1
+ artifactNumToKeep: -1
+
+ builders:
+ - shell: |
+ #!/bin/bash
+ set +e
+
+ echo "Functest: prepare Functest environment"
+ mkdir -p $HOME/functest/
+ # source openstack vars
+ if [[ ! -f $HOME/opnfv-openrc.sh ]]; then
+ echo "Unable to access file $HOME/opnfv-openrc.sh"
+ exit 1
+ fi
+ source $HOME/opnfv-openrc.sh
+
+ # WORKSPACE is the root of the functest repo
+ # go into WORKSPACE where the functest repo is cloned
+ cd $WORKSPACE
+
+ # prepare
+ echo "Functest: prepare Functest environment"
+ python $WORKSPACE/testcases/config_functest.py --debug $WORKSPACE/ start
+
+- job-template:
+ name: clean-functest-env-{installer}-{stream}
+
+ project-type: freestyle
+
+ node: '{node}'
+
+ logrotate:
+ daysToKeep: 30
+ numToKeep: 10
+ artifactDaysToKeep: -1
+ artifactNumToKeep: -1
+
+ builders:
+ - shell: |
+ #!/bin/bash
+ set +e
+
+ # collect results
+ echo "Functest: copy results and clean Functest environment"
+ mkdir -p $HOME/functest/results
+
+ # save ODL results
+ cp -Rf $WORSPACE/testcases/Controllers/ODL/CI/logs $HOME/functest/results/ODL
+
+ # save tempest.conf for further troubleshooting
+ cp $HOME/.rally/tempest/for-deployment-*/tempest.conf $HOME/functest/results
+
+ # cleanup
+ python $WORKSPACE/testcases/config_functest.py --debug --force $WORKSPACE/ clean
+