RUN apt-get update && apt-get install -y \
ssh \
sshpass \
+curl \
git \
gcc \
wget \
python-dev \
python-pip \
+bundler \
postgresql \
build-essential \
libpq-dev \
RUN git clone https://gerrit.opnfv.org/gerrit/releng ${repos_dir}/releng
RUN git clone https://github.com/openstack/rally.git ${repos_dir}/rally
RUN git clone https://github.com/opendaylight/integration.git ${repos_dir}/odl_integration
+RUN git clone -b stable https://github.com/boucherv-orange/clearwater-live-test ${repos_dir}/vims-test
RUN pip install -r ${repos_dir}/functest/docker/requirements.pip
+RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
+RUN curl -L https://get.rvm.io | bash -s stable
+RUN bash -c 'source /etc/profile.d/rvm.sh ; rvm autolibs enable ; rvm install 1.9.3 ; rvm use 1.9.3'
+RUN bash -c 'source /etc/profile.d/rvm.sh ; cd ${repos_dir}/vims-test ; bundle install'
+
ADD http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img /home/opnfv/functest/data/
+
FUNCTEST_REPO_DIR=$(cat $config_file | grep -w dir_repo_functest | awk 'END {print $NF}')
RALLY_REPO_DIR=$(cat $config_file | grep -w dir_repo_rally | awk 'END {print $NF}')
RELENG_REPO_DIR=$(cat $config_file | grep -w dir_repo_releng | awk 'END {print $NF}')
+VIMS_REPO_DIR=$(cat $config_file | grep -w dir_repo_vims_test | awk 'END {print $NF}')
FUNCTEST_DIR=$(cat $config_file | grep -w dir_functest | awk 'END {print $NF}')
FUNCTEST_RESULTS_DIR=$(cat $config_file | grep -w dir_results | awk 'END {print $NF}')
FUNCTEST_COMMIT=$(cat $config_file | grep -w functest_commit | awk 'END {print $NF}')
RELENG_BRANCH=$(cat $config_file | grep -w releng_branch | awk 'END {print $NF}')
RELENG_COMMIT=$(cat $config_file | grep -w releng_commit | awk 'END {print $NF}')
+VIMS_BRANCH=$(cat $config_file | grep -w vims_test_branch | awk 'END {print $NF}')
+VIMS_COMMIT=$(cat $config_file | grep -w vims_test_commit | awk 'END {print $NF}')
echo "_____Parsed needed data from ${config_file}:"
echo "####### Directories #######"
echo "FUNCTEST_REPO_DIR=${FUNCTEST_REPO_DIR}"
echo "RALLY_REPO_DIR=${RALLY_REPO_DIR}"
echo "RELENG_REPO_DIR=${RELENG_REPO_DIR}"
+echo "VIMS_REPO_DIR=${VIMS_REPO_DIR}"
echo "FUNCTEST_DIR=${FUNCTEST_DIR}"
echo "FUNCTEST_RESULTS_DIR=${FUNCTEST_RESULTS_DIR}"
echo "FUNCTEST_CONF_DIR=${FUNCTEST_CONF_DIR}"
echo "RELENG_COMMIT=${RELENG_COMMIT}"
echo "RALLY_BRANCH=${RALLY_BRANCH}"
echo "RALLY_COMMIT=${RALLY_COMMIT}"
+echo "VIMS_BRANCH=${VIMS_BRANCH}"
+echo "VIMS_COMMIT=${VIMS_COMMIT}"
echo "############################"
info () {
cd ${RALLY_REPO_DIR}
info "Rally repo: pulling to latest..."
git pull
+
+ info "Updating vIMS test repository...."
+ cd ${VIMS_REPO_DIR}
+ if [ ${VIMS_BRANCH} != "stable" ]; then
+ info "Releng repo: checkout ${VIMS_TEST_BRANCH} branch..."
+ git checkout ${VIMS_BRANCH}
+ fi
+ info "vIMS test repo: pulling to latest..."
+ git pull
+ if [ ${VIMS_COMMIT} != "latest" ]; then
+ info "vIMS test repo: given commit is ${VIMS_TEST_COMMIT}. Reseting..."
+ git reset --hard ${VIMS_COMMIT}
+ fi
+
fi
# We do this regardless if its online or offline mode.
dir_repo_functest: /home/opnfv/repos/functest
dir_repo_rally: /home/opnfv/repos/rally
dir_repo_releng: /home/opnfv/repos/releng
+ dir_repo_vims_test: /home/opnfv/repos/vims-test
dir_functest: /home/opnfv/functest
dir_results: /home/opnfv/functest/results
dir_functest_conf: /home/opnfv/functest/conf
releng_commit: latest
rally_branch: master
rally_commit: 9a17d8490e7fb4afee2f5629e6db41eabe4bc4d4
+ vims_test_branch: stable
+ vims_test_commit: latest
openstack:
image_name: functest-img
import urllib2
import subprocess
import sys
+import requests
+import json
from git import Repo
installer = "Unkown"
return installer
+
+def push_results_to_db(db_url, case_name, logger, pod_name, git_version, payload):
+ url = db_url + "/results"
+ installer = get_installer_type(logger)
+ params = {"project_name": "functest", "case_name": case_name,
+ "pod_name": pod_name, "installer": installer,
+ "version": git_version, "details": payload}
+
+ headers = {'Content-Type': 'application/json'}
+ try:
+ r = requests.post(url, data=json.dumps(params), headers=headers)
+ logger.debug(r)
+ return True
+ except:
+ print "Error:", sys.exc_info()[0]
+ return False
"Network '%s' deleted successfully" % NEUTRON_PRIVATE_NET_NAME)
return True
-
-def push_results_to_db(payload):
-
- url = TEST_DB + "/results"
- installer = functest_utils.get_installer_type(logger)
- git_version = functest_utils.get_git_branch(args.repo_path)
- # TODO pod_name hardcoded, info shall come from Jenkins
- params = {"project_name": "functest", "case_name": "vPing",
- "pod_name": "opnfv-jump-2", "installer": installer,
- "version": git_version, "details": payload}
-
- headers = {'Content-Type': 'application/json'}
- r = requests.post(url, data=json.dumps(params), headers=headers)
- logger.debug(r)
-
-
def main():
creds_nova = functest_utils.get_credentials("nova")
if args.report:
logger.debug("Push result into DB")
# TODO check path result for the file
- push_results_to_db(
- {'timestart': start_time_ts, 'duration': duration,
+ git_version = functest_utils.get_git_branch(args.repo_path)
+ functest_utils.push_results_to_db(db_url=TEST_DB, case_name="vPing",
+ logger=logger, pod_name="opnfv-jump-2", git_version=git_version,
+ payload={'timestart': start_time_ts, 'duration': duration,
'status': test_status})
# with open("vPing-result.json", "w") as outfile:
# json.dump({'timestart': start_time_ts, 'duration': duration,