diff --git a/Jenkinsfile b/Jenkinsfile index cf305b6c8..bf1844b8d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -190,7 +190,7 @@ def RunIntegrationTest(k, v) { sh '''#!/bin/bash export KUBECONFIG=$HOME/admin.conf tests/scripts/helm.sh up - tests/scripts/localPathPV.sh''' + tests/scripts/localPathPV.sh /dev/xvdc''' try{ echo "Running full regression" sh '''#!/bin/bash @@ -202,7 +202,8 @@ def RunIntegrationTest(k, v) { TEST_BASE_DIR="WORKING_DIR" \ TEST_LOG_COLLECTION_LEVEL='''+"${env.getLogs}"+''' \ STORAGE_PROVIDER_TESTS='''+"${env.testProvider}"+''' \ - TEST_ARGUMENTS='''+"${env.testArgs}"+''' + TEST_ARGUMENTS='''+"${env.testArgs}"+''' \ + TEST_SCRATCH_DEVICE=/dev/xvdc kubectl config view _output/tests/linux_amd64/integration -test.v -test.timeout 7200s 2>&1 | tee _output/tests/integrationTests.log''' } diff --git a/tests/README.md b/tests/README.md index fa4537b13..6cd859bff 100644 --- a/tests/README.md +++ b/tests/README.md @@ -6,9 +6,10 @@ quickly spin up a Kubernetes cluster.The Test framework is designed to install R ## Requirements 1. Docker version => 1.2 && < 17.0 (for other alternatives, see below) -2. Ubuntu 16 (the framework has only been tested on this version) -3. Kubernetes with kubectl configured -4. Rook +1. Ubuntu 16 (the framework has only been tested on this version) +1. kernel >= 4.8 +1. Kubernetes with kubectl configured +1. Rook ## Instructions diff --git a/tests/framework/installer/ceph_installer.go b/tests/framework/installer/ceph_installer.go index 67a351c93..df3f5dd9f 100644 --- a/tests/framework/installer/ceph_installer.go +++ b/tests/framework/installer/ceph_installer.go @@ -758,6 +758,10 @@ func (h *CephInstaller) WipeClusterDisks(namespace string) error { // (non-boot) disks on a node, allowing Ceph to use the disk(s) during its testing. func (h *CephInstaller) GetDiskWipeJob(nodeName, jobName, namespace string) string { // put the wipe job in the cluster namespace so that logs get picked up in failure conditions + scratchDevice := os.Getenv("TEST_SCRATCH_DEVICE") + if scratchDevice == "" { + scratchDevice = "/dev/xvdc" + } return `apiVersion: batch/v1 kind: Job metadata: @@ -821,7 +825,7 @@ spec: done # Wipe the specific disk in the CI that was running in raw mode set +Ee - block=/dev/xvdc + block=` + scratchDevice + ` wipefs --all "$block" dd if=/dev/zero of="$block" bs=1M count=100 oflag=direct,dsync set -Ee diff --git a/tests/scripts/localPathPV.sh b/tests/scripts/localPathPV.sh index d64166708..3152279ba 100755 --- a/tests/scripts/localPathPV.sh +++ b/tests/scripts/localPathPV.sh @@ -1,5 +1,15 @@ #!/bin/bash +test_scratch_device=/dev/xvdc +if [ $# -ge 1 ] ; then + test_scratch_device=$1 +fi + +if [ ! -b "${test_scratch_device}" ] ; then + echo "invalid scratch device name: ${test_scratch_device}" >&2 + exit 1 +fi + lsblk random_string=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8) @@ -103,7 +113,7 @@ spec: persistentVolumeReclaimPolicy: Retain volumeMode: Block local: - path: "/dev/xvdc" + path: "${test_scratch_device}" nodeAffinity: required: nodeSelectorTerms: @@ -119,4 +129,4 @@ metadata: name: manual provisioner: kubernetes.io/no-provisioner volumeBindingMode: WaitForFirstConsumer -eof \ No newline at end of file +eof