Skip to content

Commit 427e4a5

Browse files
Add reusable workflow for e2e test job
In this commit, We are adding reusable workflow for e2e job, this workflow will be used by other operators in openstack-k8s-operators organization. In this workflow:- * We build individual operator container images using PR content. * Build openstack operator(passing the Individual Operator bundle image we build earlier) * We start a SNO OCP cluster in an OpenStack cloud. * Install operator on OCP cluster using meta operator. * Do basic Service tests. Apart from workflow, we are adding some basic shell scripts that will be consumed by the workflow.
1 parent 1ee96af commit 427e4a5

File tree

5 files changed

+508
-0
lines changed

5 files changed

+508
-0
lines changed

.github/cluster_pre_steps.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -ex
3+
oc whoami
4+
for i in `oc get csr |grep Pending |awk '{print $1}'`; do oc adm certificate approve $i; done
5+
sleep 30

.github/install_operator_with_hash.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
set -ex
3+
export $(echo ${1^^} | cut -d '-' -f1)_IMG=$2/$1-index:$3
4+
5+
cd $HOME
6+
rm -rf install_yamls
7+
git clone https://github.com/openstack-k8s-operators/install_yamls.git
8+
cd $HOME/install_yamls
9+
make crc_storage
10+
sleep 20
11+
make openstack
12+
sleep 150
13+
make openstack_deploy
14+
sleep 240

.github/operators_post_tests.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
set -ex
3+
4+
# Print basic outputs for debug
5+
oc get pods -n openstack
6+
7+
# Create clouds.yaml file to be used in further tests.
8+
mkdir -p ~/.config/openstack
9+
cat > ~/.config/openstack/clouds.yaml << EOF
10+
$(oc get cm openstack-config -n openstack -o json | jq -r '.data["clouds.yaml"]')
11+
EOF
12+
export OS_CLOUD=default
13+
export OS_PASSWORD=$(oc get secret $(oc get keystoneapi keystone -o json | jq -r .spec.secret) -o json | jq -r .data.$(oc get keystoneapi keystone -o json | jq -r .spec.passwordSelectors.admin) | base64 -d)
14+
15+
# Post tests for mariadb-operator
16+
# Check to confirm they we can login into mariadb container and show databases.
17+
mariadb_password=$(oc get secret $(oc get mariadb openstack -o json | jq -r .spec.secret) -o json | jq -r .data.DbRootPassword | base64 -d)
18+
oc exec -it pod/mariadb-openstack -- mysql -uroot -p$mariadb_password -e "show databases;"
19+
20+
# Post tests for keystone-operator
21+
# Check to confirm you can issue a token.
22+
openstack token issue

.github/sno_heat_stack.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
heat_template_version: 2016-10-14
2+
3+
parameters:
4+
flavor:
5+
type: string
6+
description: 16G flavor
7+
default: ci.m1.xxlarge
8+
constraints:
9+
- custom_constraint: nova.flavor
10+
image:
11+
type: string
12+
description: SNO Snapshot
13+
default: sno-bcqhp-master-0_10.0.131.137_test
14+
constraints:
15+
- custom_constraint: glance.image
16+
17+
resources:
18+
heat_network:
19+
type: OS::Neutron::Net
20+
properties:
21+
admin_state_up: true
22+
name: sno_network
23+
heat_network_subnet:
24+
type: OS::Neutron::Subnet
25+
properties:
26+
network: { get_resource: heat_network }
27+
cidr: "10.0.128.0/17"
28+
gateway_ip: "10.0.128.1"
29+
ip_version: 4
30+
heat_router:
31+
type: OS::Neutron::Router
32+
properties:
33+
external_gateway_info: { network: public }
34+
name: heat_router
35+
heat_router_interface:
36+
type: OS::Neutron::RouterInterface
37+
properties:
38+
router_id: { get_resource: heat_router }
39+
subnet: { get_resource: heat_network_subnet }
40+
heat_server_port:
41+
type: OS::Neutron::Port
42+
properties:
43+
network: { get_resource: heat_network }
44+
fixed_ips:
45+
- subnet_id: { get_resource: heat_network_subnet }
46+
ip_address: 10.0.131.137
47+
security_groups:
48+
- sno-bcqhp-master
49+
heat_server:
50+
type: OS::Nova::Server
51+
properties:
52+
name: sno-bcqhp-master-0
53+
flavor: { get_param: flavor }
54+
image: { get_param: image }
55+
networks:
56+
- port: { get_resource: heat_server_port}
57+
heat_server_public_ip:
58+
type: OS::Neutron::FloatingIP
59+
properties:
60+
floating_network: "public"
61+
heat_server_ip_assoc:
62+
type: OS::Neutron::FloatingIPAssociation
63+
properties:
64+
floatingip_id: { get_resource: heat_server_public_ip }
65+
port_id: { get_resource: heat_server_port }
66+
67+
outputs:
68+
heat_server_public_ip:
69+
description: IP Address of the deployed heat_server instance
70+
value: { get_attr: [ heat_server_public_ip, floating_ip_address ]}

0 commit comments

Comments
 (0)