summaryrefslogtreecommitdiffhomepage
path: root/test/packetimpact/runner
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@google.com>2020-08-28 16:43:24 -0700
committerAndrei Vagin <avagin@gmail.com>2020-09-09 17:53:10 -0700
commit1444327cd1a5cf9a570cf3ff37c0814e54d31daa (patch)
tree3fc70dd72371613bb0c090db9a14ba0cfb4378e8 /test/packetimpact/runner
parentaaae7109d23cc9a97aea27efcf6f541a594eddf4 (diff)
Include command output on error
Currently the logs produce TestOne: packetimpact_test.go:182: listing devices on ... container: process terminated with status: 126 which is not actionable; presumably the `ip` command output is interesting. PiperOrigin-RevId: 329032105
Diffstat (limited to 'test/packetimpact/runner')
-rw-r--r--test/packetimpact/runner/packetimpact_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/packetimpact/runner/packetimpact_test.go b/test/packetimpact/runner/packetimpact_test.go
index e8c183977..cb9bfd5b7 100644
--- a/test/packetimpact/runner/packetimpact_test.go
+++ b/test/packetimpact/runner/packetimpact_test.go
@@ -369,11 +369,11 @@ func createDockerNetwork(ctx context.Context, n *dockerutil.Network) error {
func deviceByIP(ctx context.Context, d *dockerutil.Container, ip net.IP) (string, netdevs.DeviceInfo, error) {
out, err := d.Exec(ctx, dockerutil.ExecOpts{}, "ip", "addr", "show")
if err != nil {
- return "", netdevs.DeviceInfo{}, fmt.Errorf("listing devices on %s container: %w", d.Name, err)
+ return "", netdevs.DeviceInfo{}, fmt.Errorf("listing devices on %s container: %w\n%s", d.Name, err, out)
}
devs, err := netdevs.ParseDevices(out)
if err != nil {
- return "", netdevs.DeviceInfo{}, fmt.Errorf("parsing devices from %s container: %w", d.Name, err)
+ return "", netdevs.DeviceInfo{}, fmt.Errorf("parsing devices from %s container: %w\n%s", d.Name, err, out)
}
testDevice, deviceInfo, err := netdevs.FindDeviceByIP(ip, devs)
if err != nil {