Make simple initial test case
This commit makes the initial SSH test a bit simpler: - Use the same pattern/functions for all clients as other tests - Only test within _one_ namespace/user to confirm the base case - Use retry function, same as taildrop, there is some funky going on there... Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
cfaa36e51a
commit
3695284286
5 changed files with 105 additions and 65 deletions
|
@ -47,6 +47,7 @@ type TailscaleInContainer struct {
|
|||
// optional config
|
||||
headscaleCert []byte
|
||||
headscaleHostname string
|
||||
withSSH bool
|
||||
}
|
||||
|
||||
type Option = func(c *TailscaleInContainer)
|
||||
|
@ -83,6 +84,12 @@ func WithHeadscaleName(hsName string) Option {
|
|||
}
|
||||
}
|
||||
|
||||
func WithSSH() Option {
|
||||
return func(tsic *TailscaleInContainer) {
|
||||
tsic.withSSH = true
|
||||
}
|
||||
}
|
||||
|
||||
func New(
|
||||
pool *dockertest.Pool,
|
||||
version string,
|
||||
|
@ -219,6 +226,10 @@ func (t *TailscaleInContainer) Up(
|
|||
t.hostname,
|
||||
}
|
||||
|
||||
if t.withSSH {
|
||||
command = append(command, "--ssh")
|
||||
}
|
||||
|
||||
if _, _, err := t.Execute(command); err != nil {
|
||||
return fmt.Errorf("failed to join tailscale client: %w", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue