Skip to content

Conversation

@hamistao
Copy link
Contributor

@hamistao hamistao commented Nov 21, 2025

rancher/qa-tasks#2006

This adds the first automated Longhorn interoperability tests, namely:

  • Longhorn Installation with Custom Configuration
  • Fresh Longhorn Installation via Rancher App Catalog
  • Create Longhorn volume through Rancher Workloads
  • Test RBAC integration with Longhorn
  • Test scaling a StatefulSet with a Longhorn PVC template

@hamistao hamistao force-pushed the longhorn_installation_tests branch from c8c01b3 to 0cda9b4 Compare November 26, 2025 22:42
Comment on lines 116 to 276
// 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")
}
}

Copy link
Contributor Author

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;

Copy link
Contributor Author

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

@hamistao hamistao marked this pull request as ready for review November 26, 2025 22:48
@hamistao hamistao requested a review from a team November 26, 2025 22:49
@hamistao hamistao force-pushed the longhorn_installation_tests branch 2 times, most recently from 264b9a2 to b1dbeaa Compare November 28, 2025 13:55
Copy link
Member

@rancher-max rancher-max left a comment

Choose a reason for hiding this comment

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

Looks really good! Couple of minor things, but otherwise this has my approval 👍

@floatingman floatingman self-requested a review December 2, 2025 22:12
Copy link
Contributor

@floatingman floatingman left a comment

Choose a reason for hiding this comment

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

Looks good overall. You should consider adding a README for the longhorn_test, so others will know how to run the tests and if any specific cattle-config settings are needed.

@hamistao hamistao force-pushed the longhorn_installation_tests branch from b1dbeaa to e7d7e69 Compare December 4, 2025 18:32
@hamistao hamistao changed the title Add Longhorn installation tests Add first Longhorn tests Dec 4, 2025
@rancher-max rancher-max added the team/pit-crew slack notifier for pit crew label Dec 9, 2025
@hamistao hamistao force-pushed the longhorn_installation_tests branch from e7d7e69 to 0ebe37f Compare December 10, 2025 21:11
rancher-max
rancher-max previously approved these changes Dec 11, 2025
Copy link
Member

@rancher-max rancher-max left a comment

Choose a reason for hiding this comment

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

LGTM -- left one comment that I feel is a nit so will leave up to you if you want to update or not

@hamistao
Copy link
Contributor Author

You should consider adding a README for the longhorn_test, so others will know how to run the tests and if any specific cattle-config settings are needed.

@floatingman at this point there is no additional settings required for these tests, so I don't think this is needed yet. That said, there are a lot more tests to go so I will keep that in mind moving forward.

@hamistao hamistao force-pushed the longhorn_installation_tests branch 4 times, most recently from bc06906 to 978e0eb Compare December 24, 2025 17:00
@hamistao hamistao force-pushed the longhorn_installation_tests branch from 978e0eb to 0a11914 Compare December 24, 2025 17:30
This is not required for the Longhorn tests.

Signed-off-by: hamistao <[email protected]>
The dash is already added by `AppendRandomString`

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]>
And move CreatePVCWorkload there

Signed-off-by: hamistao <[email protected]>
This adds the following tests:
- Install Longhorn Using Rancher Charts
- Install Longhorn with Custom Configuration
- Create Longhorn Volume with Rancher Workloads
- Test RBAC Integration with Longhorn
- Test Scaling a StatefulSet with a Longhorn PVC

Signed-off-by: hamistao <[email protected]>
@hamistao hamistao force-pushed the longhorn_installation_tests branch from 0a11914 to aa8f72c Compare December 24, 2025 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team/pit-crew slack notifier for pit crew

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants