Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.07 KB | None | 0 0
  1.  
  2. 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
  3. curl -o /etc/yum.repos.d/rhos-release-12.repo http://file.pnq.redhat.com/vmulaje/repo/rhos-release-12.repo
  4.  
  5. yum install -y git Xvfb xorg-x11-server-Xvfb
  6. pip install virtualenv
  7.  
  8. virtualenv -p /usr/bin/python2.7 virt
  9. . virt/bin/activate
  10. pip install allure-behave; pip install junit2html
  11. pip install -r requirements.text
  12.  
  13. curl -O http://file.india.redhat.com/vmulaje/get_settings_yaml.py
  14.  
  15. curl -OLJ http://file.pnq.redhat.com/vmulaje/geckodriver-v0.18.0-linux32.tar.gz
  16. tar -xvzf geckodriver-v0.18.0-linux32.tar.gz
  17. export PATH=$WORKSPACE:$PATH
  18.  
  19. #changes for running the code in headless mode
  20. # sed -i "5i\ \ \ \ from xvfbwrapper import Xvfb" features/environment.py
  21. # sed -i "26i \ \ \ \ context.vdisplay = Xvfb\(\)" features/environment.py
  22. # sed -i "27i \ \ \ \ context.vdisplay.start\(\)" features/environment.py
  23. # sed -i "84i \ \ \ \ context.vdisplay.stop\(\)" features/environment.py
  24. # sed -i "32d" features/steps/rhcert_4x.py
  25.  
  26. # cat config/settings.yml
  27. # making changes into the settings.yml
  28.  
  29. # SUT=`ssh root@$RHCERT_HOST<<EOF
  30. # ssh root@undercloud-0
  31. # . stackrc
  32. # nova list|grep controller-0|cut -c 102-115
  33. # EOF`
  34.  
  35. #Changing phase to qa
  36. ssh -T -o StrictHostKeyChecking=no root@$RHCERT_HOST << EOF
  37. sed -i -r "s/<urls(\s+phase='[a-z]+')*>/<urls phase='qa'>/" /etc/rhcert.xml
  38. systemctl restart rhcertd;systemctl restart httpd
  39. EOF
  40.  
  41. # python get_settings_yaml.py $RHCERT_HOST $SUT
  42. # cp -r settings.yml config/settings.yml
  43.  
  44. sed -i "s/And I select vendor \"viksss_qa (56627)\"/And I select vendor \"$vendor_name\"/" features/netstorage_certification/*
  45. 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/*
  46.  
  47. #Making changes into rhosp verison
  48. if [ $RHOSP_Version ]; then
  49.  
  50. sed -i "s/13.0/${RHOSP_Version}/g" features/netstorage_certification/*
  51. sed -i "s/14.0/${RHOSP_Version}/g" features/netstorage_certification/*
  52.  
  53. fi
  54.  
  55.  
  56. if [ $Rhcert_Package == "Install" ]; then
  57.  
  58. ssh -o StrictHostKeyChecking=no root@$RHCERT_HOST << EOF
  59.  
  60. yum install -y redhat-certification
  61. systemctl restart rhcertd;systemctl restart httpd
  62. #ssh heat-admin@$SUT
  63. #sudo su
  64. #yum install -y redhat-certification-backend
  65. #yum install -y redhat-certification-openstack
  66. EOF
  67.  
  68. fi
  69.  
  70. sed -i 's/I enter product version "RHOSP12"/I enter product version "RHOSP15"/g' features/netstorage_certification/*
  71. sed -i 's/I enter product version "RHOSP13"/I enter product version "RHOSP15"/g' features/netstorage_certification/*
  72. sed -i 's/I enter product version "RHOSP14"/I enter product version "RHOSP15"/g' features/netstorage_certification/*
  73. sed -i 's/I enter product version "RHOSP15"/I enter product version "RHOSP15"/g' features/netstorage_certification/*
  74.  
  75.  
  76. #using cert_ops_qe user
  77. sed -i 's/sso_username:\ gaurang.tapase/sso_username:\ cert_ops_qe/g' config/settings.yml
  78.  
  79. #Changing rhcert host
  80. sed -i "s/vm96.gsslab.pnq.redhat.com/${RHCERT_HOST}/" config/settings.yml
  81.  
  82. #setting ssh password
  83. sed -i 's/ssh_password:\ redhat/ssh_password:\ cert-qe123*/g' config/settings.yml
  84.  
  85. #setting rhel version
  86. sed -i "s/7.6/${RHEL}/g" features/netstorage_certification/*
  87.  
  88. if [ "$Features" == "Management" ]
  89. then
  90.  
  91. sed -i "56d" features/netstorage_certification/management_openstack.feature
  92. sed -i "92d" features/netstorage_certification/management_openstack.feature
  93. sed -i "128d" features/netstorage_certification/management_openstack.feature
  94. sed -i "162d" features/netstorage_certification/management_openstack.feature
  95.  
  96. xvfb-run -a behave -f allure_behave.formatter:AllureFormatter -o allure-results --junit features/netstorage_certification/management_openstack.feature
  97.  
  98.  
  99. elif [ "$Features" == "Neutron" ]
  100. then
  101.  
  102. xvfb-run -a behave -f allure_behave.formatter:AllureFormatter -o allure-results --junit -D password=$pass features/netstorage_certification/neutron_5x.feature
  103.  
  104. elif [ "$Features" == "Cinder" ]
  105. then
  106.  
  107. xvfb-run -a behave -f allure_behave.formatter:AllureFormatter -o allure-results --junit -D password=$pass features/netstorage_certification/cinder_5x.feature
  108.  
  109. elif [ "$Features" == "Manila" ]
  110. then
  111.  
  112. xvfb-run -a behave -f allure_behave.formatter:AllureFormatter -o allure-results --junit -D password=$pass features/netstorage_certification/manila_5x.feature
  113.  
  114.  
  115. elif [ "$Features" == "All_test" ]
  116. then
  117.  
  118. 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
  119.  
  120. elif [ "$Features" == "Ironic" ]
  121. then
  122. xvfb-run -a behave -f allure_behave.formatter:AllureFormatter -o allure-results --junit -D password=$pass features/netstorage_certification/ironic_5x.feature
  123.  
  124. fi
  125.  
  126. curl -o build.log ${BUILD_URL}/consoleText
  127.  
  128. junit2html reports/TESTS-*.xml testrun.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement