Skip to content

Commit

Permalink
chore(migrate): add travis sanity test
Browse files Browse the repository at this point in the history
Signed-off-by: shubham <[email protected]>
  • Loading branch information
shubham14bajpai committed Jul 24, 2020
1 parent 4affb70 commit 7db4642
Show file tree
Hide file tree
Showing 8 changed files with 1,046 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ go:
env:
global:
- ARCH=$(go env GOARCH)
- CHANGE_MINIKUBE_NONE_USER=true
- MINIKUBE_WANTUPDATENOTIFICATION=false
- MINIKUBE_WANTREPORTERRORPROMPT=false
- MINIKUBE_HOME=$HOME
- CHANGE_MINIKUBE_NONE_USER=true
- KUBECONFIG=$HOME/.kube/config

sudo: required

Expand All @@ -33,12 +39,24 @@ install:

before_script: # TODO add golangci yaml config
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.25.0
- if [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.18.1/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/;
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v1.8.1/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/;
mkdir -p $HOME/.kube $HOME/.minikube;
touch $KUBECONFIG;
sudo minikube start --vm-driver=none --kubernetes-version=v1.16.0;
sudo chown -R travis /home/travis/.minikube/;
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done;
fi

script:
- make test
- if [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then
make all.amd64;
make all.amd64 || exit 1;
fi
# run cstor v1 migration sanity test
- ./ci/migrate/sanity.sh


after_success:
- make deploy-images
Expand Down
126 changes: 126 additions & 0 deletions ci/migrate/application.tmp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
#Use the following YAMLs to create a cStor Storage Pool.
apiVersion: openebs.io/v1alpha1
kind: StoragePoolClaim
metadata:
name: sparse-claim
annotations:
cas.openebs.io/config: |
- name: PoolResourceRequests
value: |-
memory: 2Gi
- name: PoolResourceLimits
value: |-
memory: 4Gi
spec:
name: sparse-claim
type: sparse
poolSpec:
poolType: striped
blockDevices:
blockDeviceList:
- SPCBD
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: openebs-cstor-sparse
annotations:
openebs.io/cas-type: cstor
cas.openebs.io/config: |
- name: StoragePoolClaim
value: "sparse-claim"
- name: ReplicaCount
value: "1"
- name: TargetResourceLimits
value: |-
memory: 1Gi
cpu: 200m
- name: TargetResourceRequests
value: |-
memory: 500Mi
cpu: 100m
- name: AuxResourceLimits
value: |-
memory: 1Gi
cpu: 200m
- name: AuxResourceRequests
value: |-
memory: 500Mi
cpu: 100m
- name: TargetTolerations
value: |-
t1:
key: "key1"
operator: "Equal"
value: "value1"
effect: "NoSchedule"
t2:
key: "key1"
operator: "Equal"
value: "value1"
effect: "NoExecute"
- name: TargetNodeSelector
value: |-
nodetype: storage
- name: QueueDepth
value: "32"
- name: Luworkers
value: "6"
- name: ZvolWorkers
value: "1"
provisioner: openebs.io/provisioner-iscsi
---
apiVersion: v1
kind: Service
metadata:
labels:
lkey: lvalue
name: busybox
spec:
clusterIP: None
selector:
lkey: lvalue
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: busybox
labels:
lkey: lvalue
spec:
serviceName: busybox
replicas: 1
selector:
matchLabels:
lkey: lvalue
#The Label "openebs.io/replica-anti-affinity"
#needs to be added in order to distribute volume replicas.
affinity_label: busybox
template:
metadata:
labels:
lkey: lvalue
affinity_label: busybox
spec:
containers:
- name: busybox
image: busybox
imagePullPolicy: IfNotPresent
command:
- sh
- -c
- 'date > /busybox/date.txt; sync; sleep 5; sync; tail -f /dev/null;'
volumeMounts:
- name: testclaim
mountPath: /busybox
volumeClaimTemplates:
- metadata:
name: testclaim
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: openebs-cstor-sparse
resources:
requests:
storage: 2G

Loading

0 comments on commit 7db4642

Please sign in to comment.