Initial testing scrips and notes
authorMichael C Cambria <mcc@node.halfball.org>
Thu, 31 Aug 2017 14:44:59 +0000 (14:44 +0000)
committerMichael C Cambria <mcc@node.halfball.org>
Thu, 31 Aug 2017 14:44:59 +0000 (14:44 +0000)
oldway.txt [new file with mode: 0644]
setup-test0-ns.sh [new file with mode: 0755]
test-env-add.sh [new file with mode: 0755]
test-env-del.sh [new file with mode: 0755]
test.conf [new file with mode: 0644]
test0-add.sh [new file with mode: 0755]
test0-del.sh [new file with mode: 0755]
test1-add.sh [new file with mode: 0755]
test1-del.sh [new file with mode: 0755]
tim.conf [new file with mode: 0644]

diff --git a/oldway.txt b/oldway.txt
new file mode 100644 (file)
index 0000000..9d3a672
--- /dev/null
@@ -0,0 +1,29 @@
+mcambria@thing2:~/go2/src/stash.verizon.com/cni$ cat mcc-manual-add-static-env.sh 
+#/bin/bash
+export DEBUG=1
+export NETCONFPATH=/etc/cni/net.d/
+export CNI_PATH=/home/mcambria/go/src/github.com/containernetworking/cni/bin/
+#export CNI_PATH=/home/mcambria/go2/src/stash.verizon.com/cni/bin
+export NETCONFPATH=${NETCONFPATH-/etc/cni/net.d}
+export CNI_COMMAND=ADD
+export CNI_NETNS=/var/run/netns/mcc-cni-test0
+export CNI_CONTAINERID=mcc-cni-test0 
+
+##export CNI_ARGS="IP=172.19.99.99;UPLINK=eth1p0"
+#export CNI_ARGS="IP=172.19.99.99"
+#export CNI_ARGS+=";UPLINK=cbr0"
+
+export PATH=$CNI_PATH:$PATH
+export CNI_IFNAME=eth1 
+
+export MCCVAL="Jamal Env Value"
+
+# sudo -E /home/mcambria/github/cni-master/scripts/exec-plugins.sh add mcc-cni-test0 /var/run/netns/mcc-cni-test0 
+
+echo $CNI_ARGS
+
+#macvlan < /etc/cni/net.d/20-macvlan0.conf
+macvlan < 20-macvlan0.conf
+
+
+
diff --git a/setup-test0-ns.sh b/setup-test0-ns.sh
new file mode 100755 (executable)
index 0000000..1995701
--- /dev/null
@@ -0,0 +1,5 @@
+#/bin/bash
+sudo ip netns del test0
+sudo ip netns add test0
+sudo ip netns exec test0 ip addr show
+
diff --git a/test-env-add.sh b/test-env-add.sh
new file mode 100755 (executable)
index 0000000..2733c46
--- /dev/null
@@ -0,0 +1,11 @@
+#/bin/bash
+export DEBUG=1
+export NETCONFPATH=/home/mcc/go/src/github.com/containernetworking/plugins
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/plugins/bin
+
+export CNI_ARGS="IP=10.244.10.20"
+export MCCVAL="Jamal Env Value"
+
+sudo -E  /home/mcc/go/src/github.com/containernetworking/cni/cnitool/cnitool add test /var/run/netns/test0
+
+
diff --git a/test-env-del.sh b/test-env-del.sh
new file mode 100755 (executable)
index 0000000..6e6a654
--- /dev/null
@@ -0,0 +1,11 @@
+#/bin/bash
+export DEBUG=1
+export NETCONFPATH=/home/mcc/go/src/github.com/containernetworking/plugins
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/plugins/bin
+
+export CNI_ARGS="IP=10.244.10.20"
+export MCCVAL="Jamal Env Value"
+
+sudo -E  /home/mcc/go/src/github.com/containernetworking/cni/cnitool/cnitool del test /var/run/netns/test0
+
+
diff --git a/test.conf b/test.conf
new file mode 100644 (file)
index 0000000..26219cb
--- /dev/null
+++ b/test.conf
@@ -0,0 +1,18 @@
+{
+  "name": "test",
+  "cniVersion": "0.3.1",
+      "type": "bridge",
+      "bridge": "mynet",
+      "ipMasq": true,
+      "isGateway": true,
+      "ipam": {
+      "type": "host-local",
+      "subnet": "10.244.10.0/24",
+      "rangeStart": "10.244.10.2",
+      "rangeEnd": "10.244.10.25",
+      "routes": [
+          { "dst": "0.0.0.0/0"  }
+      ]
+      }
+}
+
diff --git a/test0-add.sh b/test0-add.sh
new file mode 100755 (executable)
index 0000000..96f9abb
--- /dev/null
@@ -0,0 +1,8 @@
+#/bin/bash
+export DEBUG=1
+export NETCONFPATH=/home/mcc/go/src/github.com/containernetworking/plugins
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/plugins/bin
+
+/home/mcc/go/src/github.com/containernetworking/cni/cnitool/cnitool add test /var/run/netns/test0
+
+
diff --git a/test0-del.sh b/test0-del.sh
new file mode 100755 (executable)
index 0000000..48c51ff
--- /dev/null
@@ -0,0 +1,8 @@
+#/bin/bash
+export DEBUG=1
+export NETCONFPATH=/home/mcc/go/src/github.com/containernetworking/plugins
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/plugins/bin
+
+/home/mcc/go/src/github.com/containernetworking/cni/cnitool/cnitool del test /var/run/netns/test0
+
+
diff --git a/test1-add.sh b/test1-add.sh
new file mode 100755 (executable)
index 0000000..e994407
--- /dev/null
@@ -0,0 +1,8 @@
+#/bin/bash
+export DEBUG=1
+export NETCONFPATH=/home/mcc/go/src/github.com/containernetworking/plugins
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/plugins/bin
+
+/home/mcc/go/src/github.com/containernetworking/cni/cnitool/cnitool add test /var/run/netns/test1
+
+
diff --git a/test1-del.sh b/test1-del.sh
new file mode 100755 (executable)
index 0000000..7dc5e10
--- /dev/null
@@ -0,0 +1,8 @@
+#/bin/bash
+export DEBUG=1
+export NETCONFPATH=/home/mcc/go/src/github.com/containernetworking/plugins
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/plugins/bin
+
+/home/mcc/go/src/github.com/containernetworking/cni/cnitool/cnitool del test /var/run/netns/test1
+
+
diff --git a/tim.conf b/tim.conf
new file mode 100644 (file)
index 0000000..ad68073
--- /dev/null
+++ b/tim.conf
@@ -0,0 +1,18 @@
+{
+  "name": "tim",
+  "cniVersion": "0.3.1",
+      "type": "bridge",
+      "bridge": "mynet",
+      "ipMasq": true,
+      "isGateway": true,
+      "ipam": {
+      "type": "host-local",
+      "subnet": "10.244.10.0/24",
+      "rangeStart": "10.244.10.2",
+      "rangeEnd": "10.244.10.2",
+      "routes": [
+          { "dst": "0.0.0.0/0"  }
+      ]
+      }
+}
+