[OE-core] [PATCH 1/1] pTest-tcl fail fixed

Dengke Du dengke.du at windriver.com
Tue Mar 1 09:37:32 UTC 2016


http.test httpold.test socket.test failed when run the pTest-tcl,because
the tcl script "info hostname" in /usr/lib/tcl/ptest/tests/http.test on
target fail. When run the "info hostname" get the hostname,but it can find
the IP in the /etc/hosts, so it failed. We need to add the IP and hostname
pair in the /etc/hosts. In order to add the IP and hostname pair in the
/etc/hosts, we need to add the pair when the target start, so I add the
"echo "127.0.0.1 `cat /etc/hostname`" >> /etc/hosts" to the hostname.sh in
"meta/recipes-core/initscripts/initscripts-1.0/", when the system invoke
the hostname.sh in "/etc/init.d/", it add the IP and hostname pair in the
/etc/hosts.

Signed-off-by: Dengke Du <dengke.du at windriver.com>
---
 meta/recipes-core/initscripts/initscripts-1.0/hostname.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh b/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh
index 95287cc..8866d87 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh
@@ -13,7 +13,7 @@ hostname -b -F /etc/hostname 2> /dev/null
 if [ $? -eq 0 ]; then
 	exit
 fi
-
+echo "127.0.0.1 `cat /etc/hostname`" >> /etc/hosts
 # Busybox hostname doesn't support -b so we need implement it on our own
 if [ -f /etc/hostname ];then
 	hostname `cat /etc/hostname`
-- 
1.9.1




More information about the Openembedded-core mailing list