aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test/topo.go
diff options
context:
space:
mode:
Diffstat (limited to 'extras/hs-test/topo.go')
-rw-r--r--extras/hs-test/topo.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/extras/hs-test/topo.go b/extras/hs-test/topo.go
new file mode 100644
index 00000000000..6cb294511b3
--- /dev/null
+++ b/extras/hs-test/topo.go
@@ -0,0 +1,25 @@
+package main
+
+import (
+ "fmt"
+)
+
+type NetDevConfig map[string]interface{}
+type ContainerConfig map[string]interface{}
+type VolumeConfig map[string]interface{}
+
+type YamlTopology struct {
+ Devices []NetDevConfig `yaml:"devices"`
+ Containers []ContainerConfig `yaml:"containers"`
+ Volumes []VolumeConfig `yaml:"volumes"`
+}
+
+func addAddress(device, address, ns string) error {
+ c := []string{"ip", "addr", "add", address, "dev", device}
+ cmd := appendNetns(c, ns)
+ err := cmd.Run()
+ if err != nil {
+ return fmt.Errorf("failed to set ip address for %s: %v", device, err)
+ }
+ return nil
+}