Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: added test to validate the LVMO resources #149

Merged

Conversation

riya-singhal31
Copy link
Contributor

This test validates all the resources created by LVMO

Signed-off-by: riya-singhal31 [email protected]

@riya-singhal31 riya-singhal31 requested a review from nbalacha April 12, 2022 12:28
e2e/lvm/lvm_suite_test.go Outdated Show resolved Hide resolved
Context("Run a dummy test", func() {
// Test to validate all the resources created by LVMO.
var _ = Describe("Validation test", func() {
Context("Validate all the resources", func() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Context("Validate all the resources", func() {
Context("Validate LVMCluster reconciliation", func() {

e2e/validation.go Outdated Show resolved Hide resolved
e2e/validation.go Outdated Show resolved Hide resolved
e2e/validation.go Show resolved Hide resolved
@riya-singhal31 riya-singhal31 force-pushed the validation-test branch 2 times, most recently from 54adb4b to b17be50 Compare April 13, 2022 06:25
lvmVolumeGroupName = "vg1"
storageClassName = "odf-lvm-vg1"
csiDriverName = "topolvm.cybozu.com"
daemonSetName = "topolvm-node"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
daemonSetName = "topolvm-node"
topolvmNodeDaemonSetName = "topolvm-node"

storageClassName = "odf-lvm-vg1"
csiDriverName = "topolvm.cybozu.com"
daemonSetName = "topolvm-node"
deploymentName = "topolvm-controller"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
deploymentName = "topolvm-controller"
topolvmCtrlDeploymentName = "topolvm-controller"

)

const (
timeout = time.Second * 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might need a larger timeout here. Maybe 30 s?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's working fine for 10 s. Should I still change it to 30?

@riya-singhal31 riya-singhal31 force-pushed the validation-test branch 8 times, most recently from b691658 to f6a879c Compare April 14, 2022 14:04
@riya-singhal31
Copy link
Contributor Author

/retest

@riya-singhal31 riya-singhal31 force-pushed the validation-test branch 5 times, most recently from 76200a4 to 3b62176 Compare April 18, 2022 09:07
func ValidateResources() error {

// Validate Storage class
err := ValidateStorageClass()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the order here to match the order in the LVMCluster reconcile function:

  1. CSI Driver
  2. Topolvm controller
  3. vg manager
  4. LVMVolumeGroup
  5. topolvm node
  6. Storageclass

	// Validate CSI Driver
	err := ValidateCSIDriver()
	if err != nil {
		return err
	}

	//Validate TopoLVM Controller
	err = ValidateTopolvmController()
	if err != nil {
		return err
	}

	// Validate VG Manager Daemonset
	err = ValidateVGManager()
	if err != nil {
		return err
	}
	// Validate LVMVg
	err = ValidateLVMvg()
	if err != nil {
		return err
	}

	// Validate Topolvm node
	err = ValidateTopolvmNode()
	if err != nil {
		return err
	}
	// Validate Storage class
	err = ValidateStorageClass()
	if err != nil {
		return err
	}

Comment on lines 77 to 71
func ValidateTopolvmNode() error {
ds := appsv1.DaemonSet{}
Eventually(func() bool {
err := DeployManagerObj.GetCrClient().Get(context.TODO(), types.NamespacedName{Name: topolvmNodeDaemonSetName, Namespace: InstallNamespace}, &ds)
if err != nil {
debug("TopoLVM Node: %v", err)
return false
}
return true
}, timeout, interval).Should(BeTrue())
debug("TopoLVM node found\n")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func ValidateTopolvmNode() error {
ds := appsv1.DaemonSet{}
Eventually(func() bool {
err := DeployManagerObj.GetCrClient().Get(context.TODO(), types.NamespacedName{Name: topolvmNodeDaemonSetName, Namespace: InstallNamespace}, &ds)
if err != nil {
debug("TopoLVM Node: %v", err)
return false
}
return true
}, timeout, interval).Should(BeTrue())
debug("TopoLVM node found\n")
func ValidateTopolvmNode() error {
ds := appsv1.DaemonSet{}
Eventually(func() bool {
debug("%s\n", "Starting function - topolvmnode")
err := DeployManagerObj.GetCrClient().Get(context.TODO(), types.NamespacedName{Name: topolvmNodeDaemonSetName, Namespace: InstallNamespace}, &ds)
if err != nil {
debug("topolvmNode : %s\n", err.Error())
return false
}
return ds.Status.DesiredNumberScheduled == ds.Status.NumberReady
}, timeout, interval).Should(BeTrue())

@nbalacha
Copy link
Contributor

/test lvm-operator-bundle-e2e-aws

@riya-singhal31
Copy link
Contributor Author

/retest

2 similar comments
@riya-singhal31
Copy link
Contributor Author

/retest

@riya-singhal31
Copy link
Contributor Author

/retest

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 19, 2022
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 19, 2022
return err == nil
}, timeout, interval).Should(BeTrue())

debug("depoloyment found\n")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
debug("depoloyment found\n")
debug("topolvm-controller deployment found\n")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

This test validates all the resources created by LVMO.

Signed-off-by: riya-singhal31 <[email protected]>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 20, 2022

@riya-singhal31: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/lvm-operator-bundle-e2e-aws 571bac0 link false /test lvm-operator-bundle-e2e-aws

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 20, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 20, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nbalacha, riya-singhal31

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 20, 2022
@openshift-merge-robot openshift-merge-robot merged commit 8990402 into openshift:main Apr 20, 2022
@riya-singhal31 riya-singhal31 deleted the validation-test branch April 22, 2022 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants