Skip to contentSkip to conversation

Enable logs for ping test fail

PATCH New [email protected] 1 participant 3 messages Oct 22, 2015

lore
Share & tools
lore
#0 lore raw

cover Enable logs for ping test fail

From: Mariano Lopez <[email protected]>

These two patches add some logging and checking on the interfaces when qemu is started.

The following changes since commit 8578bc17b54da97d42b257b3c8f398ac52b91a9f:

libc-package: Fix localedef multilib dependency issues (2015-10-20 10:12:01 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib mariano/bug8550
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=mariano/bug8550

Mariano Lopez (2):
qemurunner: Show the output of runqemu script
runqemu-ifup: Check if the tap interface is set up correctly

 meta/lib/oeqa/utils/qemurunner.py |  1 +
 scripts/runqemu-ifup              | 15 +++++++++++++++
 2 files changed, 16 insertions(+)
Signature · 1 line
1.8.4.5
#1 lore raw

PATCH 1/2 qemurunner: Show the output of runqemu script

From: Mariano Lopez <[email protected]>

This change will show runqemu output in the logs
when running the runtime tests. This is helpful
for debugging testimage errors.

[YOCTO #8550]

---
 meta/lib/oeqa/utils/qemurunner.py | 1 +
 1 file changed, 1 insertion(+)
meta/lib/oeqa/utils/qemurunner.py +1 -0
index 6fe75b8..bdc6e0a 100644
@@ -210,6 +210,7 @@ class QemuRunner:
                 self.stop_thread()
                 return False
 
+            logger.info("Output from runqemu:\n%s", self.getOutput(output))
             logger.info("Waiting at most %d seconds for login banner" % self.boottime)
             endtime = time.time() + self.boottime
             socklist = [self.server_socket]
Signature · 1 line
1.8.4.5
#2 lore raw

PATCH 2/2 runqemu-ifup: Check if the tap interface is set up correctly

In reply to [email protected]

From: Mariano Lopez <[email protected]>

The process to set up a tap interface is as follows:
- tap interface is created
- An IP address is assigned to the tap interface
- The interface is bring up
- A route is added to the target using the tap interface

Of all the previous steps, only the first one is check if it was sucessful. The status of the others are ignored and all of them are required to have basic connectivity in the target.

This patch adds the checks for the rest of the stpes needed to set up the tap interface.

[YOCTO #8550]

---
 scripts/runqemu-ifup | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
scripts/runqemu-ifup +15 -0
index b5a3db9..d9bd894 100755
@@ -91,10 +91,25 @@ fi
 
 n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ]
 $IFCONFIG addr add 192.168.7.$n/32 broadcast 192.168.7.255 dev $TAP
+STATUS=$?
+if [ $STATUS -ne 0 ]; then
+    echo "Failed to set up IP addressing on $TAP"
+    exit 1
+fi
 $IFCONFIG link set dev $TAP up
+STATUS=$?
+if [ $STATUS -ne 0 ]; then
+    echo "Failed to bring up $TAP"
+    exit 1
+fi
 
 dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ]
 $IFCONFIG route add to 192.168.7.$dest dev $TAP
+STATUS=$?
+if [ $STATUS -ne 0 ]; then
+    echo "Failed to add route to 192.168.7.$dest using $TAP"
+    exit 1
+fi
 
 # setup NAT for tap0 interface to have internet access in QEMU
 $IPTABLES -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.$n/32
Signature · 1 line
1.8.4.5