Skip to content

Commit

Permalink
drivercore bumped, test updated
Browse files Browse the repository at this point in the history
  • Loading branch information
rajch committed Dec 22, 2021
1 parent b1cdce8 commit ddc0edc
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion driver-network.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/kuttiproject/workspace"
)

// QualifiedNetworkName adds a 'kuttinet' prefix to the specified cluster name.
// QualifiedNetworkName adds a 'kuttinet' suffix to the specified cluster name.
func (vd *Driver) QualifiedNetworkName(clustername string) string {
return clustername + "kuttinet"
}
Expand Down
30 changes: 23 additions & 7 deletions drivervbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,24 @@ import (
"github.com/kuttiproject/workspace"
)

// The version and checksum of the driver-vbox image
// to use for the test.
const (
TESTK8SVERSION = "1.23"
TESTK8SCHECKSUM = "8b18b91c670b62e91a0b179753a1c1b778ea5e1ffa300ca1309ec7098d8dbbc3"
)

func TestDriverVBox(t *testing.T) {
// kuttilog.Setloglevel(kuttilog.Debug)

// Set up dummy web server for updating image list
// and downloading image
_, err := os.Stat("out/testserver/kutti-1.18.ova")
_, err := os.Stat(fmt.Sprintf("out/testserver/kutti-%v.ova", TESTK8SVERSION))
if err != nil {
t.Fatal(
"Please download the version 1.18 kutti image, and place it in the path out/testserver/kutti-1.18.ova",
t.Fatalf(
"Please download the version %v kutti image, and place it in the path out/testserver/kutti-%v.ova",
TESTK8SVERSION,
TESTK8SVERSION,
)
}

Expand All @@ -32,17 +41,24 @@ func TestDriverVBox(t *testing.T) {
serverMux.HandleFunc(
"/images.json",
func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, `{"1.18":{"ImageK8sVersion":"1.18","ImageChecksum":"a053e6910c55e19bbd2093b0129f25aa69ceee9b0e0a52505dfd9d8b3eb24090","ImageStatus":"NotDownloaded", "ImageSourceURL":"http://localhost:8181/kutti-1.18.ova"}}`)
fmt.Fprintf(
w,
`{"%v":{"ImageK8sVersion":"%v","ImageChecksum":"%v","ImageStatus":"NotDownloaded", "ImageSourceURL":"http://localhost:8181/kutti-%v.ova"}}`,
TESTK8SVERSION,
TESTK8SVERSION,
TESTK8SCHECKSUM,
TESTK8SVERSION,
)
},
)

serverMux.HandleFunc(
"/kutti-1.18.ova",
fmt.Sprintf("/kutti-%v.ova", TESTK8SVERSION),
func(rw http.ResponseWriter, r *http.Request) {
http.ServeFile(
rw,
r,
"out/testserver/kutti-1.18.ova",
fmt.Sprintf("out/testserver/kutti-%v.ova", TESTK8SVERSION),
)
},
)
Expand All @@ -67,5 +83,5 @@ func TestDriverVBox(t *testing.T) {

drivervbox.ImagesSourceURL = "http://localhost:8181/images.json"

drivercoretest.TestDriver(t, "vbox", "1.18")
drivercoretest.TestDriver(t, "vbox", TESTK8SVERSION)
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/kuttiproject/driver-vbox
go 1.16

require (
github.com/kuttiproject/drivercore v0.1.2
github.com/kuttiproject/drivercore v0.1.3
github.com/kuttiproject/kuttilog v0.1.2
github.com/kuttiproject/workspace v0.2.2
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/kuttiproject/drivercore v0.1.2 h1:t/AKAh48130SgOGi2kNmuoi3KkaIpHZx+vL6tqKsPGY=
github.com/kuttiproject/drivercore v0.1.2/go.mod h1:1C1TMGfQ4u/5ltHUtl4hL7gYzXZyZQVhkOha4GuOzk0=
github.com/kuttiproject/drivercore v0.1.3 h1:dX57IlZhYX2AZ3BVDWTF12mn35fK1/MV974r/WpSxvc=
github.com/kuttiproject/drivercore v0.1.3/go.mod h1:1C1TMGfQ4u/5ltHUtl4hL7gYzXZyZQVhkOha4GuOzk0=
github.com/kuttiproject/kuttilog v0.1.2 h1:VEqVWrR3M6RME6aoUuVwXNO3bRpHKNp0ISAP/vqncpg=
github.com/kuttiproject/kuttilog v0.1.2/go.mod h1:OO3dHpXm1/Pjlc57R4c0e/C+ZWkYlY3Fd9Ikn8xPXi4=
github.com/kuttiproject/workspace v0.2.2 h1:1eNdMooB6Oq7jq2wodbuaY+IVZSYcEuXnqY3e00s64Y=
Expand Down

0 comments on commit ddc0edc

Please sign in to comment.