Skip to content

Commit

Permalink
test: quota and refquota params
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinandan Purkait <[email protected]>
  • Loading branch information
Abhinandan-Purkait committed Jan 7, 2025
1 parent bc25af4 commit b399c87
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 51 deletions.
2 changes: 1 addition & 1 deletion ci/ci-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TEST_DIR="tests"

# Prepare env for running BDD tests
# Minikube is already running
helm install zfs-localpv ./deploy/helm/charts -n $OPENEBS_NAMESPACE --create-namespace --set zfsPlugin.pullPolicy=Never --set analytics.enabled=false
helm install zfs-localpv ./deploy/helm/charts -n $OPENEBS_NAMESPACE --create-namespace --set zfsPlugin.image.pullPolicy=Never --set analytics.enabled=false
kubectl apply -f "$SNAP_CLASS"

dumpAgentLogs() {
Expand Down
122 changes: 72 additions & 50 deletions tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package tests

import (
"fmt"
"time"

"github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -130,11 +131,19 @@ func VerifyStorageClassParams(property map[string]string) {
// Refer https://github.com/openebs/zfs-localpv/issues/560#issuecomment-2232535073
func generateThinProvisionParams(property map[string]string) {
if property["fstype"] == "zfs" {
property["quota"] = capacity
property["reservation"] = defaultReservation
if property["thinprovision"] == "no" {
property["reservation"] = capacity
if property["quotatype"] == "quota" {
property["quota"] = string(capacity)
if property["thinprovision"] == "no" {
property["reservation"] = string(capacity)
}
}
if property["quotatype"] == "refquota" {
property["refquota"] = string(capacity)
if property["thinprovision"] == "no" {
property["refreservation"] = string(capacity)
}
}
delete(property, "quotatype")
} else {
property["quota"] = "-"
property["reservation"] = defaultReservation
Expand Down Expand Up @@ -628,58 +637,71 @@ func deletePVC(pvcname string) {

func getStoragClassParams() []map[string]string {
return []map[string]string{
//{
// "fstype": "zfs",
// "compression": "lz4",
//},
//{
// "fstype": "zfs",
// "compression": "lz4",
// "dedup": "on",
//},
//{
// "fstype": "zfs",
// "compression": "zstd-fast",
// "dedup": "on",
// "thinprovision": "yes",
//},
//{
// "fstype": "zfs",
// "dedup": "on",
//},
//{
// "fstype": "zfs",
// "compression": "gzip",
// "thinprovision": "yes",
//},
//{
// "fstype": "zfs",
// "compression": "gzip",
// "dedup": "on",
// "thinprovision": "yes",
//},
//{
// "fstype": "xfs",
// "compression": "zstd-6",
//},
//{
// "fstype": "xfs",
// "compression": "zstd-6",
// "dedup": "on",
// "thinprovision": "yes",
//},
//{
// "fstype": "ext4",
// "dedup": "on",
//},
//{
// "fstype": "btrfs",
// "compression": "zstd-6",
// "dedup": "on",
//},
//{
// "fstype": "xfs",
// "compression": "zstd-fast",
//},
{
"fstype": "zfs",
"compression": "lz4",
},
{
"fstype": "zfs",
"compression": "lz4",
"dedup": "on",
},
{
"fstype": "zfs",
"compression": "zstd-fast",
"dedup": "on",
"thinprovision": "yes",
"fstype": "zfs",
"quotatype": "quota",
},
{
"fstype": "zfs",
"dedup": "on",
},
{
"fstype": "zfs",
"compression": "gzip",
"thinprovision": "yes",
"fstype": "zfs",
"quotatype": "refquota",
},
{
"fstype": "zfs",
"compression": "gzip",
"dedup": "on",
"thinprovision": "yes",
},
{
"fstype": "xfs",
"compression": "zstd-6",
},
{
"fstype": "xfs",
"compression": "zstd-6",
"dedup": "on",
"thinprovision": "yes",
},
{
"fstype": "ext4",
"dedup": "on",
},
{
"fstype": "btrfs",
"compression": "zstd-6",
"dedup": "on",
},
{
"fstype": "xfs",
"compression": "zstd-fast",
"thinprovision": "no",
"quotatype": "refquota",
},
}
}

0 comments on commit b399c87

Please sign in to comment.