[Fuego] [PATCH] openvpn: Add NEED_ROOT and modify testcli.conf

Wang Mingyu <[email protected]>
Newsgroups dev.linux.lists.fuego
Message-ID <[email protected]>
    Functional.openvpn does a lot of manipulation of system-wide
    configuration files, loading/unloading modules and starting/
    stopping services. These all require root permissions.

    The specific ip address is written in testcli.conf,
    which does not apply to boards on other network segments.
    So change it to the variable set in the boad file.

Signed-off-by: Wang Mingyu <[email protected]>
---
 tests/Functional.openvpn/data/testcli.conf |  2 +-
 tests/Functional.openvpn/fuego_test.sh     |  1 +
 tests/Functional.openvpn/test.yaml         | 23 ++++++++++++++++++++++
 3 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 tests/Functional.openvpn/test.yaml

diff --git a/tests/Functional.openvpn/data/testcli.conf b/tests/Functional.openvpn/data/testcli.conf
index 2fab877..db83f84 100644
--- a/tests/Functional.openvpn/data/testcli.conf
+++ b/tests/Functional.openvpn/data/testcli.conf
@@ -1,4 +1,4 @@
-remote  192.168.0.1
+remote  remote_host
 port    5000
 dev     tap
 #dev    tun
diff --git a/tests/Functional.openvpn/fuego_test.sh b/tests/Functional.openvpn/fuego_test.sh
index 285c008..275a63a 100644
--- a/tests/Functional.openvpn/fuego_test.sh
+++ b/tests/Functional.openvpn/fuego_test.sh
@@ -15,6 +15,7 @@ function test_deploy {
 
 function test_run {
     report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\
+    sed -i 's/remote_host/'"$SRV_IP"'/g' data/testcli.conf;\
     ./openvpn_test.sh"
 }
 
diff --git a/tests/Functional.openvpn/test.yaml b/tests/Functional.openvpn/test.yaml
new file mode 100644
index 0000000..e1cbaa5
--- /dev/null
+++ b/tests/Functional.openvpn/test.yaml
@@ -0,0 +1,23 @@
+fuego_package_version: 1
+name: Functional.openvpn
+description: |
+      OpenVPN is a robust and highly flexible VPN daemon.
+      This is a simple test to check the ps/pid/syslog, listening port
+      and device interface of openvpn. 
+license: BSD-3-Clause 
+author: Wang Mingyu <[email protected]>
+maintainer: Wang Mingyu <[email protected]>
+version: 2.00
+fuego_release: 1
+type: Functional
+tags: ['openvpn']
+params:
+    SRV_IP:
+        description: the IP address of host - Defined in board file
+data_files:
+ - openvpn_test.sh
+ - fuego_test.sh
+ - spec.json
+ - test.yaml
+ - data
+ - tests
-- 
2.17.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.