summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe/testimage.bbclass
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2023-09-13 18:32:41 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-09-14 09:19:38 +0100
commita96f735ff9a8aea9997c4db8613158699c7abb72 (patch)
tree23b0a3c591a8615ab5408e1c03c440d7540e4080 /meta/classes-recipe/testimage.bbclass
parenta736cd179dbe589dbf7f83de5c84a0fe78cb1bf7 (diff)
downloadpoky-a96f735ff9a8aea9997c4db8613158699c7abb72.tar.gz
testimage: respect target/server IPs when using slirp
We can't hardcode these IPs when using slirp. The target IP will need a port to be specified as this controls what port the SSH connection uses, and when slirp is used it can't bind to port 22. The qemu runner (OEQemuTarget) assumes that the first port forward is the SSH forward, but this may be wrong or a different target may be used. The server IP depends on how the virtual networking is configured. runqemu defaults to 10.0.2.x for the guests so that is a wise default, but that may be configured differently. (From OE-Core rev: 81b304e2558730de285f2773371340fc636a8ed1) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe/testimage.bbclass')
-rw-r--r--meta/classes-recipe/testimage.bbclass9
1 files changed, 6 insertions, 3 deletions
diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-recipe/testimage.bbclass
index 7340996788..8a944f5809 100644
--- a/meta/classes-recipe/testimage.bbclass
+++ b/meta/classes-recipe/testimage.bbclass
@@ -370,9 +370,12 @@ def testimage_main(d):
370 export_proxies(d) 370 export_proxies(d)
371 371
372 if slirp: 372 if slirp:
373 target_ip = "127.0.0.1" 373 # Default to 127.0.0.1 and let the runner identify the port forwarding
374 # from qemu target to host with default DHCP server 374 # (as OEQemuTarget does), but allow overriding.
375 server_ip = "10.0.2.2" 375 target_ip = d.getVar("TEST_TARGET_IP") or "127.0.0.1"
376 # Default to 10.0.2.2 as this is the IP that the guest has with the
377 # default qemu slirp networking configuration, but allow overriding.
378 server_ip = d.getVar("TEST_SERVER_IP") or "10.0.2.2"
376 else: 379 else:
377 target_ip = d.getVar("TEST_TARGET_IP") 380 target_ip = d.getVar("TEST_TARGET_IP")
378 server_ip = d.getVar("TEST_SERVER_IP") 381 server_ip = d.getVar("TEST_SERVER_IP")