diff options
-rw-r--r-- | jjb/apex/apex.yml | 15 | ||||
-rw-r--r-- | jjb/apex/apex.yml.j2 | 15 | ||||
-rw-r--r-- | jjb/armband/armband-ci-jobs.yml | 4 | ||||
-rw-r--r-- | jjb/bottlenecks/bottlenecks-run-suite.sh | 58 | ||||
-rw-r--r-- | jjb/calipso/calipso.yml | 2 | ||||
-rw-r--r-- | jjb/daisy4nfv/daisy-daily-jobs.yml | 4 | ||||
-rw-r--r-- | jjb/fuel/fuel-daily-jobs.yml | 6 | ||||
-rw-r--r-- | jjb/functest/functest-alpine.sh | 4 | ||||
-rwxr-xr-x | jjb/functest/set-functest-env.sh | 12 | ||||
-rw-r--r-- | jjb/global/slave-params.yml | 14 | ||||
-rw-r--r-- | jjb/snaps/snaps-verify-jobs.yml (renamed from jjb/snaps/snaps.yml) | 21 | ||||
-rw-r--r-- | jjb/storperf/storperf-daily-jobs.yml | 175 | ||||
-rw-r--r-- | jjb/storperf/storperf.yml | 72 | ||||
-rw-r--r-- | utils/create_pod_file.py | 4 | ||||
-rwxr-xr-x | utils/fetch_os_creds.sh | 2 | ||||
-rw-r--r-- | utils/test/testapi/opnfv_testapi/resources/scenario_models.py | 30 | ||||
-rw-r--r-- | utils/test/testapi/opnfv_testapi/tests/unit/resources/scenario-c2.json | 4 | ||||
-rw-r--r-- | utils/test/testapi/opnfv_testapi/tests/unit/resources/test_scenario.py | 5 |
18 files changed, 341 insertions, 106 deletions
diff --git a/jjb/apex/apex.yml b/jjb/apex/apex.yml index 07181fcad..f0e0535ea 100644 --- a/jjb/apex/apex.yml +++ b/jjb/apex/apex.yml @@ -582,7 +582,7 @@ concurrent: true disabled: false - + quiet-period: 30 scm: - git-scm-gerrit @@ -617,6 +617,7 @@ - 'functest.*' - 'yardstick.*' - 'dovetail.*' + - 'storperf.*' - throttle: max-per-node: 1 max-total: 10 @@ -778,6 +779,18 @@ enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|nosdn-kvm|odl_l3-fdio)-ha/" abort-all-job: false git-revision: false + - multijob: + name: StorPerf + condition: ALWAYS + projects: + - name: 'storperf-apex-baremetal-daily-{scenario_stream}' + node-parameters: true + current-parameters: false + predefined-parameters: + DEPLOY_SCENARIO=$DEPLOY_SCENARIO + kill-phase-on: NEVER + abort-all-job: false + git-revision: false # Build status is always success due conditional plugin prefetching # build status before multijob phases execute # - conditional-step: diff --git a/jjb/apex/apex.yml.j2 b/jjb/apex/apex.yml.j2 index 2d760f854..5a44dbc00 100644 --- a/jjb/apex/apex.yml.j2 +++ b/jjb/apex/apex.yml.j2 @@ -494,7 +494,7 @@ concurrent: true disabled: false - + quiet-period: 30 scm: - git-scm-gerrit @@ -529,6 +529,7 @@ - 'functest.*' - 'yardstick.*' - 'dovetail.*' + - 'storperf.*' - throttle: max-per-node: 1 max-total: 10 @@ -690,6 +691,18 @@ enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|nosdn-kvm|odl_l3-fdio)-ha/" abort-all-job: false git-revision: false + - multijob: + name: StorPerf + condition: ALWAYS + projects: + - name: 'storperf-apex-baremetal-daily-{scenario_stream}' + node-parameters: true + current-parameters: false + predefined-parameters: + DEPLOY_SCENARIO=$DEPLOY_SCENARIO + kill-phase-on: NEVER + abort-all-job: false + git-revision: false # Build status is always success due conditional plugin prefetching # build status before multijob phases execute # - conditional-step: diff --git a/jjb/armband/armband-ci-jobs.yml b/jjb/armband/armband-ci-jobs.yml index a5d75bdca..cdc14e4e0 100644 --- a/jjb/armband/armband-ci-jobs.yml +++ b/jjb/armband/armband-ci-jobs.yml @@ -292,11 +292,11 @@ - trigger: name: 'fuel-os-nosdn-nofeature-ha-armband-baremetal-master-trigger' triggers: - - timed: '' + - timed: '0 1 * * *' - trigger: name: 'fuel-os-odl_l3-nofeature-ha-armband-baremetal-master-trigger' triggers: - - timed: '' + - timed: '0 16 * * *' - trigger: name: 'fuel-os-odl_l2-bgpvpn-ha-armband-baremetal-master-trigger' triggers: diff --git a/jjb/bottlenecks/bottlenecks-run-suite.sh b/jjb/bottlenecks/bottlenecks-run-suite.sh index 6bab0e4d2..341aab590 100644 --- a/jjb/bottlenecks/bottlenecks-run-suite.sh +++ b/jjb/bottlenecks/bottlenecks-run-suite.sh @@ -19,9 +19,12 @@ git clone https://gerrit.opnfv.org/gerrit/releng ${RELENG_REPO} >${redirect} OPENRC=/tmp/admin_rc.sh OS_CACERT=/tmp/os_cacert +BOTTLENECKS_CONFIG=/tmp + if [[ $SUITE_NAME == *posca* ]]; then POSCA_SCRIPT=/home/opnfv/bottlenecks/testsuites/posca + # Preparing OpenStack RC and Cacert files echo "BOTTLENECKS INFO: fetching os credentials from $INSTALLER_TYPE" if [[ $INSTALLER_TYPE == 'compass' ]]; then if [[ ${BRANCH} == 'master' ]]; then @@ -49,6 +52,60 @@ if [[ $SUITE_NAME == *posca* ]]; then exit 1 fi + # Finding and crearting POD description files from different deployments + ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + + if [ "$INSTALLER_TYPE" == "fuel" ]; then + echo "Fetching id_rsa file from jump_server $INSTALLER_IP..." + sshpass -p r00tme sudo scp $ssh_options root@${INSTALLER_IP}:~/.ssh/id_rsa ${BOTTLENECKS_CONFIG}/id_rsa + fi + + if [ "$INSTALLER_TYPE" == "apex" ]; then + echo "Fetching id_rsa file from jump_server $INSTALLER_IP..." + sudo scp $ssh_options stack@${INSTALLER_IP}:~/.ssh/id_rsa ${BOTTLENECKS_CONFIG}/id_rsa + fi + + set +e + + sudo pip install virtualenv + + cd ${RELENG_REPO}/modules + sudo virtualenv venv + source venv/bin/activate + sudo pip install -e ./ >/dev/null + sudo pip install netaddr + + if [[ ${INSTALLER_TYPE} == compass ]]; then + options="-u root -p root" + elif [[ ${INSTALLER_TYPE} == fuel ]]; then + options="-u root -p r00tme" + elif [[ ${INSTALLER_TYPE} == apex ]]; then + options="-u stack -k /root/.ssh/id_rsa" + else + echo "Don't support to generate pod.yaml on ${INSTALLER_TYPE} currently." + fi + + cmd="sudo python ${RELENG_REPO}/utils/create_pod_file.py -t ${INSTALLER_TYPE} \ + -i ${INSTALLER_IP} ${options} -f ${BOTTLENECKS_CONFIG}/pod.yaml \ + -s ${BOTTLENECKS_CONFIG}/id_rsa" + echo ${cmd} + ${cmd} + + deactivate + + set -e + + cd ${WORKSPACE} + + if [ -f ${BOTTLENECKS_CONFIG}/pod.yaml ]; then + echo "FILE: ${BOTTLENECKS_CONFIG}/pod.yaml:" + cat ${BOTTLENECKS_CONFIG}/pod.yaml + else + echo "ERROR: cannot find file ${BOTTLENECKS_CONFIG}/pod.yaml. Please check if it is existing." + sudo ls -al ${BOTTLENECKS_CONFIG} + fi + + # Pulling Bottlenecks docker and passing environment variables echo "INFO: pulling Bottlenecks docker ${DOCKER_TAG}" docker pull opnfv/bottlenecks:${DOCKER_TAG} >$redirect @@ -65,6 +122,7 @@ if [[ $SUITE_NAME == *posca* ]]; then ${cmd} >$redirect sleep 5 + # Running test cases through Bottlenecks docker if [[ $SUITE_NAME == posca_stress_traffic ]]; then TEST_CASE=posca_factor_system_bandwidth testcase_cmd="docker exec bottlenecks-load-master python ${POSCA_SCRIPT}/../run_testsuite.py testcase $TEST_CASE $REPORT" diff --git a/jjb/calipso/calipso.yml b/jjb/calipso/calipso.yml index c808e9b3c..c5ba8eb1e 100644 --- a/jjb/calipso/calipso.yml +++ b/jjb/calipso/calipso.yml @@ -58,4 +58,4 @@ set -o nounset set -o pipefail cd $WORKSPACE - PYTHONPATH=$PWD/app python3 -m unittest discover -s app/test/fetch + PYTHONPATH=$PWD/app app/test/verify.sh diff --git a/jjb/daisy4nfv/daisy-daily-jobs.yml b/jjb/daisy4nfv/daisy-daily-jobs.yml index d7c1acbe0..84cc2a4c2 100644 --- a/jjb/daisy4nfv/daisy-daily-jobs.yml +++ b/jjb/daisy4nfv/daisy-daily-jobs.yml @@ -199,7 +199,7 @@ - trigger: name: 'daisy-os-nosdn-nofeature-ha-virtual-daily-master-trigger' triggers: - - timed: '0 12 * * *' + - timed: '0 16 * * *' # Basic NOHA Scenarios - trigger: name: 'daisy-os-nosdn-nofeature-noha-virtual-daily-master-trigger' @@ -209,4 +209,4 @@ - trigger: name: 'daisy-os-odl-nofeature-ha-virtual-daily-master-trigger' triggers: - - timed: '0 16 * * *' + - timed: '0 12 * * *' diff --git a/jjb/fuel/fuel-daily-jobs.yml b/jjb/fuel/fuel-daily-jobs.yml index 4b2f8e9cc..cbdd3ddba 100644 --- a/jjb/fuel/fuel-daily-jobs.yml +++ b/jjb/fuel/fuel-daily-jobs.yml @@ -333,7 +333,7 @@ - trigger: name: 'fuel-os-nosdn-nofeature-ha-baremetal-daily-master-trigger' triggers: - - timed: '' # '5 20 * * *' + - timed: '5 20 * * *' - trigger: name: 'fuel-os-odl_l2-nofeature-ha-baremetal-daily-master-trigger' triggers: @@ -341,11 +341,11 @@ - trigger: name: 'fuel-os-odl_l3-nofeature-ha-baremetal-daily-master-trigger' triggers: - - timed: '' # '5 2 * * *' + - timed: '5 2 * * *' - trigger: name: 'fuel-os-nosdn-ovs-ha-baremetal-daily-master-trigger' triggers: - - timed: '' # '5 5 * * *' + - timed: '5 5 * * *' - trigger: name: 'fuel-os-onos-sfc-ha-baremetal-daily-master-trigger' triggers: diff --git a/jjb/functest/functest-alpine.sh b/jjb/functest/functest-alpine.sh index 9084ccaa7..da098862a 100644 --- a/jjb/functest/functest-alpine.sh +++ b/jjb/functest/functest-alpine.sh @@ -67,9 +67,9 @@ fi volumes="${images_vol} ${results_vol} ${sshkey_vol} ${rc_file_vol} ${cacert_file_vol}" -tiers=(healthcheck smoke) +tiers=(healthcheck smoke features vnf) for tier in ${tiers[@]}; do - FUNCTEST_IMAGE=opnfv/functest-${tier} + FUNCTEST_IMAGE=ollivier/functest-${tier} echo "Functest: Pulling Functest Docker image ${FUNCTEST_IMAGE} ..." docker pull ${FUNCTEST_IMAGE}>/dev/null cmd="docker run ${envs} ${volumes} ${FUNCTEST_IMAGE}" diff --git a/jjb/functest/set-functest-env.sh b/jjb/functest/set-functest-env.sh index f6071e37a..7d9e737e7 100755 --- a/jjb/functest/set-functest-env.sh +++ b/jjb/functest/set-functest-env.sh @@ -33,8 +33,9 @@ if [ "$BRANCH" != 'stable/danube' ]; then echo "Functest: Download images that will be used by test cases" images_dir="${HOME}/opnfv/functest/images" chmod +x ${WORKSPACE}/functest/ci/download_images.sh - ${WORKSPACE}/functest/ci/download_images.sh ${images_dir} ${DEPLOY_SCENARIO} ${HOST_ARCH} 2> ${redirect} + ${WORKSPACE}/functest/ci/download_images.sh ${images_dir} images_vol="-v ${images_dir}:/home/opnfv/functest/images" + echo "Functest: Images successfully downloaded" fi dir_result="${HOME}/opnfv/functest/results/${BRANCH##*/}" @@ -43,11 +44,18 @@ sudo rm -rf ${dir_result}/* results_vol="-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: custom parameters successfully retrieved: ${custom_params}" envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} \ -e NODE_NAME=${NODE_NAME} -e DEPLOY_SCENARIO=${DEPLOY_SCENARIO} \ -e BUILD_TAG=${BUILD_TAG} -e CI_DEBUG=${CI_DEBUG} -e DEPLOY_TYPE=${DEPLOY_TYPE}" +if [[ ${INSTALLER_TYPE} == 'fuel' && ! -z ${SALT_MASTER_IP} ]]; then + HOST_ARCH=$(ssh -l ubuntu ${SALT_MASTER_IP} -i ${SSH_KEY} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \ + "sudo salt 'cmp*' grains.get cpuarch --out yaml |awk '{print \$2; exit}'") + envs="${envs} -e POD_ARCH=${HOST_ARCH}" +fi + if [[ ${INSTALLER_TYPE} == 'compass' && ${DEPLOY_SCENARIO} == *'os-nosdn-openo-ha'* ]]; then ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" openo_msb_port=${openo_msb_port:-80} @@ -64,6 +72,8 @@ else volumes="${results_vol} ${sshkey_vol} ${stackrc_vol} ${rc_file_vol}" fi +echo "Functest: volumes defined" + FUNCTEST_IMAGE="opnfv/functest" if [ "$HOST_ARCH" = "aarch64" ]; then FUNCTEST_IMAGE="${FUNCTEST_IMAGE}_${HOST_ARCH}" diff --git a/jjb/global/slave-params.yml b/jjb/global/slave-params.yml index 0e23380a9..f5de021a6 100644 --- a/jjb/global/slave-params.yml +++ b/jjb/global/slave-params.yml @@ -885,6 +885,20 @@ default: https://gerrit.opnfv.org/gerrit/$PROJECT description: 'Git URL to use on this Jenkins Slave' - parameter: + name: 'intel-virtual10-defaults' + parameters: + - node: + name: SLAVE_NAME + description: 'Slave name on Jenkins' + allowed-slaves: + - intel-virtual10 + default-slaves: + - intel-virtual10 + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/$PROJECT + description: 'Git URL to use on this Jenkins Slave' +- parameter: name: 'doctor-defaults' parameters: - node: diff --git a/jjb/snaps/snaps.yml b/jjb/snaps/snaps-verify-jobs.yml index 50b7c3070..01ea3e41e 100644 --- a/jjb/snaps/snaps.yml +++ b/jjb/snaps/snaps-verify-jobs.yml @@ -15,21 +15,27 @@ branch: '{stream}' gs-pathname: '' disabled: false - - danube: - branch: 'stable/{stream}' - gs-pathname: '/{stream}' - disabled: false - job-template: name: 'snaps-verify-{stream}' disabled: '{obj:disabled}' + concurrent: false + parameters: - project-parameter: project: '{project}' branch: '{branch}' - - 'opnfv-build-ubuntu-defaults' + - string: + name: DEPLOYMENT_HOST_IP + default: 192.168.122.2 + description: 'IP of the deployment node' + - string: + name: CONTROLLER_IP + default: 192.168.122.3 + description: 'IP of the controller node' + - 'intel-virtual10-defaults' scm: - git-scm-gerrit @@ -60,4 +66,7 @@ builders: - shell: | - echo "Nothing to verify!" + #!/bin/bash + + cd $WORKSPACE/ci + ./run_tests.sh $DEPLOYMENT_HOST_IP $CONTROLLER_IP diff --git a/jjb/storperf/storperf-daily-jobs.yml b/jjb/storperf/storperf-daily-jobs.yml new file mode 100644 index 000000000..e849e29e1 --- /dev/null +++ b/jjb/storperf/storperf-daily-jobs.yml @@ -0,0 +1,175 @@ +################################### +# job configuration for storperf +################################### +- project: + name: storperf-daily + + project: storperf + +#-------------------------------- +# BRANCH ANCHORS +#-------------------------------- + master: &master + stream: master + branch: '{stream}' + gs-pathname: '' + docker-tag: 'latest' +#-------------------------------- +# POD, INSTALLER, AND BRANCH MAPPING +#-------------------------------- +# Installers using labels +# CI PODs +# This section should only contain the installers +# that have been switched using labels for slaves +#-------------------------------- + pod: +## fuel CI PODs +# - baremetal: +# slave-label: fuel-baremetal +# installer: fuel +# <<: *master +# - virtual: +# slave-label: fuel-virtual +# installer: fuel +# <<: *master +## joid CI PODs +# - baremetal: +# slave-label: joid-baremetal +# installer: joid +# <<: *master +# - virtual: +# slave-label: joid-virtual +# installer: joid +# <<: *master +## compass CI PODs +# - baremetal: +# slave-label: compass-baremetal +# installer: compass +# <<: *master +# - virtual: +# slave-label: compass-virtual +# installer: compass +# <<: *master +## apex CI PODs +# - virtual: +# slave-label: apex-virtual-master +# installer: apex +# <<: *master + - baremetal: + slave-label: apex-baremetal-master + installer: apex + <<: *master +## armband CI PODs +# - armband-baremetal: +# slave-label: armband-baremetal +# installer: fuel +# <<: *master +# - armband-virtual: +# slave-label: armband-virtual +# installer: fuel +# <<: *master +## daisy CI PODs +# - baremetal: +# slave-label: daisy-baremetal +# installer: daisy +# <<: *master +# - virtual: +# slave-label: daisy-virtual +# installer: daisy +# <<: *master + + jobs: + - 'storperf-{installer}-{pod}-daily-{stream}' + +################################ +# job template +################################ +- job-template: + name: 'storperf-{installer}-{pod}-daily-{stream}' + + concurrent: true + + properties: + - logrotate-default + - throttle: + enabled: true + max-per-node: 1 + option: 'project' + + wrappers: + - build-name: + name: '$BUILD_NUMBER Scenario: $DEPLOY_SCENARIO' + - timeout: + timeout: '30' + abort: true + + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + - '{installer}-defaults' + - '{slave-label}-defaults' + - string: + name: DEPLOY_SCENARIO + default: 'os-odl_l2-nofeature-ha' + - string: + name: DOCKER_TAG + default: '{docker-tag}' + description: 'Tag to pull docker image' + - string: + name: CLEAN_DOCKER_IMAGES + default: 'false' + description: 'Remove downloaded docker images (opnfv/storperf*:*)' + - string: + name: GS_PATHNAME + default: '{gs-pathname}' + description: "Version directory where the opnfv documents will be stored in gs repository" + - string: + name: DISK_TYPE + default: 'HDD' + description: 'The type of hard disk that Cinder uses' + - string: + name: VOLUME_SIZE + default: '2' + description: 'Size of Cinder volume (in GB)' + - string: + name: WORKLOADS + default: 'rw' + description: 'Workloads to run' + - string: + name: BLOCK_SIZES + default: '16384' + description: 'Block sizes for VM I/O operations' + - string: + name: QUEUE_DEPTHS + default: '4' + description: 'Number of simultaneous I/O operations to keep active' + - string: + name: STEADY_STATE_SAMPLES + default: '10' + description: 'Number of samples to use (1 per minute) to measure steady state' + - string: + name: TEST_CASE + choices: + - 'snia_steady_state' + description: 'The test case to run' + + scm: + - git-scm + + builders: + - description-setter: + description: "Built on $NODE_NAME" + - 'storperf-daily-builder' + +######################## +# builder macros +######################## +- builder: + name: storperf-daily-builder + builders: + - shell: | + #!/bin/bash + + cd $WORKSPACE + ./ci/daily.sh diff --git a/jjb/storperf/storperf.yml b/jjb/storperf/storperf.yml index de169d0ef..307becfed 100644 --- a/jjb/storperf/storperf.yml +++ b/jjb/storperf/storperf.yml @@ -5,7 +5,6 @@ jobs: - 'storperf-merge-{stream}' - - 'storperf-daily-{stream}' stream: - master: @@ -74,74 +73,3 @@ failing: 30 - email-jenkins-admins-on-failure -- job-template: - name: 'storperf-daily-{stream}' - - # Job template for daily builders - # - # Required Variables: - # stream: branch with - in place of / (eg. stable) - # branch: branch (eg. stable) - disabled: '{obj:disabled}' - - parameters: - - project-parameter: - project: '{project}' - branch: '{branch}' - - 'intel-pod9-defaults' - - string: - name: DEPLOY_SCENARIO - default: 'os-nosdn-nofeature-noha' - - string: - name: DOCKER_TAG - default: '{docker-tag}' - description: 'Tag to pull docker image' - - choice: - name: DISK_TYPE - choices: - - 'SSD' - - 'HDD' - default: 'HDD' - description: 'The type of hard disk that Cinder uses' - - string: - name: AGENT_COUNT - description: 'The number of slave agents to start. Defaults to the cinder node count' - - string: - name: VOLUME_SIZE - default: '4' - description: 'Size of Cinder volume (in GB)' - - string: - name: WORKLOADS - default: 'wr,rr,rw' - description: 'Workloads to run' - - string: - name: BLOCK_SIZES - default: '2048,16384' - description: 'Block sizes for VM I/O operations' - - string: - name: QUEUE_DEPTHS - default: '1,4' - description: 'Number of simultaneous I/O operations to keep active' - - string: - name: STEADY_STATE_SAMPLES - default: '10' - description: 'Number of samples to use (1 per minute) to measure steady state' - - string: - name: DEADLINE - description: 'Maximum run time in minutes if steady state cannot be found. Defaults to 3 times steady state samples' - - choice: - name: TEST_CASE - choices: - - 'snia_steady_state' - description: 'The test case to run' - - scm: - - git-scm - - triggers: - - timed: '0 22 * * *' - - builders: - - shell: | - $WORKSPACE/ci/daily.sh - diff --git a/utils/create_pod_file.py b/utils/create_pod_file.py index e2c57d23f..def5ecca8 100644 --- a/utils/create_pod_file.py +++ b/utils/create_pod_file.py @@ -12,6 +12,8 @@ parser.add_argument("-u", "--user", help="Give username of this pod") parser.add_argument("-k", "--key", help="Give key file of the user") parser.add_argument("-p", "--password", help="Give password of the user") parser.add_argument("-f", "--filepath", help="Give dest path of output file") +parser.add_argument("-s", "--sshkey", default="/root/.ssh/id_rsa", + help="Give the path for ssh key") args = parser.parse_args() @@ -92,7 +94,7 @@ def create_file(handler, INSTALLER_TYPE): item['password'] = 'root' else: for item in node_list: - item['key_filename'] = '/root/.ssh/id_rsa' + item['key_filename'] = args.sshkey data = {'nodes': node_list} with open(args.filepath, "w") as fw: yaml.dump(data, fw) diff --git a/utils/fetch_os_creds.sh b/utils/fetch_os_creds.sh index 8374edbbd..312e1ac5c 100755 --- a/utils/fetch_os_creds.sh +++ b/utils/fetch_os_creds.sh @@ -107,7 +107,7 @@ if [ "$installer_type" == "fuel" ]; then # retrieving controller vip controller_ip=$(ssh 2>/dev/null ${ssh_options} ubuntu@${installer_ip} \ - "sudo salt --out txt 'ctl01*' pillar.get _param:openstack_control_address | awk '{print \$2}'" | \ + "sudo salt --out txt 'ctl*' pillar.get _param:openstack_control_address | awk '{print \$2; exit}'" | \ sed 's/ //g') &> /dev/null info "Fetching rc file from controller $controller_ip..." diff --git a/utils/test/testapi/opnfv_testapi/resources/scenario_models.py b/utils/test/testapi/opnfv_testapi/resources/scenario_models.py index 7d0770759..ec262aa2f 100644 --- a/utils/test/testapi/opnfv_testapi/resources/scenario_models.py +++ b/utils/test/testapi/opnfv_testapi/resources/scenario_models.py @@ -16,6 +16,13 @@ class ScenarioTI(models.ModelBase): self.date = date self.status = status + def __eq__(self, other): + return (self.date == other.date and + self.status == other.status) + + def __ne__(self, other): + return not self.__eq__(other) + @swagger.model() class ScenarioScore(models.ModelBase): @@ -23,6 +30,13 @@ class ScenarioScore(models.ModelBase): self.date = date self.score = score + def __eq__(self, other): + return (self.date == other.date and + self.score == other.score) + + def __ne__(self, other): + return not self.__eq__(other) + @swagger.model() class ScenarioProject(models.ModelBase): @@ -50,10 +64,10 @@ class ScenarioProject(models.ModelBase): 'trust_indicators': ScenarioTI} def __eq__(self, other): - return [self.project == other.project and + return (self.project == other.project and self._customs_eq(other) and self._scores_eq(other) and - self._ti_eq(other)] + self._ti_eq(other)) def __ne__(self, other): return not self.__eq__(other) @@ -62,10 +76,10 @@ class ScenarioProject(models.ModelBase): return set(self.customs) == set(other.customs) def _scores_eq(self, other): - return set(self.scores) == set(other.scores) + return self.scores == other.scores def _ti_eq(self, other): - return set(self.trust_indicators) == set(other.trust_indicators) + return self.trust_indicators == other.trust_indicators @swagger.model() @@ -84,9 +98,9 @@ class ScenarioVersion(models.ModelBase): return {'projects': ScenarioProject} def __eq__(self, other): - return [self.version == other.version and + return (self.version == other.version and self.owner == other.owner and - self._projects_eq(other)] + self._projects_eq(other)) def __ne__(self, other): return not self.__eq__(other) @@ -116,7 +130,7 @@ class ScenarioInstaller(models.ModelBase): return {'versions': ScenarioVersion} def __eq__(self, other): - return [self.installer == other.installer and self._versions_eq(other)] + return (self.installer == other.installer and self._versions_eq(other)) def __ne__(self, other): return not self.__eq__(other) @@ -166,7 +180,7 @@ class Scenario(models.ModelBase): return not self.__eq__(other) def __eq__(self, other): - return [self.name == other.name and self._installers_eq(other)] + return (self.name == other.name and self._installers_eq(other)) def _installers_eq(self, other): for s_install in self.installers: diff --git a/utils/test/testapi/opnfv_testapi/tests/unit/resources/scenario-c2.json b/utils/test/testapi/opnfv_testapi/tests/unit/resources/scenario-c2.json index b6a3b83ab..980051c4f 100644 --- a/utils/test/testapi/opnfv_testapi/tests/unit/resources/scenario-c2.json +++ b/utils/test/testapi/opnfv_testapi/tests/unit/resources/scenario-c2.json @@ -8,7 +8,7 @@ [ { "owner": "Lucky", - "version": "colorado", + "version": "danube", "projects": [ { @@ -29,7 +29,7 @@ "scores": [ { "date": "2017-01-08 22:46:44", - "score": "0" + "score": "0/1" } ], "trust_indicators": [ diff --git a/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_scenario.py b/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_scenario.py index 466caaf13..f9bb58c6b 100644 --- a/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_scenario.py +++ b/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_scenario.py @@ -47,8 +47,7 @@ class TestScenarioBase(base.TestBase): req = self.req_d self.assertIsNotNone(scenario._id) self.assertIsNotNone(scenario.creation_date) - - scenario == models.Scenario.from_dict(req) + self.assertEqual(scenario, models.Scenario.from_dict(req)) @staticmethod def _set_query(*args): @@ -298,7 +297,7 @@ class TestScenarioUpdate(TestScenarioBase): @update_partial('_update', '_success') def test_changeOwner(self, scenario): new_owner = 'new_owner' - scenario['installers'][0]['versions'][0]['owner'] = 'www' + scenario['installers'][0]['versions'][0]['owner'] = new_owner return new_owner, scenario def _add(self, update_req, new_scenario): |