Functest: add support to pass custom parameters to docker 91/13491/1
authorCiprian Barbu <ciprian.barbu@enea.com>
Mon, 2 May 2016 11:48:07 +0000 (14:48 +0300)
committerCiprian Barbu <ciprian.barbu@enea.com>
Mon, 2 May 2016 11:48:07 +0000 (14:48 +0300)
This makes it possible to pass extra environments or volumes to docker
by listing them in a file at ${HOME}/opnfv/functest/custom/params_${DOCKER_TAG}.
This way different parameter (env vars and volumes) can be specified for stable
and master.

Change-Id: I010fae9802dd413f0ca6ae9fb3ef0f03b81db3c2
Signed-off-by: Ciprian Barbu <ciprian.barbu@enea.com>
jjb/functest/functest-ci-jobs.yml

index 0ee73b0..8bcf4c9 100644 (file)
             mkdir -p ${dir_result}
             sudo rm -rf ${dir_result}/*
             res_volume="-v ${dir_result}:/home/opnfv/functest/results"
+            custom_params=
+            test -f ${HOME}/opnfv/functest/custom/params_${DOCKER_TAG} && custom_params=$(cat ${HOME}/opnfv/functest/custom/params_${DOCKER_TAG})
 
             echo "Functest: Pulling image opnfv/functest:${DOCKER_TAG}"
             docker pull opnfv/functest:$DOCKER_TAG >${redirect}
 
-            cmd="sudo docker run --privileged=true -id ${envs} ${labconfig} ${sshkey} ${res_volume} opnfv/functest:${DOCKER_TAG} /bin/bash"
+            cmd="sudo docker run --privileged=true -id ${envs} ${labconfig} ${sshkey} ${res_volume} ${custom_params} opnfv/functest:${DOCKER_TAG} /bin/bash"
             echo "Functest: Running docker run command: ${cmd}"
             ${cmd} >${redirect}
             docker ps -a >${redirect}