4 # Copyright 2019 Tech Mahindra Limited
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
22 # 1. Feature 7829: Mrityunjay Yadav, Jayant Madavi : MY00514913@techmahindra.com : 06-Sep-2019
23 # Entry script to start the vim, smoke, openstack_stage_4 and comprehensive test using Robot Framework as a Automation Test Framework
26 BASEDIR
=$
(dirname "$0")
27 TOPDIR
=$
(dirname "$BASEDIR")
28 DESCRIPTOR_DIR
=$TOPDIR/descriptor-packages
32 echo -e "\nInstalling robot requirements"
33 # installing python packages
34 pip
install haikunator requests robotframework robotframework-seleniumlibrary robotframework-requests
36 # installing chrome driver and chrome for UI testing
37 curl
-sS -o - https
://dl-ssl.google.com
/linux
/linux_signing_key.pub | apt-key add
-
38 echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc
/apt
/sources.list.d
/google-chrome.list
39 apt-get update
&& apt-get
-y install google-chrome-stable chromium-chromedriver
42 while getopts ":t:-:" o
; do
48 [[ "${OPTARG}" == "do_install" ]] && robot_prerequisite
&& continue
51 echo -e "Invalid option: '-$OPTARG'\n" >&2
57 if [[ -z $TEST ]]; then
58 printf "Test not provided. \nRunning default test: smoke\n"
62 if [[ "$TEST" == "vim" ]]; then
63 echo "Robot Framework Vim Test"
64 robot
-d $BASEDIR/reports
-i vim
$BASEDIR/testsuite
/
66 elif [[ "$TEST" == "smoke" ]]; then
67 echo "Robot Framework SMOKE test"
68 robot
-d $BASEDIR/reports
-i smoke
$BASEDIR/testsuite
/
70 elif [[ "$TEST" == "sanity" ]]; then
71 echo "Robot Framework Cirros VNF Test"
72 mkdir
-p $BASEDIR/images
/cache
73 if [[ ! -z $OS_AUTH_URL ]]; then
74 (openstack image show cirros-0.3
.5-x86_64-disk.img
) ||
(wget
-r -nc http
://download.cirros-cloud.net
/0.3.5/cirros-0.3
.5-x86_64-disk.img
-O $BASEDIR/images
/cache
/cirros-0.3
.5-x86_64-disk.img
&& make $BASEDIR/images
/cache
/cirros-0.3
.5-x86_64-disk.img
&& openstack image create
--file $BASEDIR/images
/cache
/cirros-0.3
.5-x86_64-disk.img cirros-0.3
.5-x86_64-disk.img
)
76 if [[ ! -z $VCD_AUTH_URL ]]; then
77 # TODO: Check for image over VIM before downloading
78 if [[ ! -s $BASEDIR/images
/cache
/cirros-0.3
.5-x86_64-disk.img
]]; then
79 wget
-r -nc http
://download.cirros-cloud.net
/0.3.5/cirros-0.3
.5-x86_64-disk.img
-O $BASEDIR/images
/cache
/cirros-0.3
.5-x86_64-disk.img
81 ovf_converter
$BASEDIR/images
/cache
/cirros-0.3
.5-x86_64-disk.img
-n cirros
82 python
$TOPDIR/tools
/vmware_ovf_upload.py
$VCD_AUTH_URL $VCD_USERNAME $VCD_PASSWORD $VCD_ORGANIZATION $BASEDIR/images
/cache
/cirros.ovf
84 robot
-d $BASEDIR/reports
-i sanity
$BASEDIR/testsuite
/
86 elif [[ "$TEST" == "comprehensive" ]]; then
87 echo "Robot Framework Comprehensive Test"
88 mkdir
-p $BASEDIR/images
/cache
89 if [[ ! -z $OS_AUTH_URL ]]; then
90 (openstack image show ubuntu1604
) ||
(wget
-r -nc https
://cloud-images.ubuntu.com
/xenial
/current
/xenial-server-cloudimg-amd64-disk1.img
-O $BASEDIR/images
/cache
/xenial-server-cloudimg-amd64-disk1.img
&& make $BASEDIR/images
/cache
/xenial-server-cloudimg-amd64-disk1.img
&& openstack image create
--file $BASEDIR/images
/cache
/xenial-server-cloudimg-amd64-disk1.img ubuntu1604
)
91 (openstack image show hackfest3-mgmt
) ||
(wget
-r -nc https
://cloud-images.ubuntu.com
/xenial
/current
/xenial-server-cloudimg-amd64-disk1.img
-O $BASEDIR/images
/cache
/xenial-server-cloudimg-amd64-disk1.img
&& make $BASEDIR/images
/cache
/xenial-server-cloudimg-amd64-disk1.img
&& openstack image create
--file $BASEDIR/images
/cache
/xenial-server-cloudimg-amd64-disk1.img hackfest3-mgmt
)
93 if [[ ! -z $VCD_AUTH_URL ]]; then
94 # TODO: Check for image over VIM before downloading
95 if [[ ! -s $BASEDIR/images
/cache
/xenial-server-cloudimg-amd64-disk1.img
]]; then
96 wget
-r -nc https
://cloud-images.ubuntu.com
/xenial
/current
/xenial-server-cloudimg-amd64-disk1.img
-O $BASEDIR/images
/cache
/xenial-server-cloudimg-amd64-disk1.img
98 ovf_converter
$BASEDIR/images
/cache
/xenial-server-cloudimg-amd64-disk1.img
-n ubuntu1604
99 python
$TOPDIR/tools
/vmware_ovf_upload.py
$VCD_AUTH_URL $VCD_USERNAME $VCD_PASSWORD $VCD_ORGANIZATION $BASEDIR/images
/cache
/ubuntu1604.ovf
101 robot
-d $BASEDIR/reports
-i comprehensive
$BASEDIR/testsuite
/
104 echo "wrong test provided"