diff options
Diffstat (limited to 'scripts/run_test.sh')
-rwxr-xr-x | scripts/run_test.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/scripts/run_test.sh b/scripts/run_test.sh new file mode 100755 index 0000000..ca6c6b6 --- /dev/null +++ b/scripts/run_test.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# Copyright (c) 2019 PANTHEON.tech. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +IMAGE="sweetcomb_img" +CONTAINER="sweetcomb_test" + +FIND=`docker container ls -a | grep ${CONTAINER}` +if [ -n "${FIND}" ]; then + echo "Remove previous test container" + docker stop ${CONTAINER} > /dev/null + docker rm ${CONTAINER} -f > /dev/null +fi + +FIND=`docker images | grep ${IMAGE}` +if [ -z "${FIND}" ]; then + ./scripts/docker.sh +fi + +echo "Start container" +docker run -id --privileged --name ${CONTAINER} ${IMAGE} +docker cp . ${CONTAINER}:/root/src/sweetcomb +docker exec -it ${CONTAINER} bash -c " + cd /root/src/sweetcomb && + make build-scvpp && + make build-plugins" +if [ "$?" == 0 ]; then + echo "Run tests" + docker exec -it ${CONTAINER} bash -c " + echo -e \"0000\n0000\" | passwd + mkdir /var/log/vpp" +fi + +docker exec -it ${CONTAINER} bash -c "/root/src/sweetcomb/test/run_test.py"
\ No newline at end of file |