Skip to content

Commit

Permalink
Issue 152: Fixing end to end tests (#153)
Browse files Browse the repository at this point in the history
* Issue 152: Fixing e2e tests

Signed-off-by: SrishT <[email protected]>

* Issue 152: Commenting delete cluster

Signed-off-by: SrishT <[email protected]>

* Issue 152: Testing

Signed-off-by: SrishT <[email protected]>

* Issue 152: Testing

Signed-off-by: SrishT <[email protected]>

* Issue 152: Testing

Signed-off-by: SrishT <[email protected]>

* Issue 152: ssh into github actions

Signed-off-by: SrishT <[email protected]>

* Issue 152: ssh into github actions

Signed-off-by: SrishT <[email protected]>

* Issue 152: Testing

Signed-off-by: SrishT <[email protected]>

* Issue 152: Configuraing readiness probe timeouts

Signed-off-by: SrishT <[email protected]>

* Issue 152: Testing

Signed-off-by: SrishT <[email protected]>

* Issue 152: Removing commented lines

Signed-off-by: SrishT <[email protected]>

Co-authored-by: SrishT <[email protected]>
  • Loading branch information
SrishT and SrishT authored Jul 2, 2021
1 parent eeeffbd commit fa42ba3
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ jobs:
- name: Creating nodes
run: |
cd .. && tar -czvf bookkeeper-operator.tar.gz bookkeeper-operator
packet-cli device create -H $CLUSTER_NAME"-master" -o "ubuntu_20_04" -P c1.small.x86 -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 -f nrt1
packet-cli device create -H $CLUSTER_NAME"-master" -o "ubuntu_20_04" -P c1.small.x86 -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 -f ams1
packet-cli device get -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 | grep $CLUSTER_NAME"-master" | awk '{print $2}'
CLUSTER_ID=$(packet-cli device get -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 | grep $CLUSTER_NAME"-master" | awk '{print $2}' | tr -d ' ')
echo "cluster id is $CLUSTER_ID"
packet-cli device create -H $CLUSTER_NAME"-worker1" -o "ubuntu_20_04" -P c1.small.x86 -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 -f nrt1
packet-cli device create -H $CLUSTER_NAME"-worker2" -o "ubuntu_20_04" -P c1.small.x86 -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 -f nrt1
packet-cli device create -H $CLUSTER_NAME"-worker1" -o "ubuntu_20_04" -P c1.small.x86 -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 -f ams1
packet-cli device create -H $CLUSTER_NAME"-worker2" -o "ubuntu_20_04" -P c1.small.x86 -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 -f ams1
MASTER_STATE=$(packet-cli device get -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 | grep $CLUSTER_NAME"-master" | awk '{print $10}' | tr -d ' ')
while [ "$MASTER_STATE" != "active" ]; do MASTER_STATE=`packet-cli device get -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 | grep $CLUSTER_NAME"-master" | awk '{print $10}' | tr -d ' '`;sleep 30;done
CLUSTER_IP=$(packet-cli device get -i $CLUSTER_ID -y | grep "\- address:" | head -1 |awk '{print $3}' | tr -d ' ')
Expand Down
7 changes: 7 additions & 0 deletions charts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Moved

The bookkeeper operator and bookkeeper helm charts originally developed as part of this repository have been moved [here](https://github.com/pravega/charts/tree/master/charts).

A copy of the charts will remain here till the migration is complete. We will however no longer accept pull requests for any modification to these charts. All subsequent issues and pull requests will be tracked in the [pravega/charts](https://github.com/pravega/charts) repository by following the guidelines mentioned [here](https://github.com/pravega/charts/wiki/Contributing).

[Here](https://github.com/pravega/bookkeeper-operator/issues/147) is the issue for tracking this migration activity.
8 changes: 4 additions & 4 deletions pkg/test/e2e/e2eutil/bkcluster_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ func CreateBKCluster(t *testing.T, f *framework.Framework, ctx *framework.TestCt
b.Spec.EnvVars = "bookkeeper-configmap"
b.Spec.ZookeeperUri = "zookeeper-client:2181"
b.Spec.Image.ImageSpec.PullPolicy = "IfNotPresent"
b.Spec.Probes.ReadinessProbe.PeriodSeconds = 15
b.Spec.Probes.ReadinessProbe.TimeoutSeconds = 10
b.Spec.Probes.ReadinessProbe.PeriodSeconds = 35
b.Spec.Probes.ReadinessProbe.TimeoutSeconds = 30
b.Spec.Storage.LedgerVolumeClaimTemplate = &corev1.PersistentVolumeClaimSpec{
AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce},
Resources: corev1.ResourceRequirements{
Expand Down Expand Up @@ -92,8 +92,8 @@ func CreateBKClusterWithCM(t *testing.T, f *framework.Framework, ctx *framework.
b.Spec.EnvVars = cm
b.Spec.ZookeeperUri = "zookeeper-client:2181"
b.Spec.Image.ImageSpec.PullPolicy = "IfNotPresent"
b.Spec.Probes.ReadinessProbe.PeriodSeconds = 15
b.Spec.Probes.ReadinessProbe.TimeoutSeconds = 10
b.Spec.Probes.ReadinessProbe.PeriodSeconds = 35
b.Spec.Probes.ReadinessProbe.TimeoutSeconds = 30
b.Spec.Storage.LedgerVolumeClaimTemplate = &corev1.PersistentVolumeClaimSpec{
AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce},
Resources: corev1.ResourceRequirements{
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/bookkeepercluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ package e2e

import (
"testing"
"time"

framework "github.com/operator-framework/operator-sdk/pkg/test"
"github.com/operator-framework/operator-sdk/pkg/test/e2eutil"
Expand Down Expand Up @@ -52,6 +53,7 @@ func testBookkeeperCluster(t *testing.T) {
f := framework.Global
// wait for bookkeeper-operator to be ready
err = e2eutil.WaitForOperatorDeployment(t, f.KubeClient, namespace, "bookkeeper-operator", 1, bookkeeper_e2eutil.RetryInterval, bookkeeper_e2eutil.Timeout)
time.Sleep(60 * time.Second)
if err != nil {
t.Fatal(err)
}
Expand Down
9 changes: 7 additions & 2 deletions test/e2e/resources/kubernetes_master_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ echo "TCPKeepAlive yes" >> /etc/ssh/sshd_config
echo "ClientAliveInterval 60" >> /etc/ssh/sshd_config
echo "ClientAliveCountMax 3" >> /etc/ssh/sshd_config
service sshd restart
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
echo "update done"
sudo apt install docker.io -y
sudo apt-get install docker-ce=5:19.03.9~3-0~ubuntu-focal -y
echo "docker install"
sudo systemctl enable --now docker
sudo apt-get install nfs-common -y
Expand All @@ -31,7 +36,7 @@ sed -i '2 s/^/#/' /etc/fstab
echo "swapoff UUID=$UUID"
swapoff UUID=$UUID
IP=`ifconfig bond0:0 | grep "inet" | awk '{print $2}'`
sudo kubeadm init --apiserver-advertise-address=$IP
sudo kubeadm init --apiserver-advertise-address=$IP --pod-network-cidr=192.168.0.0/16
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
Expand Down

0 comments on commit fa42ba3

Please sign in to comment.