[Fuego] [PATCH 12/12] add hostname and ip to /etc/hosts

qiutt <[email protected]>
Newsgroups dev.linux.lists.fuego
Message-ID <[email protected]>
for m3ulcb, getaddrinfo_01 in net.ipv6lib, when the hostname and ip are
not in
/etc/hosts, add them as following
 127.0.0.1   m3ulcb
 ::1         m3ulcb

Signed-off-by: qiutt <[email protected]>
---
 tests/Functional.LTP/fuego_test.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/Functional.LTP/fuego_test.sh b/tests/Functional.LTP/fuego_test.sh
index 25af0f5..c5dce55 100755
--- a/tests/Functional.LTP/fuego_test.sh
+++ b/tests/Functional.LTP/fuego_test.sh
@@ -474,6 +474,11 @@ function test_deploy {
 function test_run {
     if [[ "$FUNCTIONAL_LTP_PHASES" == *run* ]] ; then
         echo "Running LTP"
+        #for net.ipv6_lib(getaddrinfo_01), when the hostname and ip are not in etc/hosts, add them(e.g. 127.0.0.1   m3ulcb)
+        if [ $FUNCTIONAL_LTP_BOARD_NAME ]; then
+            cmd "if ! grep -q '127.0.0.1.*$FUNCTIONAL_LTP_BOARD_NAME' /etc/hosts; then sed -i -r '\$a\127.0.0.1        $FUNCTIONAL_LTP_BOARD_NAME' /etc/hosts;fi; \
+                 if ! grep -q '::1.*$FUNCTIONAL_LTP_BOARD_NAME' /etc/hosts; then sed -i -r '\$a\::1       $FUNCTIONAL_LTP_BOARD_NAME' /etc/hosts; fi;"
+        fi
 
         # we patch them here because of the different phases
         cmd "sed -i 's/^fork13 fork13 -i 1000000/fork13 fork13 -i 100000/' $LTP_DESTDIR/runtest/syscalls"
-- 
2.11.0
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.