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

feat(test): Add more cloud tests #1879

Open
wants to merge 28 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
90000d3
feat(test): Add tests for 'cloud instance get'
craciunoiuc Sep 5, 2024
e247d1f
feat(test): Add tests for 'cloud instance list'
craciunoiuc Sep 5, 2024
4ca6fd3
feat(test): Add tests for 'cloud instance logs'
craciunoiuc Sep 5, 2024
815123c
feat(test): Add tests for 'cloud instance remove'
craciunoiuc Sep 5, 2024
dd89873
feat(test): Add tests for 'cloud instance start'
craciunoiuc Sep 5, 2024
80b88c2
feat(test): Add tests for 'cloud instance stop'
craciunoiuc Sep 5, 2024
16c50bd
feat(test): Rename test suite to 'cloud'
craciunoiuc Sep 5, 2024
17110a8
fix(test): Remove instance after running test
craciunoiuc Sep 5, 2024
44ce3ef
feat(test): Add tests for 'cloud quotas'
craciunoiuc Sep 13, 2024
1b7f496
feat(test): Add tests for 'cloud metro list'
craciunoiuc Sep 13, 2024
343aae8
feat(test): Add tests for 'cloud volume attach'
craciunoiuc Sep 13, 2024
a136b7e
feat(test): Add tests for 'cloud volume detach'
craciunoiuc Sep 13, 2024
4c04bd3
feat(test): Add tests for 'cloud volume create'
craciunoiuc Sep 13, 2024
1b6e8cb
feat(test): Add tests for 'cloud volume delete'
craciunoiuc Sep 13, 2024
2f55d78
feat(test): Add tests for 'cloud volume get'
craciunoiuc Sep 13, 2024
7d99ea0
feat(test): Add tests for 'cloud volume list'
craciunoiuc Sep 13, 2024
29961f9
fix(test): Increase minimum volume size in tests
craciunoiuc Sep 17, 2024
650e49d
feat(test): Add tests for 'cloud volume import'
craciunoiuc Sep 17, 2024
1c5b7a9
feat(test): Add tests for 'cloud service create'
craciunoiuc Sep 18, 2024
d93f52a
feat(test): Add tests for 'cloud service list'
craciunoiuc Sep 19, 2024
8fd72b3
feat(test): Add tests for 'cloud service get'
craciunoiuc Sep 19, 2024
b434c74
feat(test): Add tests for 'cloud service remove'
craciunoiuc Sep 19, 2024
b6c61d5
feat(test): Add tests for 'cloud tunnel'
craciunoiuc Sep 19, 2024
c810041
feat(test): Add tests for 'cloud scale init'
craciunoiuc Sep 20, 2024
bcca44b
feat(test): Add tests for 'cloud scale add'
craciunoiuc Sep 20, 2024
6fa251e
feat(test): Add tests for 'cloud scale remove'
craciunoiuc Sep 20, 2024
729f256
feat(test): Add tests for 'cloud scale reset'
craciunoiuc Sep 20, 2024
032156f
feat(test): Add tests for 'cloud scale get'
craciunoiuc Sep 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/e2e/cloud/cloud_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Licensed under the BSD-3-Clause License (the "License").
// You may not use this file except in compliance with the License.

package cli_test
package cloud_test

import (
"testing"
Expand Down
13 changes: 13 additions & 0 deletions test/e2e/cloud/fixtures/import/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2024, Unikraft GmbH and The KraftKit Authors.
# Licensed under the BSD-3-Clause License (the "License").
# You may not use this file except in compliance with the License.

FROM ubuntu:latest AS build

RUN mkdir -p /tmp/build && \
echo "<p>Hello World!</p>" > /tmp/build/hello.txt

FROM scratch AS import

COPY --from=build /tmp/build/hello.txt /index.html
1 change: 1 addition & 0 deletions test/e2e/cloud/fixtures/import/cpio-large/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>Hello World!</p>
1 change: 1 addition & 0 deletions test/e2e/cloud/fixtures/import/cpio-large/soft-link-0
1 change: 1 addition & 0 deletions test/e2e/cloud/fixtures/import/cpio-large/soft-link-1
1 change: 1 addition & 0 deletions test/e2e/cloud/fixtures/import/cpio-large/soft-link-2
1 change: 1 addition & 0 deletions test/e2e/cloud/fixtures/import/cpio-large/soft-link-3
1 change: 1 addition & 0 deletions test/e2e/cloud/fixtures/import/cpio-large/soft-link-4
1 change: 1 addition & 0 deletions test/e2e/cloud/fixtures/import/cpio-large/soft-link-5
1 change: 1 addition & 0 deletions test/e2e/cloud/fixtures/import/cpio-large/soft-link-6
1 change: 1 addition & 0 deletions test/e2e/cloud/fixtures/import/cpio-large/soft-link-7
1 change: 1 addition & 0 deletions test/e2e/cloud/fixtures/import/cpio-large/soft-link-8
1 change: 1 addition & 0 deletions test/e2e/cloud/fixtures/import/cpio-large/soft-link-9
1 change: 1 addition & 0 deletions test/e2e/cloud/fixtures/import/cpio/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>Hello World!</p>
2 changes: 1 addition & 1 deletion test/e2e/cloud/img_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Licensed under the BSD-3-Clause License (the "License").
// You may not use this file except in compliance with the License.

package cli_test
package cloud_test

import (
"fmt"
Expand Down
24 changes: 23 additions & 1 deletion test/e2e/cloud/instance_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Licensed under the BSD-3-Clause License (the "License").
// You may not use this file except in compliance with the License.

package cli_test
package cloud_test

import (
"crypto/rand"
Expand Down Expand Up @@ -756,6 +756,28 @@ var _ = Describe("kraft cloud instance create", func() {
)
})

AfterEach(func() {
// Remove the instance after the test
cleanCmd := fcmd.NewKraft(stdout, stderr, cfg.Path())
cleanCmd.Args = append(cleanCmd.Args,
"cloud", "instance", "delete",
"--log-level", "info",
"--log-type", "json",
instanceNameFull,
)

err := cleanCmd.Run()
time.Sleep(2 * time.Second)
if err != nil {
fmt.Print(cleanCmd.DumpError(stdout, stderr, err))
}

Expect(err).ToNot(HaveOccurred())
Expect(stderr.String()).To(BeEmpty())
Expect(stdout.String()).ToNot(BeEmpty())
Expect(stdout.String()).To(MatchRegexp(`removing 1 instance\(s\)`))
})

It("should not error out with an API error", func() {
err := cmd.Run()
time.Sleep(2 * time.Second)
Expand Down
Loading
Loading