test: add install/uninstall deployment script test

fix script issue
This commit is contained in:
andyzhangx 2020-03-31 09:14:29 +00:00
parent c583f74565
commit eea7abd14a
5 changed files with 34 additions and 4 deletions

View File

@ -10,7 +10,7 @@ CSI on Windows support is an alpha feature since Kubernetes v1.18, refer to [Win
## Install CSI Driver
```console
curl -skSL https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/install-driver-standalone.sh | bash -s master,windows --
curl -skSL https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/install-driver.sh | bash -s master,windows --
```
## Deploy a Windows pod with PVC mount

View File

@ -22,9 +22,17 @@ if [[ "$#" -gt 0 ]]; then
fi
repo="https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy"
if [[ "$#" -gt 1 ]]; then
if [[ "$2" == *"local"* ]]; then
echo "use local deploy"
repo="./deploy"
fi
fi
if [ $ver != "master" ]; then
repo="$repo/$ver"
fi
echo "Installing Azure File CSI driver, version: $ver ..."
kubectl apply -f $repo/crd-csi-driver-registry.yaml
kubectl apply -f $repo/crd-csi-node-info.yaml

View File

@ -22,6 +22,13 @@ if [[ "$#" -gt 0 ]]; then
fi
repo="https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy"
if [[ "$#" -gt 1 ]]; then
if [[ "$2" == *"local"* ]]; then
echo "use local deploy"
repo="./deploy"
fi
fi
if [ $ver != "master" ]; then
repo="$repo/$ver"
fi

View File

@ -2,7 +2,7 @@
### Install by kubectl
```console
curl -skSL https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/install-driver-standalone.sh | bash -s master --
curl -skSL https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/install-driver.sh | bash -s master --
```
- check pods status:
@ -22,5 +22,5 @@ csi-azurefile-node-dr4s4 3/3 Running 0 7m4
### clean up Azure File CSI driver
```console
curl -skSL https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/uninstall-driver-standalone.sh | bash -s --
curl -skSL https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/uninstall-driver.sh | bash -s --
```

View File

@ -99,7 +99,7 @@ var _ = ginkgo.BeforeSuite(func() {
var _ = ginkgo.AfterSuite(func() {
if !isUsingInTreeVolumePlugin && testutil.IsRunningInProw() {
azurefileLog := testCmd{
command: "sh",
command: "bash",
args: []string{"test/utils/azurefile_log.sh"},
startLog: "===================azurefile log===================",
endLog: "===================================================",
@ -112,6 +112,21 @@ var _ = ginkgo.AfterSuite(func() {
}
execTestCmd([]testCmd{azurefileLog, e2eTeardown})
// install/uninstall CSI Driver deployment scripts test
installDriver := testCmd{
command: "bash",
args: []string{"deploy/install-driver.sh", "master", "windows,local"},
startLog: "===================install CSI Driver deployment scripts test===================",
endLog: "===================================================",
}
uninstallDriver := testCmd{
command: "bash",
args: []string{"deploy/uninstall-driver.sh", "master", "windows,local"},
startLog: "===================uninstall CSI Driver deployment scripts test===================",
endLog: "===================================================",
}
execTestCmd([]testCmd{installDriver, uninstallDriver})
err := credentials.DeleteAzureCredentialFile()
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}