Skip to content

Commit

Permalink
Fix failing ssh test
Browse files Browse the repository at this point in the history
  • Loading branch information
deven96 committed Jan 6, 2023
1 parent 5d8f15a commit a547afc
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions inspector/disk_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package inspector
Expand Down Expand Up @@ -28,11 +29,18 @@ func NewSSHForTest() driver.Driver {
yamlPath := fmt.Sprintf("%s/%s", workingDir, "config-test.yaml")
conf := config.LoadConfig(yamlPath)
dashboardInfo := config.GetDashboardInfoConfig(conf)
var host config.Host
for ind := range dashboardInfo.Hosts {
if dashboardInfo.Hosts[ind].Address == "0.0.0.0" {
host = dashboardInfo.Hosts[ind]
}
}

return &driver.SSH{
User: dashboardInfo.Hosts[0].Connection.Username,
Host: dashboardInfo.Hosts[0].Address,
Port: int(dashboardInfo.Hosts[0].Connection.Port),
KeyFile: dashboardInfo.Hosts[0].Connection.PrivateKeyPath,
User: host.Connection.Username,
Host: host.Address,
Port: int(host.Connection.Port),
KeyFile: host.Connection.PrivateKeyPath,
KeyPass: "",
CheckKnownHosts: false,
}
Expand Down

0 comments on commit a547afc

Please sign in to comment.