Skip to content

Commit

Permalink
fix(volumes): more fixes (#363)
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Ramon Mañes <[email protected]>
  • Loading branch information
tty47 authored May 23, 2024
1 parent 1dad2e5 commit 2c3edce
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Simple example:
t.Fatalf("Error executing command '%v':", err)
}
assert.Equal(t, wget, "Hello World!\n")
assert.Contains(t, wget, "Hello World!")
}
```

Expand Down
2 changes: 1 addition & 1 deletion e2e/basic/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ func TestBasic(t *testing.T) {
t.Fatalf("Error executing command '%v':", err)
}

assert.Equal(t, wget, "Hello World!\n")
assert.Contains(t, wget, "Hello World!")
}
3 changes: 2 additions & 1 deletion e2e/basic/external_file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"testing"

"github.com/celestiaorg/knuu/pkg/knuu"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -92,5 +93,5 @@ func TestExternalFile(t *testing.T) {
t.Fatalf("Error executing command '%v':", err)
}

assert.Equal(t, wget, "Hello World!\n")
assert.Contains(t, wget, "Hello World!")
}
8 changes: 7 additions & 1 deletion e2e/basic/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import (
"time"

"github.com/celestiaorg/knuu/pkg/knuu"

"github.com/google/uuid"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -41,6 +43,10 @@ func TestFile(t *testing.T) {
if err != nil {
t.Fatalf("Error adding file '%v':", err)
}
err = web.AddVolumeWithOwner("/usr/share/nginx/html", "1Gi", 0)
if err != nil {
t.Fatalf("Error adding volume: %v", err)
}
err = web.Commit()
if err != nil {
t.Fatalf("Error committing instance: %v", err)
Expand Down Expand Up @@ -71,7 +77,7 @@ func TestFile(t *testing.T) {
t.Fatalf("Error executing command '%v':", err)
}

assert.Equal(t, wget, "Hello World!\n")
assert.Contains(t, wget, "Hello World!")
}

func TestDownloadFileFromRunningInstance(t *testing.T) {
Expand Down
6 changes: 5 additions & 1 deletion e2e/basic/file_test_image_cached_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ func TestFileCached(t *testing.T) {
if err != nil {
t.Fatalf("Error executing command for '%v': %v", instanceName, err)
}
err = instance.AddVolumeWithOwner("/usr/share/nginx/html", "1Gi", 0)
if err != nil {
t.Fatalf("Error adding volume: %v", err)
}
err = instance.Commit()
if err != nil {
t.Fatalf("Error committing instance '%v': %v", instanceName, err)
Expand Down Expand Up @@ -92,6 +96,6 @@ func TestFileCached(t *testing.T) {
t.Fatalf("Error executing command: %v", err)
}

assert.Equal(t, "Hello World!\n", wget)
assert.Contains(t, wget, "Hello World!")
}
}
2 changes: 1 addition & 1 deletion e2e/basic/folder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ func TestFolder(t *testing.T) {
t.Fatalf("Error executing command '%v':", err)
}

assert.Equal(t, wget, "Hello World!\n")
assert.Contains(t, wget, "Hello World!")
}
6 changes: 5 additions & 1 deletion e2e/basic/folder_test_image_cached_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ func TestFolderCached(t *testing.T) {
if err != nil {
t.Fatalf("Error executing command for '%v': %v", instanceName, err)
}
err = instance.AddVolumeWithOwner("/usr/share/nginx/html", "1Gi", 0)
if err != nil {
t.Fatalf("Error adding volume: %v", err)
}
err = instance.Commit()
if err != nil {
t.Fatalf("Error committing instance '%v': %v", instanceName, err)
Expand Down Expand Up @@ -93,6 +97,6 @@ func TestFolderCached(t *testing.T) {
t.Fatalf("Error executing command: %v", err)
}

assert.Equal(t, "Hello World!\n", wget)
assert.Contains(t, wget, "Hello World!")
}
}
2 changes: 1 addition & 1 deletion e2e/basic/probe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ func TestProbe(t *testing.T) {
t.Fatalf("Error executing command '%v':", err)
}

assert.Equal(t, wget, "Hello World!\n")
assert.Contains(t, wget, "Hello World!")
}

0 comments on commit 2c3edce

Please sign in to comment.