fix #507
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
Apfelwurm 2025-03-07 17:00:53 +01:00
parent d09a19a385
commit be9f613112
3 changed files with 9 additions and 3 deletions

View File

@ -103,8 +103,7 @@ developer machine. The domain is then set to "default".`,
if _, err := client.New(name, timeout); err != nil {
cleanUp(name)
log.Debugf("ssh %s error: %s", name, sshPkg.Fatal(name, err))
log.Fatalf("can't ssh to %s, make sure \"ssh %s\" works", name, name)
log.Fatalf("%s error: %s", name, sshPkg.Fatal(name, err))
}
if created {

View File

@ -89,7 +89,7 @@ func New(serverName string, opts ...Opt) (*client.Client, error) {
info, err := cl.Info(context.Background())
if err != nil {
return cl, sshPkg.Fatal(serverName, err)
return cl, fmt.Errorf("%s, make sure \"ssh %s\" works", sshPkg.Fatal(serverName, err), serverName)
}
if info.Swarm.LocalNodeState == "inactive" {

View File

@ -51,6 +51,13 @@ teardown(){
assert_output --partial 'swarm mode not enabled on local server'
}
@test "create notexisting server fails with could not resolve hostname" {
run $ABRA server add notexisting
assert_failure
assert_not_exists "$ABRA_DIR/servers/default"
assert_output --partial 'could not resolve hostname for'
}
# bats test_tags=slow
@test "cleanup when cannot add server" {
run $ABRA server add example.com