Skip to content

Commit

Permalink
add more wait time for plugin start up
Browse files Browse the repository at this point in the history
fix mount failure due to same mount path

fix integration test endpoint issue

change mount point path in integration test

fix mount/unmount test failure

do not run test on china cloud if not set
  • Loading branch information
andyzhangx committed Feb 8, 2019
1 parent e7c3e6b commit 8b34fd3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ script:
- make azurefile
- go test -covermode=count -coverprofile=profile.cov ./pkg/...
- $GOPATH/bin/goveralls -coverprofile=profile.cov -service=travis-ci
- test/integration/run-tests-all-clouds.sh
- sudo test/integration/run-tests-all-clouds.sh
- make azurefile-windows
- make azurefile-container
13 changes: 9 additions & 4 deletions test/integration/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ set -euo pipefail
csc=$GOPATH/bin/csc

endpoint="tcp://127.0.0.1:10000"
if [ $# -eq 1 ]; then
if [ $# -gt 0 ]; then
endpoint=$1
fi

target_path="/tmp/testmount"
if [ $# -gt 1 ]; then
target_path=$2
fi

# run CSI driver as a background service
_output/azurefileplugin --endpoint $endpoint --nodeid CSINode -v=5 &
sleep 3
sleep 10

# begin to run CSI functions one by one
if [ ! -z $aadClientSecret ]; then
Expand All @@ -41,15 +46,15 @@ if [ ! -z $aadClientSecret ]; then
echo "got volume id: $volumeid"

echo "mount volume test:"
$csc node publish --endpoint $endpoint --cap 1,block --target-path ~/testmount $volumeid
$csc node publish --endpoint $endpoint --cap 1,block --target-path $target_path $volumeid
retcode=$?
if [ $retcode -gt 0 ]; then
exit $retcode
fi
sleep 2

echo "unmount volume test:"
$csc node unpublish --endpoint $endpoint --target-path ~/testmount $volumeid
$csc node unpublish --endpoint $endpoint --target-path $target_path $volumeid
retcode=$?
if [ $retcode -gt 0 ]; then
exit $retcode
Expand Down
9 changes: 5 additions & 4 deletions test/integration/run-tests-all-clouds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,19 @@ if [ ! -z $aadClientSecret ]; then
sed -i "s/location-input/$location/g" $AZURE_CREDENTIAL_FILE
fi

sudo test/integration/run-test.sh "tcp://127.0.0.1:10000"
test/integration/run-test.sh "tcp://127.0.0.1:10000" "/tmp/testmount1"

# run test on AzureChinaCloud
cp test/integration/azure.json $AZURE_CREDENTIAL_FILE
if [ ! -z $aadClientSecret_china ]; then
cp test/integration/azure.json $AZURE_CREDENTIAL_FILE

sed -i "s/AzurePublicCloud/AzureChinaCloud/g" $AZURE_CREDENTIAL_FILE
sed -i "s/tenantId-input/${tenantId_china}/g" $AZURE_CREDENTIAL_FILE
sed -i "s/subscriptionId-input/${subscriptionId_china}/g" $AZURE_CREDENTIAL_FILE
sed -i "s/aadClientId-input/${aadClientId_china}/g" $AZURE_CREDENTIAL_FILE
sed -i "s#aadClientSecret-input#${aadClientSecret_china}#g" $AZURE_CREDENTIAL_FILE
sed -i "s/resourceGroup-input/${resourceGroup_china}/g" $AZURE_CREDENTIAL_FILE
sed -i "s/location-input/${location_china}/g" $AZURE_CREDENTIAL_FILE
fi

sudo test/integration/run-test.sh "tcp://127.0.0.1:10001"
test/integration/run-test.sh "tcp://127.0.0.1:10001" "/tmp/testmount2"
fi

0 comments on commit 8b34fd3

Please sign in to comment.