-
Notifications
You must be signed in to change notification settings - Fork 40
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
test: added test to validate the LVMO resources #149
Conversation
e2e/lvm/lvm_suite_test.go
Outdated
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() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Context("Validate all the resources", func() { | |
Context("Validate LVMCluster reconciliation", func() { |
54adb4b
to
b17be50
Compare
e2e/validation.go
Outdated
lvmVolumeGroupName = "vg1" | ||
storageClassName = "odf-lvm-vg1" | ||
csiDriverName = "topolvm.cybozu.com" | ||
daemonSetName = "topolvm-node" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
daemonSetName = "topolvm-node" | |
topolvmNodeDaemonSetName = "topolvm-node" |
e2e/validation.go
Outdated
storageClassName = "odf-lvm-vg1" | ||
csiDriverName = "topolvm.cybozu.com" | ||
daemonSetName = "topolvm-node" | ||
deploymentName = "topolvm-controller" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deploymentName = "topolvm-controller" | |
topolvmCtrlDeploymentName = "topolvm-controller" |
b17be50
to
94df1ee
Compare
e2e/validation.go
Outdated
) | ||
|
||
const ( | ||
timeout = time.Second * 10 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
b691658
to
f6a879c
Compare
/retest |
76200a4
to
3b62176
Compare
e2e/validation.go
Outdated
func ValidateResources() error { | ||
|
||
// Validate Storage class | ||
err := ValidateStorageClass() |
There was a problem hiding this comment.
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:
- CSI Driver
- Topolvm controller
- vg manager
- LVMVolumeGroup
- topolvm node
- 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
}
e2e/validation.go
Outdated
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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()) |
3b62176
to
27fe12b
Compare
/test lvm-operator-bundle-e2e-aws |
/retest |
2 similar comments
/retest |
/retest |
27fe12b
to
d71bbfb
Compare
d71bbfb
to
e559cc0
Compare
e559cc0
to
94570df
Compare
e2e/validation.go
Outdated
return err == nil | ||
}, timeout, interval).Should(BeTrue()) | ||
|
||
debug("depoloyment found\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug("depoloyment found\n") | |
debug("topolvm-controller deployment found\n") |
There was a problem hiding this comment.
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 <riyasinghalji@gmail.com>
94570df
to
571bac0
Compare
@riya-singhal31: The following test failed, say
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. |
[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 |
This test validates all the resources created by LVMO
Signed-off-by: riya-singhal31 riyasinghalji@gmail.com