[Fuego] [PATCH 6/6] Add test cases of command try-from/telnetd/in.tftpd-hpa/vsftpd/xinetd.

Wang Mingyu wangmy at cn.fujitsu.com
Tue Nov 6 13:56:47 UTC 2018


Signed-off-by: Wang Mingyu <wangmy at cn.fujitsu.com>
---
 .../Functional.misc/tests/tcp_wrappers_try-from.sh | 12 +++++++++
 engine/tests/Functional.misc/tests/telnetd.sh      | 12 +++++++++
 .../tests/tftp-server_in.tftpd-hpa.sh              | 30 ++++++++++++++++++++++
 engine/tests/Functional.misc/tests/vsftpd.sh       | 28 ++++++++++++++++++++
 engine/tests/Functional.misc/tests/xinetd.sh       | 25 ++++++++++++++++++
 5 files changed, 107 insertions(+)
 create mode 100644 engine/tests/Functional.misc/tests/tcp_wrappers_try-from.sh
 create mode 100644 engine/tests/Functional.misc/tests/telnetd.sh
 create mode 100644 engine/tests/Functional.misc/tests/tftp-server_in.tftpd-hpa.sh
 create mode 100644 engine/tests/Functional.misc/tests/vsftpd.sh
 create mode 100644 engine/tests/Functional.misc/tests/xinetd.sh

diff --git a/engine/tests/Functional.misc/tests/tcp_wrappers_try-from.sh b/engine/tests/Functional.misc/tests/tcp_wrappers_try-from.sh
new file mode 100644
index 0000000..f307e68
--- /dev/null
+++ b/engine/tests/Functional.misc/tests/tcp_wrappers_try-from.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+#  In target, run comannd try-from.
+
+test="try-from"
+
+if try-from | grep -E "client address|client hostname|client username|client info|server address|server hostname|server process|server info"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
diff --git a/engine/tests/Functional.misc/tests/telnetd.sh b/engine/tests/Functional.misc/tests/telnetd.sh
new file mode 100644
index 0000000..fb11ca5
--- /dev/null
+++ b/engine/tests/Functional.misc/tests/telnetd.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+#  In target, check if telnetd is exist.
+
+test="telnetd"
+
+if ls /etc/xinetd.d/ | grep "telnet"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
diff --git a/engine/tests/Functional.misc/tests/tftp-server_in.tftpd-hpa.sh b/engine/tests/Functional.misc/tests/tftp-server_in.tftpd-hpa.sh
new file mode 100644
index 0000000..1648ff6
--- /dev/null
+++ b/engine/tests/Functional.misc/tests/tftp-server_in.tftpd-hpa.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+#  In target, run comannd in.tftpd-hpa.
+
+test="in.tftpd-hpa"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+exec_service_on_target tftpd-hpa stop
+if exec_service_on_target tftpd-hpa start
+then
+    echo " -> start of tftpd-hpa succeeded."
+else
+    echo " -> start of tftpd-hpa failed."
+    echo " -> $test: TEST-FAIL"
+    exit
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/in.tftpd-hpa"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
+
+killall in.tftpd-hpa
diff --git a/engine/tests/Functional.misc/tests/vsftpd.sh b/engine/tests/Functional.misc/tests/vsftpd.sh
new file mode 100644
index 0000000..eb7cc4f
--- /dev/null
+++ b/engine/tests/Functional.misc/tests/vsftpd.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+#  In target, run comannd vsftpd.
+
+test="vsftpd"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+exec_service_on_target vsftpd stop
+if exec_service_on_target vsftpd start
+then
+    echo " -> start of vsftpd succeeded."
+else
+    echo " -> start of vsftpd failed."
+    echo " -> $test: TEST-FAIL"
+    exit
+fi
+
+sleep 3
+
+if ps aux | grep "[/]usr/sbin/vsftpd"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
diff --git a/engine/tests/Functional.misc/tests/xinetd.sh b/engine/tests/Functional.misc/tests/xinetd.sh
new file mode 100644
index 0000000..37e5d0f
--- /dev/null
+++ b/engine/tests/Functional.misc/tests/xinetd.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+#  In target, run comannd in.xinetd.
+
+test="xinetd"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+if exec_service_on_target xinetd is-active
+then
+    echo " -> start of xinetd succeeded."
+else
+    echo " -> start of xinetd failed."
+    echo " -> $test: TEST-FAIL"
+    exit
+fi
+
+if ps aux | grep "[/]usr/sbin/xinetd"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
-- 
1.8.3.1





More information about the Fuego mailing list