remove the use key stripping and store the proper keys (#1603)
This commit is contained in:
parent
2af71c9e31
commit
c0fd06e3f5
21 changed files with 99 additions and 198 deletions
|
@ -348,6 +348,14 @@ func (t *HeadscaleInContainer) Shutdown() error {
|
|||
)
|
||||
}
|
||||
|
||||
err = t.SaveDatabase("/tmp/control")
|
||||
if err != nil {
|
||||
log.Printf(
|
||||
"Failed to save database from control: %s",
|
||||
fmt.Errorf("failed to save database from control: %w", err),
|
||||
)
|
||||
}
|
||||
|
||||
return t.pool.Purge(t.container)
|
||||
}
|
||||
|
||||
|
@ -393,6 +401,24 @@ func (t *HeadscaleInContainer) SaveMapResponses(savePath string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (t *HeadscaleInContainer) SaveDatabase(savePath string) error {
|
||||
tarFile, err := t.FetchPath("/tmp/integration_test_db.sqlite3")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = os.WriteFile(
|
||||
path.Join(savePath, t.hostname+".db.tar"),
|
||||
tarFile,
|
||||
os.ModePerm,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Execute runs a command inside the Headscale container and returns the
|
||||
// result of stdout as a string.
|
||||
func (t *HeadscaleInContainer) Execute(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue