|
@ -4,6 +4,7 @@ import ( |
|
|
"errors" |
|
|
"errors" |
|
|
"fmt" |
|
|
"fmt" |
|
|
"os" |
|
|
"os" |
|
|
|
|
|
"path/filepath" |
|
|
|
|
|
|
|
|
e2e "github.com/tendermint/tendermint/test/e2e/pkg" |
|
|
e2e "github.com/tendermint/tendermint/test/e2e/pkg" |
|
|
) |
|
|
) |
|
@ -21,6 +22,24 @@ func Cleanup(testnet *e2e.Testnet) error { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
logger.Info("Removing Docker containers and networks") |
|
|
logger.Info("Removing Docker containers and networks") |
|
|
|
|
|
err = execCompose(testnet.Dir, "stop") |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return err |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// On Linux, some local files in the volume will be owned by root since Tendermint
|
|
|
|
|
|
// runs as root inside the container, so we need to clean them up from within a
|
|
|
|
|
|
// container running as root too.
|
|
|
|
|
|
absDir, err := filepath.Abs(testnet.Dir) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return err |
|
|
|
|
|
} |
|
|
|
|
|
err = execDocker("run", "--entrypoint", "", "-v", fmt.Sprintf("%v:/network", absDir), |
|
|
|
|
|
"tendermint/e2e-node", "sh", "-c", "rm -rf /network/*/") |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return err |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
err = execCompose(testnet.Dir, "down") |
|
|
err = execCompose(testnet.Dir, "down") |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return err |
|
|
return err |
|
|