From f3209522fedbe07a65d1aa7f1056ff66585aa21c Mon Sep 17 00:00:00 2001
From: Malte Bauch <malte.bauch@extern.h-da.de>
Date: Wed, 13 Jul 2022 18:31:01 +0200
Subject: [PATCH] Update scripts

---
 scripts/test-add-multiple-devices.sh | 15 +++++++++++++++
 scripts/test-add-pnd.sh              |  8 +++++++-
 scripts/test-list-pnd.sh             |  8 +++++++-
 3 files changed, 29 insertions(+), 2 deletions(-)
 create mode 100755 scripts/test-add-multiple-devices.sh

diff --git a/scripts/test-add-multiple-devices.sh b/scripts/test-add-multiple-devices.sh
new file mode 100755
index 000000000..159180dc0
--- /dev/null
+++ b/scripts/test-add-multiple-devices.sh
@@ -0,0 +1,15 @@
+if [ $# -eq 0 ]
+  then
+      echo 'you need to provide the password for the admin user and the amount of devices to add'
+    exit 1
+fi
+
+./artifacts/gosdnc login --controller 127.0.0.1:55055 --u admin --p $1
+./artifacts/gosdnc pnd use 5f20f34b-cbd0-4511-9ddc-c50cf6a3b49d
+
+for i in {0..$2}
+do
+    ./artifacts/gosdnc device create -a 172.100.0.11:6030 -u admin -p admin --name="test-ceos-$i"
+done
+
+./artifacts/gosdnc device list
diff --git a/scripts/test-add-pnd.sh b/scripts/test-add-pnd.sh
index cee5db7f1..fc8a36129 100755
--- a/scripts/test-add-pnd.sh
+++ b/scripts/test-add-pnd.sh
@@ -1,3 +1,9 @@
-./artifacts/gosdnc init --controller 127.0.0.1:55055
+if [ $# -eq 0 ]
+  then
+    echo 'you need to provide the password for the admin user'
+    exit 1
+fi
+
+./artifacts/gosdnc login --controller 127.0.0.1:55055 --u admin --p $1
 ./artifacts/gosdnc pnd create --name test-pnd-1 test
 ./artifacts/gosdnc list
diff --git a/scripts/test-list-pnd.sh b/scripts/test-list-pnd.sh
index c96335f56..700ccb9e8 100755
--- a/scripts/test-list-pnd.sh
+++ b/scripts/test-list-pnd.sh
@@ -1,2 +1,8 @@
-./artifacts/gosdnc init --controller 127.0.0.1:55055
+if [ $# -eq 0 ]
+  then
+    echo 'you need to provide the password for the admin user'
+    exit 1
+fi
+
+./artifacts/gosdnc login --controller 127.0.0.1:55055 --u admin --p $1
 ./artifacts/gosdnc list
-- 
GitLab