Merge pull request #5279 from cybozu-go/ceph-allow-to-set-the-device-for-osd-in-the-integration-test
Ceph: make it possible to pass the integration test in the local environment
This commit is contained in:
4 files changed
+24
-8
No files matched your search
Vendored
+3
-2
@@ -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'''
|
||||
}
|
||||
|
||||
+4
-3
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
eof
|
||||
Reference in new issue
Block a user