-
Notifications
You must be signed in to change notification settings - Fork 26
Add Longhorn installation tests #389
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
base: main
Are you sure you want to change the base?
Conversation
c8c01b3 to
0cda9b4
Compare
| // If Longhorn was installed by a previous test on this same session, uninstall it to install it again with custom configuration. | ||
| // If Longhorn was installed previously to this test run, leave it be and skip this test. This way we allow for running the | ||
| // next tests on top of a manually installed Longhorn and avoid accidentally uninstalling something important. | ||
| if chart.IsAlreadyInstalled { | ||
| if l.installedLonghorn { | ||
| l.T().Log("Uninstalling Longhorn that was intalled on the previous test.") | ||
| err = charts.UninstallLonghornChart(l.client, longhornNamespace, l.cluster.ID, l.payloadOpts.Host) | ||
| require.NoError(l.T(), err) | ||
| } else { | ||
| l.T().Skip("Skipping installation test because Longhorn is already installed") | ||
| } | ||
| } | ||
|
|
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.
This decision was tricky and had some discussion surrounding it. From the outcome of the discussions I believe this is the way to go. This way we achieve
1- Running all tests at once with the suite;
2- Running some tests with a custom installation of longhorn;
3- Keep the cleanup logic neatly isolated;
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.
cc @rancher/qa-pit-crew
| // Even though the Longhorn default for number of replicas is 2, Rancher enforces its own default of 3. | ||
| volumeName := nginxSpec.Template.Spec.Volumes[0].Name | ||
| checkReplicasCommand := []string{"kubectl", "-n", longhornNamespace, "get", "volumes.longhorn.io", volumeName, `-o=jsonpath="{.spec.numberOfReplicas}"`} | ||
| settingValue, err := kubectl.Command(l.client, nil, l.cluster.ID, checkReplicasCommand, "") | ||
| require.NoError(l.T(), err) | ||
| require.Equal(l.T(), "\"3\"\n", settingValue) |
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.
This behavior is very strange to me and I did not find anything explicitly stating that this is expected, but I assume it is the intended behavior and tested it as such. If you know of a better way to proceed here please let me know.
@rancher/qa-pit-crew
Signed-off-by: hamistao <[email protected]>
This is not required for the Longhorn tests. Signed-off-by: hamistao <[email protected]>
Signed-off-by: hamistao <[email protected]>
Signed-off-by: hamistao <[email protected]>
Signed-off-by: hamistao <[email protected]>
Signed-off-by: hamistao <[email protected]>
0cda9b4 to
264b9a2
Compare
This adds the first automated Longhorn interoperability tests, namely: