summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Williams <neil.williams@linaro.org>2014-10-20 16:58:26 (GMT)
committerNeil Williams <neil.williams@linaro.org>2014-10-20 16:58:26 (GMT)
commitbca684fa0a77c912e0b705323f67906346ac1ab7 (patch)
treee7fe39e71f831c2f13bb4495846de035b4fca1ec
parent03f87ae8e8bc0aae32bff31a20088ad4a3ef2adc (diff)
parent0b221d2a94fbb45c18ca85a3409b0856442a46cb (diff)
downloadlava-dispatcher-bca684fa0a77c912e0b705323f67906346ac1ab7.tar.gz
lava-dispatcher-bca684fa0a77c912e0b705323f67906346ac1ab7.tar.xz
Merge branch 'staging' into release
-rw-r--r--lava_dispatcher/config.py2
-rw-r--r--lava_dispatcher/default-config/lava-dispatcher/device-types/juno.conf4
-rw-r--r--lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_foundation-armv8.conf6
-rw-r--r--lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base-aemv8a.conf7
-rw-r--r--lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x1-a53x1.conf4
-rw-r--r--lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x4-a53x4.conf4
-rw-r--r--lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-armv8.conf4
-rw-r--r--lava_dispatcher/device/fastmodel.py9
-rw-r--r--lava_dispatcher/device/target.py17
9 files changed, 47 insertions, 10 deletions
diff --git a/lava_dispatcher/config.py b/lava_dispatcher/config.py
index 76195d3..e8b9074 100644
--- a/lava_dispatcher/config.py
+++ b/lava_dispatcher/config.py
@@ -290,6 +290,8 @@ class DeviceSchema(schema.Schema):
vexpress_stop_autoboot_prompt = schema.StringOption(default='Press Enter to stop auto boot...')
vexpress_usb_mass_storage_device = schema.StringOption(default=None)
vexpress_requires_trusted_firmware = schema.BoolOption(default=False)
+ bridged_networking = schema.BoolOption(default=False)
+ bridge_interface = schema.StringOption(default="br0")
class OptionDescriptor(object):
diff --git a/lava_dispatcher/default-config/lava-dispatcher/device-types/juno.conf b/lava_dispatcher/default-config/lava-dispatcher/device-types/juno.conf
index 00c50ec..7e95d2b 100644
--- a/lava_dispatcher/default-config/lava-dispatcher/device-types/juno.conf
+++ b/lava_dispatcher/default-config/lava-dispatcher/device-types/juno.conf
@@ -27,8 +27,8 @@ android_lava_block_device = sda
partition_padding_string_android =
partition_padding_string_org =
sys_part_android = 5
-sdcard_part_android = 6
-data_part_android = 7
+data_part_android = 6
+sdcard_part_android = 7
read_boot_cmds_from_image = 0
boot_retries = 5
bootloader_serial_delay_ms = 30
diff --git a/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_foundation-armv8.conf b/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_foundation-armv8.conf
index 0938108..4868ced 100644
--- a/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_foundation-armv8.conf
+++ b/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_foundation-armv8.conf
@@ -19,8 +19,10 @@ simulator_version_command = /opt/arm/Foundation_v8pkg/Foundation_v8 --version |
# The new (2013-10-03) Foundation model install places the simulator binary at Foundation_v8pkg/models/Linux64_GCC-4.1/Foundation_v8
# A symbolic link has been created in our arm_models-2013-10-03.tgz package to workaround this change for compatibilty sake. If you are getting an error
-# chances are you are running a newer Foundation model and need to adjust this path.
-simulator_command = sudo -u lavaserver /opt/arm/Foundation_v8pkg/Foundation_v8 --image={AXF} --block-device={IMG} --network=nat
+# chances are you are running a newer Foundation model and need to adjust this path.
+simulator_command = sudo -u lavaserver /opt/arm/Foundation_v8pkg/Foundation_v8 --image={AXF} --block-device={IMG} --network=bridged --network-bridge={INTERFACE}
+
+bridged_networking = True
simulator_command_flag = --
diff --git a/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base-aemv8a.conf b/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base-aemv8a.conf
index 80c924e..6288834 100644
--- a/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base-aemv8a.conf
+++ b/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base-aemv8a.conf
@@ -4,6 +4,9 @@ client_type=fastmodel
# fm takes longer than other android images do
disablesuspend_timeout = 500
+# how long Android takes to reach to homescreen in seconds
+android_home_screen_timeout = 4800
+
# how long ubuntu takes to boot to prompt
boot_linaro_timeout = 1600
@@ -130,6 +133,8 @@ boot_options =
bp.smsc_91c111.enabled
bp.smsc_91c111.mac_address
+bridged_networking = True
+
[pctl.startup]
default = 0.0.0.0
@@ -171,7 +176,7 @@ default = {BL1}
default = {IMG}
[bp.hostbridge.interfaceName]
-default = "%(interfaceName)s"
+default = {INTERFACE}
[bp.smsc_91c111.enabled]
default = true
diff --git a/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x1-a53x1.conf b/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x1-a53x1.conf
index c939cee..901ff57 100644
--- a/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x1-a53x1.conf
+++ b/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x1-a53x1.conf
@@ -129,6 +129,8 @@ boot_options =
bp.smsc_91c111.mac_address
+bridged_networking = True
+
[pctl.startup]
default = 0.0.0.0
allowed = 0.0.0.0
@@ -161,7 +163,7 @@ default = {BL1}
default = {IMG}
[bp.hostbridge.interfaceName]
-default = "%(interfaceName)s"
+default = {INTERFACE}
[bp.smsc_91c111.enabled]
default = true
diff --git a/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x4-a53x4.conf b/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x4-a53x4.conf
index 5d1a94f..ce6d6ff 100644
--- a/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x4-a53x4.conf
+++ b/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x4-a53x4.conf
@@ -129,6 +129,8 @@ boot_options =
bp.smsc_91c111.mac_address
+bridged_networking = True
+
[pctl.startup]
default = 0.0.0.0
allowed = 0.0.0.0
@@ -161,7 +163,7 @@ default = {BL1}
default = {IMG}
[bp.hostbridge.interfaceName]
-default = "%(interfaceName)s"
+default = {INTERFACE}
[bp.smsc_91c111.enabled]
default = true
diff --git a/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-armv8.conf b/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-armv8.conf
index cd160b4..7cec8ee 100644
--- a/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-armv8.conf
+++ b/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-armv8.conf
@@ -76,11 +76,13 @@ boot_options =
motherboard.hostbridge.interfaceName
motherboard.smsc_91c111.mac_address
+bridged_networking = True
+
[motherboard.smsc_91c111.mac_address]
default="auto"
[motherboard.hostbridge.interfaceName]
-default="%(interfaceName)s"
+default = {INTERFACE}
[motherboard.mmc.p_mmc_file]
default = {IMG}
diff --git a/lava_dispatcher/device/fastmodel.py b/lava_dispatcher/device/fastmodel.py
index fdbce90..40d3e40 100644
--- a/lava_dispatcher/device/fastmodel.py
+++ b/lava_dispatcher/device/fastmodel.py
@@ -89,6 +89,7 @@ class FastModelTarget(Target):
self._bootloadertype = 'u_boot'
self._boot_tags = {}
self._scratch_dir = self.scratch_dir
+ self._interface_name = None
def _customize_android(self):
self.deployment_data = deployment_data.android
@@ -392,8 +393,8 @@ class FastModelTarget(Target):
logging.info('Requesting graceful shutdown')
self._sim_proc.kill(signal.SIGTERM)
self._sim_proc.wait()
- super(FastModelTarget, self).power_off(proc)
finalize_process(self._sim_proc)
+ super(FastModelTarget, self).power_off(proc)
self._sim_proc = None
def _create_rtsm_ostream(self, ofile):
@@ -411,6 +412,10 @@ class FastModelTarget(Target):
DrainConsoleOutput(proc=self._sim_proc).start()
def power_on(self):
+ if self.config.bridged_networking:
+ self._interface_name = os.path.basename(self._scratch_dir)
+ if not self._bridge_configured:
+ self._config_network_bridge(self.config.bridge_interface, self._interface_name)
if self._ramdisk_boot and self._booted:
self.proc.sendline('export PS1="%s"'
% self.tester_ps1,
@@ -435,7 +440,7 @@ class FastModelTarget(Target):
sim_cmd = sim_cmd.format(
AXF=self._axf, IMG=self._sd_image, KERNEL=self._kernel,
DTB=self._dtb, INITRD=self._initrd, UEFI=self._uefi, BL1=self._bl1,
- UEFI_VARS=self._uefi_vars)
+ UEFI_VARS=self._uefi_vars, INTERFACE=self._interface_name)
# the simulator proc only has stdout/stderr about the simulator
# we hook up into a telnet port which emulates a serial console
diff --git a/lava_dispatcher/device/target.py b/lava_dispatcher/device/target.py
index f4bd36d..3366b74 100644
--- a/lava_dispatcher/device/target.py
+++ b/lava_dispatcher/device/target.py
@@ -183,6 +183,7 @@ class Target(object):
self._scratch_dir = None
self.__deployment_data__ = None
self.mount_info = {'boot': None, 'rootfs': None}
+ self._bridge_configured = False
@property
def deployment_data(self):
@@ -227,6 +228,8 @@ class Target(object):
def power_off(self, proc):
if proc is not None:
proc.close()
+ if self.config.bridged_networking and self._bridge_configured:
+ self._teardown_network_bridge(self.config.bridge_interface, self._interface_name)
def is_booted(self):
# By default we pass
@@ -909,3 +912,17 @@ class Target(object):
else:
with image_partition_mounted(image, self.config.boot_part) as boot_mnt:
self._customize_image(image, boot_mnt, boot_mnt)
+
+ def _config_network_bridge(self, bridge, ifname):
+ logging.debug("Creating tap interface: %s" % ifname)
+ self.context.run_command("ip tuntap add dev %s mode tap user lavaserver" % ifname)
+ self.context.run_command("ifconfig %s 0.0.0.0 promisc up" % ifname)
+ self.context.run_command("brctl addif %s %s" % (bridge, ifname))
+ self._bridge_configured = True
+
+ def _teardown_network_bridge(self, bridge, ifname):
+ logging.debug("Destroying tap interface: %s" % ifname)
+ self.context.run_command("brctl delif %s %s" % (bridge, ifname))
+ self.context.run_command("ifconfig %s down" % ifname)
+ self.context.run_command("ip tuntap del dev %s mode tap" % ifname)
+ self._bridge_configured = False