Skip to content

Commit

Permalink
Add E2E test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffyjf committed Sep 14, 2022
1 parent 2ee6937 commit c63a5fa
Show file tree
Hide file tree
Showing 11 changed files with 551 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: build-and-push
on:
push:
branches:
- 'main'
- 'master'
tags:
- 'v*'
pull_request:
branches:
- 'main'
- 'master'

jobs:
docker:
build:
runs-on: ubuntu-latest
steps:
- name: Login to DockerHub
Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: e2e-test

on:
pull_request:
branches:
- 'main'
# workflow_run:
# workflows:
# - "build-and-push"
# types:
# - "completed"

jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

# - name: Create kind cluster
# uses: helm/[email protected]

- name: Setup Minikube
uses: manusa/[email protected]
with:
minikube version: 'v1.26.1'
kubernetes version: 'v1.25.0'
github token: ${{ secrets.GITHUB_TOKEN }}

- name: set up tmate session for debugging
uses: mxschmitt/action-tmate@v3
timeout-minutes: 60

- name: df1
run: df -h

- name: use local disk
run: tests/scripts/github-action-helper.sh use_local_disk_for_integration_test

- name: df2
run: df -h

- name: Delply rook ceph
run: |
git clone --single-branch --branch v1.10.1 https://github.com/rook/rook.git
kubectl apply -f rook/deploy/examples/crds.yaml
kubectl apply -f rook/deploy/examples/common.yaml
kubectl apply -f rook/deploy/examples/operator.yaml
kubectl apply -f rook/deploy/examples/cluster-test.yaml
- name: Create k8s namespace for openstack
run:
kubectl create namespace openstack

- name: Add kungze helm repository
run:
helm repo add kungze https://charts.kungze.net

- name: Install openstack
run: |
helm install openstack-password kungze/password --namespace openstack
helm install openstack-dependency kungze/openstack-dep --namespace openstack --wait --timeout 2400s
helm install openstack-keystone kungze/keystone --namespace openstack --wait --timeout 2400s
helm install openstack-glance kungze/glance --namespace openstack --wait --timeout 2400s
helm install openstack-cinder kungze/cinder --set lvm.loop_device_size=10240 --namespace openstack --wait --timeout 2400s
- name: df3
run: df -h

- name: Create openstack user for cinder-metal-cis
run: |
sudo apt install python3-openstackclient -y
export OS_USERNAME=$(kubectl get secret -n openstack openstack-keystone -o jsonpath="{.data.OS_USERNAME}" | base64 --decode)
export OS_PROJECT_DOMAIN_NAME=$(kubectl get secret -n openstack openstack-keystone -o jsonpath="{.data.OS_PROJECT_DOMAIN_NAME}" | base64 --decode)
export OS_USER_DOMAIN_NAME=$(kubectl get secret -n openstack openstack-keystone -o jsonpath="{.data.OS_USER_DOMAIN_NAME}" | base64 --decode)
export OS_PROJECT_NAME=$(kubectl get secret -n openstack openstack-keystone -o jsonpath="{.data.OS_PROJECT_NAME}" | base64 --decode)
export OS_REGION_NAME=$(kubectl get secret -n openstack openstack-keystone -o jsonpath="{.data.OS_REGION_NAME}" | base64 --decode)
export OS_PASSWORD=$(kubectl get secrets -n openstack openstack-password -o jsonpath="{.data.keystone-admin-password}" | base64 --decode)
export OS_AUTH_URL=$(kubectl get secret -n openstack openstack-keystone -o jsonpath="{.data.OS_CLUSTER_URL}" | base64 --decode)
export OS_INTERFACE=internal
openstack project create kubernetes
openstack user create --project kubernetes --password ChangeMe kubernetes
openstack role add --project kubernetes --user kubernetes member
shell: bash
13 changes: 9 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,41 @@ require (
google.golang.org/grpc v1.48.0
google.golang.org/protobuf v1.28.0
gopkg.in/ini.v1 v1.51.0
k8s.io/api v0.24.3
k8s.io/apimachinery v0.24.3
k8s.io/client-go v0.24.3
k8s.io/cloud-provider v0.24.3
k8s.io/klog/v2 v2.70.1
k8s.io/mount-utils v0.24.3
k8s.io/utils v0.0.0-20220713171938-56c0de1e6f5e
sigs.k8s.io/e2e-framework v0.0.7
)

require (
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/imdario/mergo v0.3.5 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/vladimirvivien/gexe v0.1.1 // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
Expand All @@ -51,9 +56,9 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/api v0.24.3 // indirect
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect
sigs.k8s.io/controller-runtime v0.11.1 // indirect
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit c63a5fa

Please sign in to comment.