# Connecting with the resolved address, default user and port, overrides. config <<'EOF' resolver: strategies: [management_subnet, primary_ip] management_subnets: [10.231.1.0/24] ssh: default_user: ops EOF expect_eq "connect via NetBox" "fsn1-pve1" netssh fsn/fsn1-pve1.hoster.test hostname expect_eq "unique name without instance" "fsn1-pve2" netssh fsn1-pve2.hoster.test hostname expect_eq "default user" "ops" netssh fsn/fsn1-pve1.hoster.test whoami expect_eq "user@ wins" "admin" netssh admin@fsn/fsn1-pve1.hoster.test whoami expect_eq "-l wins" "admin" netssh -l admin fsn/fsn1-pve1.hoster.test whoami expect_eq "remote command with arguments" "a b" netssh fsn/fsn1-pve1.hoster.test echo a b expect_eq "dry run" "ssh -l ops 10.231.1.11" netssh --dry-run fsn/fsn1-pve1.hoster.test config <<'EOF' resolver: strategies: [management_subnet, primary_ip] management_subnets: [10.231.1.0/24] ssh: default_user: ops default_port: 2222 EOF expect_out "default port" " 2222" netssh fsn/fsn1-pve1.hoster.test 'echo $SSH_CONNECTION' expect_out "-p wins over default port" " 22" netssh -p 22 fsn/fsn1-pve1.hoster.test 'echo $SSH_CONNECTION' expect_eq "dry run with port" "ssh -p 2222 -l ops 10.231.1.11" netssh --dry-run fsn/fsn1-pve1.hoster.test expect_eq "version" "netssh" bash -c 'netssh --version | cut -d" " -f1'