diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d64d161..b5b0eec8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,16 +1,3 @@ -# Copyright 2020 The OpenEBS Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. name: build on: @@ -199,12 +186,12 @@ jobs: - name: Set up infra for integration test run: | sudo apt-get update && sudo apt-get install -y xfsprogs quota linux-modules-extra-`uname -r` - go install github.com/onsi/ginkgo/ginkgo@v1.16.4 + go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@v2.14.0 sed -e '/openebs-provisioner-hostpath/{N;s/IfNotPresent/Never/}' deploy/kubectl/openebs-operator-lite.yaml | kubectl apply -f - - name: Integration test run: | - make hostpath-integration-test + make integration-test localpv-e2e: # to ignore builds on release AND build only if the branch is develop diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 96a36d47..860d3ac5 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,17 +1,3 @@ -# Copyright 2018-2020 The OpenEBS Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - name: ci on: @@ -135,12 +121,12 @@ jobs: - name: Set up infra for integration test run: | sudo apt-get update && sudo apt-get install -y xfsprogs quota linux-modules-extra-`uname -r` - go install github.com/onsi/ginkgo/ginkgo@v1.16.4 + go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@v2.14.0 sed -e '/openebs-provisioner-hostpath/{N;s/IfNotPresent/Never/}' deploy/kubectl/openebs-operator-lite.yaml | kubectl apply -f - - name: Integration test run: | - make hostpath-integration-test + make integration-test localpv-e2e: runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index e508c193..c87287a7 100644 --- a/Makefile +++ b/Makefile @@ -126,11 +126,6 @@ testv: format integration-test: @cd tests && sudo -E env "PATH=${PATH}" ginkgo -v -failFast -# Requires KUBECONFIG env and Ginkgo binary -.PHONY: hostpath-integration-test -hostpath-integration-test: - @cd tests && sudo -E env "PATH=${PATH}" ginkgo -focus="TEST HOSTPATH.*" -v -failFast - .PHONY: format format: @echo "--> Running go fmt" diff --git a/go.mod b/go.mod index d848cdab..428fa0e7 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module github.com/openebs/dynamic-localpv-provisioner go 1.19 require ( - github.com/onsi/ginkgo v1.16.4 - github.com/onsi/gomega v1.27.4 + github.com/onsi/ginkgo/v2 v2.14.0 + github.com/onsi/gomega v1.30.0 github.com/openebs/google-analytics-4 v0.2.1 github.com/openebs/maya v1.12.1-0.20211022052259-bd98908028af github.com/pkg/errors v0.9.1 @@ -27,18 +27,19 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/emicklei/go-restful/v3 v3.10.2 // indirect - github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/ghodss/yaml v1.0.0 // indirect - github.com/go-logr/logr v1.2.4 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/gnostic v0.6.9 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect + github.com/google/pprof v0.0.0-20240625030939-27f56978b8b0 // indirect github.com/google/uuid v1.3.0 // indirect github.com/huandu/xstrings v1.3.1 // indirect github.com/imdario/mergo v0.3.15 // indirect @@ -54,29 +55,29 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/nxadm/tail v1.4.8 // indirect github.com/openebs/lib-csi v0.8.2 // indirect github.com/prometheus/client_golang v1.11.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.26.0 // indirect github.com/prometheus/procfs v0.6.0 // indirect github.com/ryanuber/columnize v2.1.0+incompatible // indirect + github.com/stretchr/testify v1.8.4 // indirect go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.17.0 // indirect - golang.org/x/crypto v0.14.0 // indirect - golang.org/x/net v0.17.0 // indirect + golang.org/x/crypto v0.24.0 // indirect + golang.org/x/net v0.26.0 // indirect golang.org/x/oauth2 v0.8.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/term v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/term v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.3.0 // indirect + golang.org/x/tools v0.22.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect google.golang.org/grpc v1.55.0 // indirect - google.golang.org/protobuf v1.30.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect k8s.io/klog v1.0.0 // indirect k8s.io/kube-openapi v0.0.0-20230525220651-2546d827e515 // indirect diff --git a/go.sum b/go.sum index 95992a9f..0593835e 100644 --- a/go.sum +++ b/go.sum @@ -131,7 +131,6 @@ github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQL github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -146,8 +145,8 @@ github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7 github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= @@ -165,8 +164,9 @@ github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/ github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -224,8 +224,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= @@ -248,8 +248,9 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20240625030939-27f56978b8b0 h1:e+8XbKB6IMn8A4OAyZccO4pYfB3s7bt6azNIPE7AnPg= +github.com/google/pprof v0.0.0-20240625030939-27f56978b8b0/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -370,18 +371,17 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk= -github.com/onsi/ginkgo/v2 v2.9.1 h1:zie5Ly042PD3bsCvsSOPvRnFwyo3rKe64TJlD6nu0mk= +github.com/onsi/ginkgo/v2 v2.14.0 h1:vSmGj2Z5YPb9JwCWT6z6ihcUvDhuXLc3sJiqd3jMKAY= +github.com/onsi/ginkgo/v2 v2.14.0/go.mod h1:JkUdW7JkN0V6rFvsHcJ478egV3XH9NxpD27Hal/PhZw= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= @@ -389,8 +389,8 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= -github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E= -github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ= +github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= +github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/openebs/google-analytics-4 v0.2.1 h1:+DgJjcPM3uVyWp9VxvNQgNXCWWv0OFhopijFdPVVX9Q= github.com/openebs/google-analytics-4 v0.2.1/go.mod h1:lKjvRs6HAYOlOTYjtOUp35iTutoXzRL0hOeVAvLAfZI= github.com/openebs/lib-csi v0.8.2 h1:HmoiZX3VXFPglwqnRPnRus7K58ixDWBa19OpPZGk2Ws= @@ -456,8 +456,9 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= @@ -505,8 +506,9 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -597,8 +599,9 @@ golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -629,8 +632,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -700,14 +703,16 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= +golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -719,8 +724,9 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -794,7 +800,8 @@ golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -937,7 +944,6 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/tests/README.md b/tests/README.md index 6322d412..b08ec11f 100644 --- a/tests/README.md +++ b/tests/README.md @@ -25,7 +25,7 @@ Local PV Provisioner BDD tests are developed using ginkgo & gomega libraries. - You will require the Ginkgo binary to be able to run the tests. Install the latest Ginkgo binary using the following command: ```bash - $ go install github.com/onsi/ginkgo/ginkgo@v1.16.4 + $ go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@v2.14.0 ``` - Get your Kubernetes Cluster ready and make sure you can run diff --git a/tests/hostdevice_test.go b/tests/hostdevice_test.go deleted file mode 100644 index e45aea07..00000000 --- a/tests/hostdevice_test.go +++ /dev/null @@ -1,1106 +0,0 @@ -/* -Copyright 2019 The OpenEBS Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package tests - -import ( - "context" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - localpv_app "github.com/openebs/dynamic-localpv-provisioner/cmd/provisioner-localpv/app" - deploy "github.com/openebs/dynamic-localpv-provisioner/pkg/kubernetes/api/apps/v1/deployment" - container "github.com/openebs/dynamic-localpv-provisioner/pkg/kubernetes/api/core/v1/container" - pvc "github.com/openebs/dynamic-localpv-provisioner/pkg/kubernetes/api/core/v1/persistentvolumeclaim" - pts "github.com/openebs/dynamic-localpv-provisioner/pkg/kubernetes/api/core/v1/podtemplatespec" - volume "github.com/openebs/dynamic-localpv-provisioner/pkg/kubernetes/api/core/v1/volume" - sc "github.com/openebs/dynamic-localpv-provisioner/pkg/kubernetes/api/storage/v1/storageclass" - blockdeviceclaim "github.com/openebs/maya/pkg/blockdeviceclaim/v1alpha1" - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - storagev1 "k8s.io/api/storage/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var _ = Describe("TEST HOSTDEVICE LOCAL PV", func() { - var ( - scObj *storagev1.StorageClass - pvcObj *corev1.PersistentVolumeClaim - accessModes = []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce} - capacity = "2Gi" - deployName = "busybox-device" - label = "demo=hostdevice-deployment" - scNamePrefix = "sc-hd" - scName string - bdcName string - pvcName = "pvc-hd" - deployObj *appsv1.Deployment - labelselector = map[string]string{ - "demo": "hostdevice-deployment", - } - ) - - When("a StorageClass is created", func() { - It("should create a StorageClass", func() { - By("building a StorageClass") - scObj, err = sc.NewStorageClass( - sc.WithGenerateName(scNamePrefix), - sc.WithLabels(map[string]string{ - "openebs.io/test-sc": "true", - }), - sc.WithLocalPV(), - sc.WithDevice(), - sc.WithVolumeBindingMode("WaitForFirstConsumer"), - sc.WithReclaimPolicy("Delete"), - ) - Expect(err).To( - BeNil(), - "while building StorageClass with name prefix {%s}", - scNamePrefix, - ) - - By("creating StorageClass API resource") - scObj, err = ops.SCClient.Create(context.TODO(), scObj) - Expect(err).To( - BeNil(), - "while creating StorageClass with name prefix {%s}", - scNamePrefix, - ) - scName = scObj.ObjectMeta.Name - }) - }) - - When("PVC with StorageClass "+scName+" is created", func() { - It("should create a PVC ", func() { - By("verifying if NDM prerequisites are met") - Expect(ops.IsNdmPrerequisiteMet( - openebsNamespace, - ndmLabelSelector, - ndmOperatorLabelSelector, - )).To( - BeTrue(), - "when checking if NDM Pods are up and 1 "+ - "Unclaimed and Active BlockDevice "+ - "with no filesystem is present", - ) - - By("building a PVC") - pvcObj, err = pvc.NewBuilder(). - WithName(pvcName). - WithNamespace(namespaceObj.Name). - WithStorageClass(scName). - WithAccessModes(accessModes). - WithCapacity(capacity).Build() - Expect(err).ShouldNot( - HaveOccurred(), - "while building pvc {%s} in namespace {%s}", - pvcName, - namespaceObj.Name, - ) - - By("creating above PVC") - pvcObj, err = ops.PVCClient.WithNamespace(namespaceObj.Name).Create(context.TODO(), pvcObj) - Expect(err).To( - BeNil(), - "while creating PVC {%s} in namespace {%s}", - pvcName, - namespaceObj.Name, - ) - }) - }) - - When("deployment with busybox image is created", func() { - It("should create a deployment and a running pod", func() { - - By("building a deployment") - deployObj, err = deploy.NewBuilder(). - WithName(deployName). - WithNamespace(namespaceObj.Name). - WithLabelsNew(labelselector). - WithSelectorMatchLabelsNew(labelselector). - WithPodTemplateSpecBuilder( - pts.NewBuilder(). - WithLabelsNew(labelselector). - WithContainerBuildersNew( - container.NewBuilder(). - WithName("busybox"). - WithImage("busybox"). - WithCommandNew( - []string{ - "sleep", - "3600", - }, - ). - WithVolumeMountsNew( - []corev1.VolumeMount{ - corev1.VolumeMount{ - Name: "demo-vol2", - MountPath: "/mnt/store1", - }, - }, - ), - ). - WithVolumeBuildersNew( - volume.NewBuilder(). - WithName("demo-vol2"). - WithPVCSource(pvcName), - ), - ). - Build() - Expect(err).ShouldNot( - HaveOccurred(), - "while building delpoyment {%s} in namespace {%s}", - deployName, - namespaceObj.Name, - ) - - By("creating above deployment") - _, err = ops.DeployClient.WithNamespace(namespaceObj.Name). - Create(context.TODO(), deployObj) - Expect(err).To( - BeNil(), - "while creating deployment {%s} in namespace {%s}", - deployName, - namespaceObj.Name, - ) - - By("verifying pod count as 1") - podCount := ops.GetPodRunningCountEventually(namespaceObj.Name, label, 1) - Expect(podCount).To(Equal(1), "while verifying pod count") - - }) - }) - When("remove finalizer", func() { - It("finalizer should come back after provisioner restart", func() { - bdcName = "bdc-pvc-" + string(pvcObj.GetUID()) - bdcObj, err := ops.BDCClient.WithNamespace(openebsNamespace).Get(context.TODO(), bdcName, - metav1.GetOptions{}) - Expect(err).To(BeNil()) - - _, err = blockdeviceclaim.BuilderForAPIObject(bdcObj).WithConfigPath(ops.KubeConfigPath). - BDC.RemoveFinalizer(localpv_app.LocalPVFinalizer) - Expect(err).To(BeNil()) - - podList, err := ops.PodClient. - WithNamespace(openebsNamespace). - List(context.TODO(), metav1.ListOptions{LabelSelector: LocalPVProvisionerLabelSelector}) - Expect(err).To(BeNil()) - err = ops.PodClient.WithNamespace(openebsNamespace).Delete(context.TODO(), podList.Items[0].Name, &metav1.DeleteOptions{}) - Expect(err).To(BeNil()) - - podStatus := ops.IsPodDeletedEventually(openebsNamespace, podList.Items[0].Name) - Expect(podStatus).To(BeTrue(), "when checking if LocalPV Provisioner Pod was deleted") - - podCount := ops.GetPodRunningCountEventually(openebsNamespace, LocalPVProvisionerLabelSelector, 1) - Expect(podCount).To(Equal(1)) - - Expect(ops.IsFinalizerExistsOnBDC(bdcName, localpv_app.LocalPVFinalizer)).To(BeTrue()) - }) - }) - When("deployment is deleted", func() { - It("should not have any deployment or pod", func() { - - By("deleting above deployment") - err = ops.DeployClient.WithNamespace(namespaceObj.Name).Delete(context.TODO(), deployName, &metav1.DeleteOptions{}) - Expect(err).To( - BeNil(), - "while deleting deployment {%s} in namespace {%s}", - deployName, - namespaceObj.Name, - ) - - By("verifying pod count as 0") - podCount := ops.GetPodCountEventually(namespaceObj.Name, label, nil, 0) - Expect(podCount).To(Equal(0), "while verifying pod count") - - }) - }) - - When("PVC with StorageClass "+scName+" is deleted ", func() { - It("should delete the pvc", func() { - By("getting the PV name and the BD name") - pvName := ops.GetPVNameFromPVCName(namespaceObj.Name, pvcName) - bdName := ops.GetBDNameFromBDCName(bdcName, openebsNamespace) - - By("deleting above pvc") - err = ops.PVCClient.WithNamespace(namespaceObj.Name).Delete(context.TODO(), pvcName, &metav1.DeleteOptions{}) - Expect(err).To( - BeNil(), - "while deleting PVC {%s} in namespace {%s}", - pvcName, - namespaceObj.Name, - ) - - By("having the Provisioner delete the PV") - status := ops.IsPVDeletedEventually(pvName) - Expect(status).To( - BeTrue(), - "while waiting for the Provisioner to delete PV {%s}", - pvName, - ) - - By("verifying PVC is deleted") - status = ops.IsPVCDeletedEventually(pvcName, namespaceObj.Name) - Expect(status).To( - BeTrue(), - "when checking status of deleted PVC {%s}", - pvcName, - ) - - By("verifying BD is cleaned up") - status = ops.IsBdCleanedUpEventually(openebsNamespace, bdName, bdcName) - Expect(status).To( - BeTrue(), - "when checking status of BDC {%s}, which should have been deleted", - bdcName, - ) - }) - }) -}) - -var _ = Describe("TEST HOSTDEVICE LOCAL PV WITH VOLUMEMODE AS BLOCK", func() { - var ( - scObj *storagev1.StorageClass - pvcObj *corev1.PersistentVolumeClaim - accessModes = []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce} - capacity = "2Gi" - deployName = "busybox-device" - label = "demo=hostdevice-deployment" - scNamePrefix = "sc-hd-block" - scName string - bdcName string - pvcName = "pvc-hd-block" - deployObj *appsv1.Deployment - labelselector = map[string]string{ - "demo": "hostdevice-deployment", - } - ) - - When("a StorageClass is created", func() { - It("should create a StorageClass", func() { - By("building a StorageClass") - scObj, err = sc.NewStorageClass( - sc.WithGenerateName(scNamePrefix), - sc.WithLabels(map[string]string{ - "openebs.io/test-sc": "true", - }), - sc.WithLocalPV(), - sc.WithDevice(), - sc.WithVolumeBindingMode("WaitForFirstConsumer"), - sc.WithReclaimPolicy("Delete"), - ) - Expect(err).To( - BeNil(), - "while building StorageClass with name prefix {%s}", - scNamePrefix, - ) - - By("creating StorageClass API resource") - scObj, err = ops.SCClient.Create(context.TODO(), scObj) - Expect(err).To( - BeNil(), - "while creating StorageClass with name prefix {%s}", - scNamePrefix, - ) - scName = scObj.ObjectMeta.Name - }) - }) - - When("PVC with StorageClass "+scName+", and volumeMode as Block, is created", func() { - It("should create a PVC ", func() { - var ( - blockVolumeMode = corev1.PersistentVolumeBlock - ) - - By("verifying if NDM prerequisites are met") - Expect(ops.IsNdmPrerequisiteMet( - openebsNamespace, - ndmLabelSelector, - ndmOperatorLabelSelector, - )).To( - BeTrue(), - "when checking if NDM Pods are up and 1 "+ - "Unclaimed and Active BlockDevice "+ - "with no filesystem is present", - ) - - By("building a PVC") - pvcObj, err = pvc.NewBuilder(). - WithName(pvcName). - WithNamespace(namespaceObj.Name). - WithStorageClass(scName). - WithAccessModes(accessModes). - WithVolumeMode(blockVolumeMode). - WithCapacity(capacity).Build() - Expect(err).ShouldNot( - HaveOccurred(), - "while building PVC {%s} in namespace {%s}", - pvcName, - namespaceObj.Name, - ) - - By("creating above PVC") - pvcObj, err = ops.PVCClient.WithNamespace(namespaceObj.Name).Create(context.TODO(), pvcObj) - Expect(err).To( - BeNil(), - "while creating PVC {%s} in namespace {%s}", - pvcName, - namespaceObj.Name, - ) - }) - }) - - When("deployment with busybox image is created", func() { - It("should create a deployment and a running pod", func() { - - By("building a deployment") - deployObj, err = deploy.NewBuilder(). - WithName(deployName). - WithNamespace(namespaceObj.Name). - WithLabelsNew(labelselector). - WithSelectorMatchLabelsNew(labelselector). - WithPodTemplateSpecBuilder( - pts.NewBuilder(). - WithLabelsNew(labelselector). - WithContainerBuildersNew( - container.NewBuilder(). - WithName("busybox"). - WithImage("busybox"). - WithCommandNew( - []string{ - "sleep", - "3600", - }, - ). - WithVolumeDevices( - []corev1.VolumeDevice{ - corev1.VolumeDevice{ - Name: "demo-block-vol1", - DevicePath: "/dev/sdc", - }, - }, - ), - ). - WithVolumeBuildersNew( - volume.NewBuilder(). - WithName("demo-block-vol1"). - WithPVCSource(pvcName), - ), - ). - Build() - Expect(err).ShouldNot( - HaveOccurred(), - "while building delpoyment {%s} in namespace {%s}", - deployName, - namespaceObj.Name, - ) - - By("creating above deployment") - _, err = ops.DeployClient.WithNamespace(namespaceObj.Name). - Create(context.TODO(), deployObj) - Expect(err).To( - BeNil(), - "while creating deployment {%s} in namespace {%s}", - deployName, - namespaceObj.Name, - ) - - By("verifying pod count as 1") - podCount := ops.GetPodRunningCountEventually(namespaceObj.Name, label, 1) - Expect(podCount).To(Equal(1), "while verifying pod count") - - }) - }) - - When("remove finalizer", func() { - It("finalizer should come back after provisioner restart", func() { - bdcName = "bdc-pvc-" + string(pvcObj.GetUID()) - bdcObj, err := ops.BDCClient.WithNamespace(openebsNamespace).Get(context.TODO(), bdcName, - metav1.GetOptions{}) - Expect(err).To(BeNil()) - - _, err = blockdeviceclaim.BuilderForAPIObject(bdcObj).WithConfigPath(ops.KubeConfigPath). - BDC.RemoveFinalizer(localpv_app.LocalPVFinalizer) - Expect(err).To(BeNil()) - - podList, err := ops.PodClient. - WithNamespace(openebsNamespace). - List(context.TODO(), metav1.ListOptions{LabelSelector: LocalPVProvisionerLabelSelector}) - Expect(err).To(BeNil()) - err = ops.PodClient.WithNamespace(openebsNamespace).Delete(context.TODO(), podList.Items[0].Name, &metav1.DeleteOptions{}) - Expect(err).To(BeNil()) - - podStatus := ops.IsPodDeletedEventually(openebsNamespace, podList.Items[0].Name) - Expect(podStatus).To(BeTrue(), "when checking if LocalPV Provisioner Pod was deleted") - - podCount := ops.GetPodRunningCountEventually(openebsNamespace, LocalPVProvisionerLabelSelector, 1) - Expect(podCount).To(Equal(1)) - - Expect(ops.IsFinalizerExistsOnBDC(bdcName, localpv_app.LocalPVFinalizer)).To(BeTrue()) - }) - }) - When("deployment is deleted", func() { - It("should not have any deployment or pod", func() { - - By("deleting above deployment") - err = ops.DeployClient.WithNamespace(namespaceObj.Name).Delete(context.TODO(), deployName, &metav1.DeleteOptions{}) - Expect(err).To( - BeNil(), - "while deleting deployment {%s} in namespace {%s}", - deployName, - namespaceObj.Name, - ) - - By("verifying pod count as 0") - podCount := ops.GetPodCountEventually(namespaceObj.Name, label, nil, 0) - Expect(podCount).To(Equal(0), "while verifying pod count") - - }) - }) - - When("PVC with StorageClass "+scName+" is deleted ", func() { - It("should delete the PVC", func() { - By("getting the PV name and the BD name") - pvName := ops.GetPVNameFromPVCName(namespaceObj.Name, pvcName) - bdName := ops.GetBDNameFromBDCName(bdcName, openebsNamespace) - - By("deleting above pvc") - err = ops.PVCClient.WithNamespace(namespaceObj.Name).Delete(context.TODO(), pvcName, &metav1.DeleteOptions{}) - Expect(err).To( - BeNil(), - "while deleting PVC {%s} in namespace {%s}", - pvcName, - namespaceObj.Name, - ) - - By("having the Provisioner delete the PV") - status := ops.IsPVDeletedEventually(pvName) - Expect(status).To( - BeTrue(), - "while waiting for the Provisioner to delete PV {%s}", - pvName, - ) - - By("verifying PVC is deleted") - status = ops.IsPVCDeletedEventually(pvcName, namespaceObj.Name) - Expect(status).To( - BeTrue(), - "when checking status of deleted PVC {%s}", - pvcName, - ) - - By("verifying BD is cleaned up") - status = ops.IsBdCleanedUpEventually(openebsNamespace, bdName, bdcName) - Expect(status).To( - BeTrue(), - "when checking status of BDC {%s}, which should have been deleted", - bdcName, - ) - - }) - }) - -}) -var _ = Describe("[-ve] TEST HOSTDEVICE LOCAL PV", func() { - var ( - scObj *storagev1.StorageClass - pvcObj *corev1.PersistentVolumeClaim - accessModes = []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce} - capacity = "2Gi" - deployName = "busybox-device" - label = "demo=hostdevice-deployment" - scNamePrefix = "sc-hd" - scName string - pvcName = "pvc-hd" - deployObj *appsv1.Deployment - labelselector = map[string]string{ - "demo": "hostdevice-deployment", - } - //bdcTimeoutDuration = 60 - existingPVCObj *corev1.PersistentVolumeClaim - existingDeployName = "existing-busybox-device" - existinglabel = "demo=existing-hostdevice-deployment" - existingPVCName = "existing-pvc-hd" - existingDeployObj *appsv1.Deployment - existingLabelselector = map[string]string{ - "demo": "existing-hostdevice-deployment", - } - ) - - When("a StorageClass is created", func() { - It("should create a StorageClass", func() { - By("building a StorageClass") - scObj, err = sc.NewStorageClass( - sc.WithGenerateName(scNamePrefix), - sc.WithLabels(map[string]string{ - "openebs.io/test-sc": "true", - }), - sc.WithLocalPV(), - sc.WithDevice(), - sc.WithVolumeBindingMode("WaitForFirstConsumer"), - sc.WithReclaimPolicy("Delete"), - ) - Expect(err).To( - BeNil(), - "while building StorageClass with name prefix {%s}", - scNamePrefix, - ) - - By("creating StorageClass API resource") - scObj, err = ops.SCClient.Create(context.TODO(), scObj) - Expect(err).To( - BeNil(), - "while creating StorageClass with name prefix {%s}", - scNamePrefix, - ) - scName = scObj.ObjectMeta.Name - }) - }) - - When("existing PVC with StorageClass "+scName+" is created", func() { - It("should create a PVC", func() { - By("verifying if NDM prerequisites are met") - Expect(ops.IsNdmPrerequisiteMet( - openebsNamespace, - ndmLabelSelector, - ndmOperatorLabelSelector, - )).To( - BeTrue(), - "when checking if NDM Pods are up and 1 "+ - "Unclaimed and Active BlockDevice "+ - "with no filesystem is present", - ) - - By("building a pvc") - existingPVCObj, err = pvc.NewBuilder(). - WithName(existingPVCName). - WithNamespace(namespaceObj.Name). - WithStorageClass(scName). - WithAccessModes(accessModes). - WithCapacity(capacity).Build() - Expect(err).ShouldNot( - HaveOccurred(), - "while building PVC {%s} in namespace {%s}", - existingPVCName, - namespaceObj.Name, - ) - - By("creating above PVC") - existingPVCObj, err = ops.PVCClient.WithNamespace(namespaceObj.Name).Create(context.TODO(), existingPVCObj) - Expect(err).To( - BeNil(), - "while creating PVC {%s} in namespace {%s}", - existingPVCName, - namespaceObj.Name, - ) - }) - }) - - When("existing deployment with busybox image is created", func() { - It("should create a deployment and a running pod", func() { - - By("building a deployment") - existingDeployObj, err = deploy.NewBuilder(). - WithName(existingDeployName). - WithNamespace(namespaceObj.Name). - WithLabelsNew(existingLabelselector). - WithSelectorMatchLabelsNew(existingLabelselector). - WithPodTemplateSpecBuilder( - pts.NewBuilder(). - WithLabelsNew(existingLabelselector). - WithContainerBuildersNew( - container.NewBuilder(). - WithName("busybox"). - WithImage("busybox"). - WithCommandNew( - []string{ - "sleep", - "3600", - }, - ). - WithVolumeMountsNew( - []corev1.VolumeMount{ - corev1.VolumeMount{ - Name: "demo-vol3", - MountPath: "/mnt/store1", - }, - }, - ), - ). - WithVolumeBuildersNew( - volume.NewBuilder(). - WithName("demo-vol3"). - WithPVCSource(existingPVCName), - ), - ). - Build() - Expect(err).ShouldNot( - HaveOccurred(), - "while building deployment {%s} in namespace {%s}", - existingDeployName, - namespaceObj.Name, - ) - - By("creating above deployment") - _, err = ops.DeployClient.WithNamespace(namespaceObj.Name). - Create(context.TODO(), existingDeployObj) - Expect(err).To( - BeNil(), - "while creating deployment {%s} in namespace {%s}", - existingDeployName, - namespaceObj.Name, - ) - - By("verifying pod count as 1") - podCount := ops.GetPodRunningCountEventually(namespaceObj.Name, existinglabel, 1) - Expect(podCount).To(Equal(1), "while verifying pod count") - - }) - }) - - When("another PVC with StorageClass "+scName+" is created", func() { - It("should create a PVC ", func() { - - By("building a PVC") - pvcObj, err = pvc.NewBuilder(). - WithName(pvcName). - WithNamespace(namespaceObj.Name). - WithStorageClass(scName). - WithAccessModes(accessModes). - WithCapacity(capacity).Build() - Expect(err).ShouldNot( - HaveOccurred(), - "while building PVC {%s} in namespace {%s}", - pvcName, - namespaceObj.Name, - ) - - By("creating above pvc") - pvcObj, err = ops.PVCClient.WithNamespace(namespaceObj.Name).Create(context.TODO(), pvcObj) - Expect(err).To( - BeNil(), - "while creating PVC {%s} in namespace {%s}", - pvcName, - namespaceObj.Name, - ) - }) - }) - - When("another deployment with busybox image and above PVC is created", func() { - It("should not create a deployment and a running pod", func() { - - By("building a deployment") - deployObj, err = deploy.NewBuilder(). - WithName(deployName). - WithNamespace(namespaceObj.Name). - WithLabelsNew(labelselector). - WithSelectorMatchLabelsNew(labelselector). - WithPodTemplateSpecBuilder( - pts.NewBuilder(). - WithLabelsNew(labelselector). - WithContainerBuildersNew( - container.NewBuilder(). - WithName("busybox"). - WithImage("busybox"). - WithCommandNew( - []string{ - "sleep", - "3600", - }, - ). - WithVolumeMountsNew( - []corev1.VolumeMount{ - corev1.VolumeMount{ - Name: "demo-vol2", - MountPath: "/mnt/store1", - }, - }, - ), - ). - WithVolumeBuildersNew( - volume.NewBuilder(). - WithName("demo-vol2"). - WithPVCSource(pvcName), - ), - ). - Build() - Expect(err).ShouldNot( - HaveOccurred(), - "while building delpoyment {%s} in namespace {%s}", - deployName, - namespaceObj.Name, - ) - - By("creating above deployment") - _, err = ops.DeployClient.WithNamespace(namespaceObj.Name). - Create(context.TODO(), deployObj) - Expect(err).To( - BeNil(), - "while creating deployment {%s} in namespace {%s}", - deployName, - namespaceObj.Name, - ) - - By("verifying pod count as 1") - podCount := ops.GetPodCountEventually(namespaceObj.Name, existinglabel, nil, 1) - Expect(podCount).To(Equal(1), "while verifying running pod count") - - By("verifying running pod count as 0") - //Giving the check time till timeout to try to get a running pod - podRunningCount := ops.GetPodRunningCountEventually(namespaceObj.Name, label, 1) - Expect(podRunningCount).To(Equal(0), "while verifying pod count") - }) - }) - - When("above deployment is deleted", func() { - It("should not have any deployment or pod", func() { - - By("deleting above deployment") - err = ops.DeployClient.WithNamespace(namespaceObj.Name).Delete(context.TODO(), deployName, &metav1.DeleteOptions{}) - Expect(err).To( - BeNil(), - "while deleting deployment {%s} in namespace {%s}", - deployName, - namespaceObj.Name, - ) - - By("verifying pod count as 0") - podCount := ops.GetPodCountEventually(namespaceObj.Name, label, nil, 0) - Expect(podCount).To(Equal(0), "while verifying pod count") - - }) - }) - - When("above PVC with StorageClass "+scName+" is deleted ", func() { - It("should delete the PVC", func() { - By("getting the BDC name") - bdcName := "bdc-pvc-" + string(pvcObj.GetUID()) - - By("deleting above PVC") - err = ops.PVCClient.WithNamespace(namespaceObj.Name).Delete(context.TODO(), pvcName, &metav1.DeleteOptions{}) - Expect(err).To( - BeNil(), - "while deleting PVC {%s} in namespace {%s}", - pvcName, - namespaceObj.Name, - ) - - By("verifying PVC is deleted") - status := ops.IsPVCDeletedEventually(pvcName, namespaceObj.Name) - Expect(status).To( - BeTrue(), - "when checking status of deleted PVC {%s}", - pvcName, - ) - - By("veryfying BDC is deleted") - status = ops.IsBDCDeletedEventually(bdcName, openebsNamespace) - Expect(status).To( - BeTrue(), - "when checking status of BDC {%s}, which should have been deleted", - bdcName, - ) - }) - }) - - When("existing deployment is deleted", func() { - It("should not have any deployment or pod", func() { - - By("deleting above deployment") - err = ops.DeployClient.WithNamespace(namespaceObj.Name). - Delete(context.TODO(), existingDeployName, &metav1.DeleteOptions{}) - Expect(err).To( - BeNil(), - "while deleting deployment {%s} in namespace {%s}", - existingDeployName, - namespaceObj.Name, - ) - - By("verifying pod count as 0") - podCount := ops.GetPodCountEventually(namespaceObj.Name, existinglabel, nil, 0) - Expect(podCount).To(Equal(0), "while verifying pod count") - }) - }) - - When("existing PVC with storageclass "+scName+" is deleted ", func() { - It("should delete the PVC", func() { - By("getting the PV name, BD name and the BDC name") - bdcName := "bdc-pvc-" + string(existingPVCObj.GetUID()) - pvName := ops.GetPVNameFromPVCName(namespaceObj.Name, existingPVCName) - bdName := ops.GetBDNameFromBDCName(bdcName, openebsNamespace) - - By("deleting above PVC") - err = ops.PVCClient.WithNamespace(namespaceObj.Name).Delete(context.TODO(), existingPVCName, &metav1.DeleteOptions{}) - Expect(err).To( - BeNil(), - "while deleting PVC {%s} in namespace {%s}", - existingPVCName, - namespaceObj.Name, - ) - - By("having the Provisioner delete the PV") - status := ops.IsPVDeletedEventually(pvName) - Expect(status).To( - BeTrue(), - "while waiting for the Provisioner to delete PV {%s}", - pvName, - ) - - By("verifying PVC is deleted") - status = ops.IsPVCDeletedEventually(existingPVCName, namespaceObj.Name) - Expect(status).To( - BeTrue(), - "when checking status of deleted PVC {%s}", - existingPVCName, - ) - - By("verifying BD is cleaned up") - status = ops.IsBdCleanedUpEventually(openebsNamespace, bdName, bdcName) - Expect(status).To( - BeTrue(), - "when checking status of BDC {%s}, which should have been deleted", - bdcName, - ) - }) - }) -}) - -var _ = Describe("[-ve] TEST HOSTDEVICE LOCAL PV WITH VOLUMEMODE AS BLOCK ", func() { - var ( - scObj *storagev1.StorageClass - //pvcObj *corev1.PersistentVolumeClaim - accessModes = []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce} - capacity = "2Gi" - //deployName = "busybox-device" - //label = "demo=hostdevice-deployment" - //pvcName = "pvc-hd-block" - //deployObj *appsv1.Deployment - blockVolumeMode = corev1.PersistentVolumeBlock - //labelselector = map[string]string{ - // "demo": "hostdevice-deployment", - //} - scNamePrefix = "sc-hd-block" - scName string - existingPVCObj *corev1.PersistentVolumeClaim - existingDeployName = "existing-busybox-device" - existinglabel = "demo=existing-hostdevice-deployment" - existingPVCName = "existing-pvc-hd-block" - existingDeployObj *appsv1.Deployment - existingLabelselector = map[string]string{ - "demo": "existing-hostdevice-deployment", - } - ) - - When("a StorageClass is created", func() { - It("should create a StorageClass", func() { - By("building a StorageClass") - scObj, err = sc.NewStorageClass( - sc.WithGenerateName(scNamePrefix), - sc.WithLabels(map[string]string{ - "openebs.io/test-sc": "true", - }), - sc.WithLocalPV(), - sc.WithDevice(), - sc.WithVolumeBindingMode("WaitForFirstConsumer"), - sc.WithReclaimPolicy("Delete"), - ) - Expect(err).To( - BeNil(), - "while building StorageClass with name prefix {%s}", - scNamePrefix, - ) - - By("creating StorageClass API resource") - scObj, err = ops.SCClient.Create(context.TODO(), scObj) - Expect(err).To( - BeNil(), - "while creating StorageClass with name prefix {%s}", - scNamePrefix, - ) - scName = scObj.ObjectMeta.Name - }) - }) - - When("existing PVC with StorageClass "+scName+" is created", func() { - It("should create a PVC", func() { - By("verifying if NDM prerequisites are met") - Expect(ops.IsNdmPrerequisiteMet( - openebsNamespace, - ndmLabelSelector, - ndmOperatorLabelSelector, - )).To( - BeTrue(), - "when checking if NDM Pods are up and 1 "+ - "Unclaimed and Active BlockDevice "+ - "with no filesystem is present", - ) - - By("building a PVC") - existingPVCObj, err = pvc.NewBuilder(). - WithName(existingPVCName). - WithNamespace(namespaceObj.Name). - WithStorageClass(scName). - WithAccessModes(accessModes). - WithVolumeMode(blockVolumeMode). - WithCapacity(capacity).Build() - Expect(err).ShouldNot( - HaveOccurred(), - "while building pvc {%s} in namespace {%s}", - existingPVCName, - namespaceObj.Name, - ) - - By("creating above PVC") - existingPVCObj, err = ops.PVCClient.WithNamespace(namespaceObj.Name).Create(context.TODO(), existingPVCObj) - Expect(err).To( - BeNil(), - "while creating PVC {%s} in namespace {%s}", - existingPVCName, - namespaceObj.Name, - ) - }) - }) - When("existing deployment with busybox image is created", func() { - It("should create a deployment but should be unable to get a running pod, with PVC volumeMode set to Block,but added as volumeMount in Deployment", func() { - - By("building a deployment, with volume Mount for a Block volumeMode PVC") - existingDeployObj, err = deploy.NewBuilder(). - WithName(existingDeployName). - WithNamespace(namespaceObj.Name). - WithLabelsNew(existingLabelselector). - WithSelectorMatchLabelsNew(existingLabelselector). - WithPodTemplateSpecBuilder( - pts.NewBuilder(). - WithLabelsNew(existingLabelselector). - WithContainerBuildersNew( - container.NewBuilder(). - WithName("busybox"). - WithImage("busybox"). - WithCommandNew( - []string{ - "sleep", - "3600", - }, - ). - WithVolumeMountsNew( - []corev1.VolumeMount{ - corev1.VolumeMount{ - Name: "demo-block-vol2", - MountPath: "/mnt/store1", - }, - }, - ), - ). - WithVolumeBuildersNew( - volume.NewBuilder(). - WithName("demo-block-vol2"). - WithPVCSource(existingPVCName), - ), - ). - Build() - Expect(err).ShouldNot( - HaveOccurred(), - "while building deployment {%s} in namespace {%s}", - existingDeployName, - namespaceObj.Name, - ) - - By("creating above deployment") - _, err = ops.DeployClient.WithNamespace(namespaceObj.Name). - Create(context.TODO(), existingDeployObj) - Expect(err).To( - BeNil(), - "while creating deployment {%s} in namespace {%s}", - existingDeployName, - namespaceObj.Name, - ) - - By("verifying PVC status as bound") - status := ops.IsPVCBoundEventually(namespaceObj.Name, existingPVCName) - Expect(status).To(Equal(true), "while checking status equal to bound") - - By("verifying pod count as 1") - podCount := ops.GetPodCountEventually(namespaceObj.Name, existinglabel, nil, 1) - Expect(podCount).To(Equal(1), "while verifying running pod count") - - By("verifying running pod count as 0") - //Giving the check time till timeout to try to get a running pod - runningPodCount := ops.GetPodRunningCountEventually(namespaceObj.Name, existinglabel, 1) - Expect(runningPodCount).To(Equal(0), "while verifying running pod count") - - }) - }) - When("above deployment is deleted", func() { - It("should not have any deployment or pod", func() { - - By("deleting above deployment") - err = ops.DeployClient.WithNamespace(namespaceObj.Name).Delete(context.TODO(), existingDeployName, &metav1.DeleteOptions{}) - Expect(err).To( - BeNil(), - "while deleting deployment {%s} in namespace {%s}", - existingDeployName, - namespaceObj.Name, - ) - - By("verifying pod count as 0") - podCount := ops.GetPodCountEventually(namespaceObj.Name, existinglabel, nil, 0) - Expect(podCount).To(Equal(0), "while verifying pod count") - - }) - }) - - When("existing PVC with storageclass "+scName+" is deleted ", func() { - It("should delete the PVC", func() { - By("getting the PV name, BD name and the BDC name") - bdcName := "bdc-pvc-" + string(existingPVCObj.GetUID()) - pvName := ops.GetPVNameFromPVCName(namespaceObj.Name, existingPVCName) - bdName := ops.GetBDNameFromBDCName(bdcName, openebsNamespace) - - By("deleting above PVC") - err = ops.PVCClient.WithNamespace(namespaceObj.Name).Delete(context.TODO(), existingPVCName, &metav1.DeleteOptions{}) - Expect(err).To( - BeNil(), - "while deleting PVC {%s} in namespace {%s}", - existingPVCName, - namespaceObj.Name, - ) - - By("having the Provisioner delete the PV") - status := ops.IsPVDeletedEventually(pvName) - Expect(status).To( - BeTrue(), - "while waiting for the Provisioner to delete PV {%s}", - pvName, - ) - - By("verifying PVC is deleted") - status = ops.IsPVCDeletedEventually(existingPVCName, namespaceObj.Name) - Expect(status).To( - BeTrue(), - "when checking status of deleted PVC {%s}", - existingPVCName, - ) - - By("verifying BD is cleaned up") - status = ops.IsBdCleanedUpEventually(openebsNamespace, bdName, bdcName) - Expect(status).To( - BeTrue(), - "when checking status of BDC {%s}, which should have been deleted", - bdcName, - ) - }) - }) -}) diff --git a/tests/hostpath_quota_test.go b/tests/hostpath_quota_test.go index ffd533dd..c4b525c1 100644 --- a/tests/hostpath_quota_test.go +++ b/tests/hostpath_quota_test.go @@ -1,26 +1,10 @@ -/* -Copyright 2021 The OpenEBS Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - package tests import ( "context" "fmt" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" storagev1 "k8s.io/api/storage/v1" diff --git a/tests/hostpath_test.go b/tests/hostpath_test.go index 36d4e11e..087a111e 100644 --- a/tests/hostpath_test.go +++ b/tests/hostpath_test.go @@ -1,25 +1,9 @@ -/* -Copyright 2019 The OpenEBS Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - package tests import ( "context" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" diff --git a/tests/suite_test.go b/tests/suite_test.go index 2f2b23a7..8f18fa46 100644 --- a/tests/suite_test.go +++ b/tests/suite_test.go @@ -1,16 +1,3 @@ -/* -Copyright 2019 The OpenEBS Authors -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - package tests import ( @@ -20,7 +7,7 @@ import ( "path/filepath" "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"