Skip to content

Commit

Permalink
[TA2761] feat(cstor vol): Add test script for cstor volume. (#519)
Browse files Browse the repository at this point in the history
Added a bash script to test cstor volume covering both success and
failure scenarios.

1. Test to check successful creation and deletion of a cstor volume.
2. Test to check if the volume creation fails when the requested replicas are more than available pools.
3. Test to check if volume is writeable when all the replica pools are restarted.
4. Test to check if the volume is writeable when the target pod is restarted.

Reference: https://docs.google.com/document/d/15Ecf1ORhTeflCfrrkF-NB08727X9tUbYgGQxj2WP0_w/edit?usp=sharing

Signed-off-by: Prince Rachit Sinha <[email protected]>
  • Loading branch information
Prince Rachit Sinha authored and kmova committed Sep 29, 2018
1 parent 096f8d2 commit c7f8f7c
Show file tree
Hide file tree
Showing 29 changed files with 1,139 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hack/cstor_volume/test/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This is a test framework for cStor Volumes. This is only a validation on how to design actual testing framework for cstor volume. It includes test cases which should be later migrated to CITF. Some test cases are not yet covered feel free to add them.

**How to use this script?**
Clone this repo and cd to this directory.
Configure operator and pool config yaml if required.
Run `bash vol-test.sh -o openebs-operator.yaml -p openebs-config.yaml`

**Important notes**
> It is assumed that there are at lease three nodes and each one of them has at least one external disk attached.
> The kubectl should be in admin context.
> The cluster is clean i.e. no existing openebs installation exists.
19 changes: 19 additions & 0 deletions hack/cstor_volume/test/delete.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!bin/bash
source ./util.sh
echo -e ${GREEN}REMOVING OPENEBS${NC}

if [ "$POOL_FILE" == "" ]; then
POOL_FILE="openebs-config.yaml"
fi

if [ "$OP_FILE" == "" ]; then
OP_FILE="openebs-operator.yaml"
fi

kubectl delete po -n openebs -l "openebs.io/persistent-volume-claim=openebs-pvc" --force --grace-period=0

kubectlDelete $POOL_FILE
kubectlDelete $OP_FILE

kubectl delete crd castemplates.openebs.io cstorpools.openebs.io cstorvolumereplicas.openebs.io cstorvolumes.openebs.io disks.openebs.io runtasks.openebs.io storagepoolclaims.openebs.io storagepools.openebs.io

14 changes: 14 additions & 0 deletions hack/cstor_volume/test/openebs-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: openebs.io/v1alpha1
kind: StoragePoolClaim
metadata:
name: cstor-pool-default-0.7.0
spec:
name: cstor-pool-default-0.7.0
type: disk
maxPools: 3
poolSpec:
poolType: striped
# disks:
# diskList:
# - disk-4268137899842721d2d4fc0c16c3b138
# - disk-99cde73d1defa35375029e8164e974e0
Loading

0 comments on commit c7f8f7c

Please sign in to comment.