mirror of
https://github.com/k3s-io/k3s.git
synced 2026-02-03 20:39:49 -05:00
Update longhorn version in integration test from v1.4.0 to v1.10.1
Manifest from https://raw.githubusercontent.com/longhorn/longhorn/v1.10.1/deploy/longhorn.yaml - with modifications to use rancher-mirrored images to avoid image pull rate limits, and allow operation on a node with fewer resources. Also adds more log dumping on integration test failure. Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
parent
2ed73bed39
commit
9587f67dd1
16 changed files with 1651 additions and 1383 deletions
18
.github/workflows/integration.yaml
vendored
18
.github/workflows/integration.yaml
vendored
|
|
@ -59,6 +59,24 @@ jobs:
|
|||
with:
|
||||
name: k3s-amd64
|
||||
path: ./dist/artifacts
|
||||
- name: Remove Unnecessary Tools
|
||||
run: |
|
||||
sudo rm -rf \
|
||||
/home/linuxbrew \
|
||||
/home/packer \
|
||||
/opt/az \
|
||||
/opt/microsoft \
|
||||
/usr/lib/firefox \
|
||||
/usr/lib/google-cloud-sdk \
|
||||
/usr/local/julia* \
|
||||
/usr/local/share/boost \
|
||||
/usr/local/share/chromium \
|
||||
/usr/local/share/powershell \
|
||||
/usr/share/az* \
|
||||
/usr/share/dotnet \
|
||||
/usr/share/miniconda \
|
||||
/usr/share/swift
|
||||
df -khl
|
||||
- name: Run Integration Tests
|
||||
run: |
|
||||
chmod +x ./dist/artifacts/k3s
|
||||
|
|
|
|||
|
|
@ -93,6 +93,8 @@ var _ = DescribeTableSubtree("ca certificate rotation", Ordered, func(serverArgs
|
|||
if !testutil.IsExistingServer() {
|
||||
if failed {
|
||||
testutil.K3sSaveLog(server, false)
|
||||
testutil.K3sCopyPodLogs(server)
|
||||
testutil.K3sDumpResources(server, "node", "pod", "pvc", "pv")
|
||||
}
|
||||
Expect(testutil.K3sKillServer(server)).To(Succeed())
|
||||
Expect(testutil.K3sCleanup(-1, "")).To(Succeed())
|
||||
|
|
|
|||
|
|
@ -98,6 +98,8 @@ var _ = AfterSuite(func() {
|
|||
if !testutil.IsExistingServer() {
|
||||
if failed {
|
||||
testutil.K3sSaveLog(server, false)
|
||||
testutil.K3sCopyPodLogs(server)
|
||||
testutil.K3sDumpResources(server, "node", "pod", "pvc", "pv")
|
||||
}
|
||||
Expect(testutil.K3sKillServer(server)).To(Succeed())
|
||||
Expect(testutil.K3sCleanup(-1, "")).To(Succeed())
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ var _ = AfterSuite(func() {
|
|||
if !testutil.IsExistingServer() {
|
||||
if failed {
|
||||
testutil.K3sSaveLog(customEtcdArgsServer, false)
|
||||
testutil.K3sCopyPodLogs(customEtcdArgsServer)
|
||||
testutil.K3sDumpResources(customEtcdArgsServer, "node", "pod", "pvc", "pv")
|
||||
}
|
||||
Expect(testutil.K3sKillServer(customEtcdArgsServer)).To(Succeed())
|
||||
Expect(testutil.K3sCleanup(testLock, "")).To(Succeed())
|
||||
|
|
|
|||
|
|
@ -61,6 +61,8 @@ var _ = AfterSuite(func() {
|
|||
if !testutil.IsExistingServer() && os.Getenv("CI") != "true" {
|
||||
if failed {
|
||||
testutil.K3sSaveLog(dualStackServer, false)
|
||||
testutil.K3sCopyPodLogs(dualStackServer)
|
||||
testutil.K3sDumpResources(dualStackServer, "node", "pod", "pvc", "pv")
|
||||
}
|
||||
Expect(testutil.K3sKillServer(dualStackServer)).To(Succeed())
|
||||
Expect(testutil.K3sCleanup(testLock, "")).To(Succeed())
|
||||
|
|
|
|||
|
|
@ -121,6 +121,8 @@ var _ = AfterSuite(func() {
|
|||
if !testutil.IsExistingServer() {
|
||||
if failed {
|
||||
testutil.K3sSaveLog(server1, false)
|
||||
testutil.K3sCopyPodLogs(server1)
|
||||
testutil.K3sDumpResources(server1, "node", "pod", "pvc", "pv")
|
||||
}
|
||||
Expect(testutil.K3sKillServer(server1)).To(Succeed())
|
||||
Expect(testutil.K3sKillServer(server2)).To(Succeed())
|
||||
|
|
|
|||
|
|
@ -183,6 +183,8 @@ var _ = AfterSuite(func() {
|
|||
if !testutil.IsExistingServer() {
|
||||
if failed {
|
||||
testutil.K3sSaveLog(server, false)
|
||||
testutil.K3sCopyPodLogs(server)
|
||||
testutil.K3sDumpResources(server, "node", "pod", "pvc", "pv")
|
||||
}
|
||||
Expect(testutil.K3sKillServer(server)).To(Succeed())
|
||||
Expect(testutil.K3sCleanup(testLock, "")).To(Succeed())
|
||||
|
|
|
|||
|
|
@ -67,6 +67,8 @@ var _ = AfterSuite(func() {
|
|||
if !testutil.IsExistingServer() && os.Getenv("CI") != "true" {
|
||||
if failed {
|
||||
testutil.K3sSaveLog(server, false)
|
||||
testutil.K3sCopyPodLogs(server)
|
||||
testutil.K3sDumpResources(server, "node", "pod", "pvc", "pv")
|
||||
}
|
||||
Expect(testutil.K3sKillServer(server)).To(Succeed())
|
||||
Expect(testutil.K3sCleanup(testLock, "")).To(Succeed())
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@ var _ = AfterSuite(func() {
|
|||
if !testutil.IsExistingServer() && os.Getenv("CI") != "true" {
|
||||
if failed {
|
||||
testutil.K3sSaveLog(server, false)
|
||||
testutil.K3sCopyPodLogs(server)
|
||||
testutil.K3sDumpResources(server, "node", "pod", "pvc", "pv")
|
||||
}
|
||||
Expect(testutil.K3sKillServer(server)).To(Succeed())
|
||||
Expect(testutil.K3sCleanup(testLock, "")).To(Succeed())
|
||||
|
|
|
|||
|
|
@ -313,6 +313,30 @@ func K3sSaveLog(server *K3sServer, dump bool) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func K3sCopyPodLogs(server *K3sServer) error {
|
||||
f, err := os.Create("var-log-pods-log.txt")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
results, _ := RunCommand("find /var/log/pods -type f | xargs tail -n 10000")
|
||||
_, err = fmt.Fprint(f, results)
|
||||
return err
|
||||
}
|
||||
|
||||
func K3sDumpResources(server *K3sServer, resources ...string) error {
|
||||
f, err := os.Create("resources-dump-log.txt")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
results, _ := K3sCmd("kubectl", "get", "-A", "-o", "yaml", strings.Join(resources, ","))
|
||||
_, err = fmt.Fprint(f, results)
|
||||
return err
|
||||
}
|
||||
|
||||
func GetEndpointsAddresses() (string, error) {
|
||||
client, err := tests.K8sClient(DefaultConfig)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -208,6 +208,8 @@ var _ = AfterSuite(func() {
|
|||
if !testutil.IsExistingServer() {
|
||||
if failed {
|
||||
testutil.K3sSaveLog(server, false)
|
||||
testutil.K3sCopyPodLogs(server)
|
||||
testutil.K3sDumpResources(server, "node", "pod", "pvc", "pv")
|
||||
}
|
||||
Expect(testutil.K3sKillServer(server)).To(Succeed())
|
||||
Expect(testutil.K3sCleanup(testLock, "")).To(Succeed())
|
||||
|
|
|
|||
|
|
@ -105,6 +105,8 @@ var _ = AfterSuite(func() {
|
|||
if !testutil.IsExistingServer() {
|
||||
if failed {
|
||||
testutil.K3sSaveLog(localStorageServer, false)
|
||||
testutil.K3sCopyPodLogs(localStorageServer)
|
||||
testutil.K3sDumpResources(localStorageServer, "node", "pod", "pvc", "pv")
|
||||
}
|
||||
Expect(testutil.K3sKillServer(localStorageServer)).To(Succeed())
|
||||
Expect(testutil.K3sCleanup(testLock, "")).To(Succeed())
|
||||
|
|
|
|||
|
|
@ -50,10 +50,7 @@ var _ = Describe("longhorn", Ordered, func() {
|
|||
Expect(result).To(ContainSubstring("namespace/longhorn-system created"))
|
||||
Expect(result).To(ContainSubstring("daemonset.apps/longhorn-manager created"))
|
||||
Expect(result).To(ContainSubstring("deployment.apps/longhorn-driver-deployer created"))
|
||||
Expect(result).To(ContainSubstring("deployment.apps/longhorn-recovery-backend created"))
|
||||
Expect(result).To(ContainSubstring("deployment.apps/longhorn-ui created"))
|
||||
Expect(result).To(ContainSubstring("deployment.apps/longhorn-conversion-webhook created"))
|
||||
Expect(result).To(ContainSubstring("deployment.apps/longhorn-admission-webhook created"))
|
||||
})
|
||||
It("starts the longhorn pods with no problems", func() {
|
||||
Eventually(func() error {
|
||||
|
|
@ -142,6 +139,9 @@ var _ = AfterSuite(func() {
|
|||
if !testutil.IsExistingServer() && server != nil {
|
||||
if failed {
|
||||
testutil.K3sSaveLog(server, false)
|
||||
testutil.K3sCopyPodLogs(server)
|
||||
testutil.K3sDumpResources(server, "node", "pod", "pvc", "pv")
|
||||
testutil.RunCommand("find /var/lib/longhorn/logs -type f | xargs tail -n 10000 &> longhorn-log.txt")
|
||||
}
|
||||
Expect(testutil.K3sKillServer(server)).To(Succeed())
|
||||
Expect(testutil.K3sCleanup(testLock, "")).To(Succeed())
|
||||
|
|
|
|||
2962
tests/integration/longhorn/testdata/longhorn.yaml
vendored
2962
tests/integration/longhorn/testdata/longhorn.yaml
vendored
File diff suppressed because it is too large
Load diff
|
|
@ -154,6 +154,8 @@ var _ = AfterSuite(func() {
|
|||
if !testutil.IsExistingServer() {
|
||||
if failed {
|
||||
testutil.K3sSaveLog(secretsEncryptionServer, false)
|
||||
testutil.K3sCopyPodLogs(secretsEncryptionServer)
|
||||
testutil.K3sDumpResources(secretsEncryptionServer, "node", "pod", "pvc", "pv")
|
||||
}
|
||||
Expect(testutil.K3sKillServer(secretsEncryptionServer)).To(Succeed())
|
||||
Expect(testutil.K3sCleanup(testLock, secretsEncryptionDataDir)).To(Succeed())
|
||||
|
|
|
|||
|
|
@ -479,6 +479,8 @@ var _ = AfterSuite(func() {
|
|||
if !testutil.IsExistingServer() {
|
||||
if failed {
|
||||
testutil.K3sSaveLog(startupServer, false)
|
||||
testutil.K3sCopyPodLogs(startupServer)
|
||||
testutil.K3sDumpResources(startupServer, "node", "pod", "pvc", "pv")
|
||||
Expect(testutil.K3sKillServer(startupServer)).To(Succeed())
|
||||
}
|
||||
Expect(testutil.K3sCleanup(testLock, "")).To(Succeed())
|
||||
|
|
|
|||
Loading…
Reference in a new issue