Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- curl -o /etc/yum.repos.d/rhos-release-rhel-7.4.repo http://file.pnq.redhat.com/vmulaje/repo/rhos-release-rhel-7.4.repo
- curl -o /etc/yum.repos.d/rhos-release-12.repo http://file.pnq.redhat.com/vmulaje/repo/rhos-release-12.repo
- yum install -y git Xvfb xorg-x11-server-Xvfb
- pip install virtualenv
- virtualenv -p /usr/bin/python2.7 virt
- . virt/bin/activate
- pip install allure-behave; pip install junit2html
- pip install -r requirements.text
- curl -O http://file.india.redhat.com/vmulaje/get_settings_yaml.py
- curl -OLJ http://file.pnq.redhat.com/vmulaje/geckodriver-v0.18.0-linux32.tar.gz
- tar -xvzf geckodriver-v0.18.0-linux32.tar.gz
- export PATH=$WORKSPACE:$PATH
- #changes for running the code in headless mode
- # sed -i "5i\ \ \ \ from xvfbwrapper import Xvfb" features/environment.py
- # sed -i "26i \ \ \ \ context.vdisplay = Xvfb\(\)" features/environment.py
- # sed -i "27i \ \ \ \ context.vdisplay.start\(\)" features/environment.py
- # sed -i "84i \ \ \ \ context.vdisplay.stop\(\)" features/environment.py
- # sed -i "32d" features/steps/rhcert_4x.py
- # cat config/settings.yml
- # making changes into the settings.yml
- # SUT=`ssh root@$RHCERT_HOST<<EOF
- # ssh root@undercloud-0
- # . stackrc
- # nova list|grep controller-0|cut -c 102-115
- # EOF`
- #Changing phase to qa
- ssh -T -o StrictHostKeyChecking=no root@$RHCERT_HOST << EOF
- sed -i -r "s/<urls(\s+phase='[a-z]+')*>/<urls phase='qa'>/" /etc/rhcert.xml
- systemctl restart rhcertd;systemctl restart httpd
- EOF
- # python get_settings_yaml.py $RHCERT_HOST $SUT
- # cp -r settings.yml config/settings.yml
- sed -i "s/And I select vendor \"viksss_qa (56627)\"/And I select vendor \"$vendor_name\"/" features/netstorage_certification/*
- sed -i "s/And I select openstack product name \"openstack: viksss_qa_product (3822743)\"/And I select openstack product name \"$vendor_product_name\"/" features/netstorage_certification/*
- #Making changes into rhosp verison
- if [ $RHOSP_Version ]; then
- sed -i "s/13.0/${RHOSP_Version}/g" features/netstorage_certification/*
- sed -i "s/14.0/${RHOSP_Version}/g" features/netstorage_certification/*
- fi
- if [ $Rhcert_Package == "Install" ]; then
- ssh -o StrictHostKeyChecking=no root@$RHCERT_HOST << EOF
- yum install -y redhat-certification
- systemctl restart rhcertd;systemctl restart httpd
- #ssh heat-admin@$SUT
- #sudo su
- #yum install -y redhat-certification-backend
- #yum install -y redhat-certification-openstack
- EOF
- fi
- sed -i 's/I enter product version "RHOSP12"/I enter product version "RHOSP15"/g' features/netstorage_certification/*
- sed -i 's/I enter product version "RHOSP13"/I enter product version "RHOSP15"/g' features/netstorage_certification/*
- sed -i 's/I enter product version "RHOSP14"/I enter product version "RHOSP15"/g' features/netstorage_certification/*
- sed -i 's/I enter product version "RHOSP15"/I enter product version "RHOSP15"/g' features/netstorage_certification/*
- #using cert_ops_qe user
- sed -i 's/sso_username:\ gaurang.tapase/sso_username:\ cert_ops_qe/g' config/settings.yml
- #Changing rhcert host
- sed -i "s/vm96.gsslab.pnq.redhat.com/${RHCERT_HOST}/" config/settings.yml
- #setting ssh password
- sed -i 's/ssh_password:\ redhat/ssh_password:\ cert-qe123*/g' config/settings.yml
- #setting rhel version
- sed -i "s/7.6/${RHEL}/g" features/netstorage_certification/*
- if [ "$Features" == "Management" ]
- then
- sed -i "56d" features/netstorage_certification/management_openstack.feature
- sed -i "92d" features/netstorage_certification/management_openstack.feature
- sed -i "128d" features/netstorage_certification/management_openstack.feature
- sed -i "162d" features/netstorage_certification/management_openstack.feature
- xvfb-run -a behave -f allure_behave.formatter:AllureFormatter -o allure-results --junit features/netstorage_certification/management_openstack.feature
- elif [ "$Features" == "Neutron" ]
- then
- xvfb-run -a behave -f allure_behave.formatter:AllureFormatter -o allure-results --junit -D password=$pass features/netstorage_certification/neutron_5x.feature
- elif [ "$Features" == "Cinder" ]
- then
- xvfb-run -a behave -f allure_behave.formatter:AllureFormatter -o allure-results --junit -D password=$pass features/netstorage_certification/cinder_5x.feature
- elif [ "$Features" == "Manila" ]
- then
- xvfb-run -a behave -f allure_behave.formatter:AllureFormatter -o allure-results --junit -D password=$pass features/netstorage_certification/manila_5x.feature
- elif [ "$Features" == "All_test" ]
- then
- xvfb-run -a behave -f allure_behave.formatter:AllureFormatter -o allure-results --junit -D password=$pass -D RHOSP=15 -D containers='gnocchi_api' features/netstorage_certification/management_openstack.feature features/netstorage_certification/cinder_5x.feature features/netstorage_certification/manila_5x.feature features/netstorage_certification/neutron_5x.feature
- elif [ "$Features" == "Ironic" ]
- then
- xvfb-run -a behave -f allure_behave.formatter:AllureFormatter -o allure-results --junit -D password=$pass features/netstorage_certification/ironic_5x.feature
- fi
- curl -o build.log ${BUILD_URL}/consoleText
- junit2html reports/TESTS-*.xml testrun.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement