mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
Updated tests to reflect new API changes
This commit is contained in:
parent
411102881d
commit
da2abdfa8d
2 changed files with 22 additions and 9 deletions
|
|
@ -13,18 +13,31 @@ import (
|
||||||
magellan "github.com/OpenCHAMI/magellan/internal"
|
magellan "github.com/OpenCHAMI/magellan/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestScanAndCollect(t *testing.T) {
|
|
||||||
var (
|
var (
|
||||||
hosts = []string{"http://127.0.0.1"}
|
scanParams = &magellan.ScanParams{
|
||||||
ports = []int{5000}
|
TargetHosts: [][]string{
|
||||||
|
[]string{
|
||||||
|
"http://127.0.0.1:443",
|
||||||
|
"http://127.0.0.1:5000",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Scheme: "https",
|
||||||
|
Protocol: "tcp",
|
||||||
|
Concurrency: 1,
|
||||||
|
Timeout: 30,
|
||||||
|
DisableProbing: false,
|
||||||
|
Verbose: false,
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestScanAndCollect(t *testing.T) {
|
||||||
// do a scan on the emulator cluster with probing disabled and check results
|
// do a scan on the emulator cluster with probing disabled and check results
|
||||||
results := magellan.ScanForAssets(hosts, ports, 1, 30, true, false)
|
results := magellan.ScanForAssets(scanParams)
|
||||||
if len(results) <= 0 {
|
if len(results) <= 0 {
|
||||||
t.Fatal("expected to find at least one BMC node, but found none")
|
t.Fatal("expected to find at least one BMC node, but found none")
|
||||||
}
|
}
|
||||||
// do a scan on the emulator cluster with probing enabled
|
// do a scan on the emulator cluster with probing enabled
|
||||||
results = magellan.ScanForAssets(hosts, ports, 1, 30, false, false)
|
results = magellan.ScanForAssets(scanParams)
|
||||||
if len(results) <= 0 {
|
if len(results) <= 0 {
|
||||||
t.Fatal("expected to find at least one BMC node, but found none")
|
t.Fatal("expected to find at least one BMC node, but found none")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/OpenCHAMI/magellan/internal/util"
|
"github.com/OpenCHAMI/magellan/pkg/client"
|
||||||
"github.com/OpenCHAMI/magellan/pkg/crawler"
|
"github.com/OpenCHAMI/magellan/pkg/crawler"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -30,7 +30,7 @@ func TestRedfishV1Availability(t *testing.T) {
|
||||||
body = []byte{}
|
body = []byte{}
|
||||||
headers = map[string]string{}
|
headers = map[string]string{}
|
||||||
)
|
)
|
||||||
res, b, err := util.MakeRequest(nil, url, http.MethodGet, body, headers)
|
res, b, err := client.MakeRequest(nil, url, http.MethodGet, body, headers)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to make request to BMC: %v", err)
|
t.Fatalf("failed to make request to BMC: %v", err)
|
||||||
}
|
}
|
||||||
|
|
@ -60,7 +60,7 @@ func TestRedfishVersion(t *testing.T) {
|
||||||
headers = map[string]string{}
|
headers = map[string]string{}
|
||||||
)
|
)
|
||||||
|
|
||||||
util.MakeRequest(nil, url, http.MethodGet, body, headers)
|
client.MakeRequest(nil, url, http.MethodGet, body, headers)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Crawls a BMC node and checks that we're able to query certain properties
|
// Crawls a BMC node and checks that we're able to query certain properties
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue