mirror of
https://gitlab.com/prpl-foundation/prplmesh/prplMesh.git
synced 2025-12-20 01:21:22 +08:00
ci: r4: add mozart platform
add mozart into r4 test loop; align the mozart configuration of r4 and boradfarm; Signed-off-by: Lu Dai <lu.dai@mind.be>
This commit is contained in:
committed by
Maarten De Decker
parent
8f4ff56c67
commit
61497cd9a3
1092
ci/certification/R4/mozart.yml
Normal file
1092
ci/certification/R4/mozart.yml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -51,9 +51,49 @@
|
||||
- echo "Setting Multi-AP profile 2 disallow for prplMesh (downstream R1 agent)"
|
||||
- ssh freedom 'sed -ri "s/profile_x_disallow_override_unsupported_configuration=.*/profile_x_disallow_override_unsupported_configuration=2/g" /opt/prplmesh/config/beerocks_agent.conf'
|
||||
|
||||
.certification:R4:mozart:
|
||||
stage: certification-R4-mozart
|
||||
extends: .certification-generic-R4
|
||||
variables:
|
||||
RUN_ON_DEVICE: "mozart"
|
||||
before_script:
|
||||
- tools/deploy_firmware.py --device mozart --target-name "$RUN_ON_DEVICE" --image "$MOZART_FULLIMAGE" --whm --configuration ci/configuration/certification/R4/mozart.sh
|
||||
- tools/deploy_ipk.sh --certification-mode $RUN_ON_DEVICE build/$RUN_ON_DEVICE/prplmesh.ipk
|
||||
- echo "Setting no on-boot scan for prplMesh"
|
||||
- ssh mozart 'sed -ri "s/on_boot_scan=.*/on_boot_scan=0/g" /opt/prplmesh/config/beerocks_agent.conf'
|
||||
- echo "Setting no profile disallow for prplMesh"
|
||||
- ssh mozart 'sed -ri "s/profile_x_disallow_override_unsupported_configuration=.*/profile_x_disallow_override_unsupported_configuration=1/g" /opt/prplmesh/config/beerocks_agent.conf'
|
||||
needs:
|
||||
- job: build-for-mozart
|
||||
tags:
|
||||
- certs-tests-R4
|
||||
- mozart
|
||||
|
||||
.certification:R4:mozart_on_boot_24:
|
||||
extends: .certification:R4:mozart
|
||||
before_script:
|
||||
- !reference [.certification:R4:mozart, before_script]
|
||||
- echo "Setting 2.4GHz on-boot scan for prplMesh"
|
||||
- ssh mozart 'sed -ri "s/on_boot_scan=.*/on_boot_scan=2/g" /opt/prplmesh/config/beerocks_agent.conf'
|
||||
|
||||
.certification:R4:mozart_on_boot_5:
|
||||
extends: .certification:R4:mozart
|
||||
before_script:
|
||||
- !reference [.certification:R4:mozart, before_script]
|
||||
- echo "Setting 5GHz on-boot scan for prplMesh"
|
||||
- ssh mozart 'sed -ri "s/on_boot_scan=.*/on_boot_scan=1/g" /opt/prplmesh/config/beerocks_agent.conf'
|
||||
|
||||
.certification:R4:mozart_downstream_R1_agent:
|
||||
extends: .certification:R4:mozart
|
||||
before_script:
|
||||
- !reference [.certification:R4:mozart, before_script]
|
||||
- echo "Setting Multi-AP profile 2 disallow for prplMesh (downstream R1 agent)"
|
||||
- ssh mozart 'sed -ri "s/profile_x_disallow_override_unsupported_configuration=.*/profile_x_disallow_override_unsupported_configuration=2/g" /opt/prplmesh/config/beerocks_agent.conf'
|
||||
|
||||
include:
|
||||
- local: "ci/certification/R1/freedom.yml"
|
||||
- local: "ci/certification/R4/freedom.yml"
|
||||
- local: "ci/certification/R4/mozart.yml"
|
||||
|
||||
# Merge train tests
|
||||
##################
|
||||
|
||||
111
ci/configuration/certification/R4/mozart.sh
Normal file
111
ci/configuration/certification/R4/mozart.sh
Normal file
@@ -0,0 +1,111 @@
|
||||
#!/bin/sh
|
||||
|
||||
# We need to source some files which are only available on prplWrt
|
||||
# devices, so prevent shellcheck from trying to read them:
|
||||
# shellcheck disable=SC1091
|
||||
|
||||
set -e
|
||||
|
||||
# Start with a new log file:
|
||||
rm -f /var/log/messages && syslog-ng-ctl reload
|
||||
|
||||
# Stop the default ssh server on the lan-bridge
|
||||
sh /etc/init.d/ssh-server stop || true
|
||||
rm -f /etc/rc.d/S*ssh-server
|
||||
|
||||
# Stop and disable the firewall:
|
||||
sh /etc/init.d/tr181-firewall stop || true
|
||||
rm -f /etc/rc.d/S*tr181-firewall
|
||||
|
||||
# Stop and disable the DHCPv4 client: (PPW-888)
|
||||
sh /etc/init.d/tr181-dhcpv4client stop || true
|
||||
rm -f /etc/rc.d/*dhcpv4client
|
||||
pkill -f -9 tr181-dhcpv4client || true
|
||||
|
||||
# Stop and disable the DHCP clients and servers:
|
||||
ba-cli DHCPv4Client.Client.wan.Enable=0
|
||||
ba-cli DHCPv6Client.Client.wan.Enable=0
|
||||
ba-cli DHCPv4Server.Enable=0
|
||||
ba-cli DHCPv6Server.Enable=0
|
||||
|
||||
# We use WAN for the control interface.
|
||||
# Add the IP address if there is none yet:
|
||||
ba-cli IP.Interface.wan.IPv4Address.primary.? | grep -Eq "No data found|ERROR" && {
|
||||
echo "Adding IP address $IP"
|
||||
ba-cli 'IP.Interface.wan.IPv4Address.+{Alias="primary", AddressingType="Static"}'
|
||||
}
|
||||
# Configure it:
|
||||
ba-cli 'IP.Interface.wan.IPv4Address.primary.{IPAddress="192.168.250.180", SubnetMask="255.255.255.0", AddressingType="Static", Enable=1}'
|
||||
# Enable it:
|
||||
ba-cli IP.Interface.wan.IPv4Enable=1
|
||||
|
||||
# Set the LAN bridge IP:
|
||||
ba-cli "IP.Interface.[Name == \"br-lan\"].IPv4Address.lan.IPAddress=192.165.100.180"
|
||||
|
||||
# Setting BackhaulWireIface, or persistence can fail (PPM-3339)
|
||||
/etc/init.d/prplmesh stop && sleep 2
|
||||
/etc/init.d/prplmesh start && sleep 2
|
||||
|
||||
# Set the wired backhaul interface:
|
||||
if ba-cli "X_PRPLWARE-COM_Agent.Configuration.?" | grep -Eq "No data found|ERROR"; then
|
||||
# Prplmesh agent is not running. Data model isn't up.
|
||||
echo "Prplmesh agent is not running"
|
||||
else
|
||||
# Prplmesh agent is running, configure it over the bus
|
||||
echo "Setting prplMesh BackhaulWireInterface over DM"
|
||||
ba-cli X_PRPLWARE-COM_Agent.Configuration.BackhaulWireInterface="lan0"
|
||||
fi
|
||||
|
||||
|
||||
ba-cli WiFi.Radio.*.RegulatoryDomain="US"
|
||||
|
||||
ba-cli WiFi.AccessPoint.*.MBOEnable=1
|
||||
|
||||
# Configure Operating Standards
|
||||
ba-cli "WiFi.Radio.*.OperatingStandardsFormat=\"Standard\""
|
||||
ba-cli "WiFi.Radio.[OperatingFrequencyBand == \"2.4GHz\"].OperatingStandards=\"b,g,n,ax\""
|
||||
ba-cli "WiFi.Radio.[OperatingFrequencyBand == \"5GHz\"].OperatingStandards=\"a,n,ac,ax\""
|
||||
ba-cli "WiFi.Radio.[OperatingFrequencyBand == \"6GHz\"].OperatingStandards=\"ax\""
|
||||
|
||||
|
||||
# Make sure specific channels are configured. If channel is set to 0,
|
||||
# ACS will be configured. If ACS is configured hostapd will refuse to
|
||||
# switch channels when we ask it to. Channels 1 and 48 were chosen
|
||||
# because they are NOT used in the WFA certification tests (this
|
||||
# allows to verify that the device actually switches channel as part
|
||||
# of the test).
|
||||
# See also PPM-1928.
|
||||
ba-cli WiFi.Radio.*.AutoChannelEnable=0
|
||||
ba-cli "WiFi.Radio.[OperatingFrequencyBand == \"2.4GHz\"].Channel=1"
|
||||
ba-cli "WiFi.Radio.[OperatingFrequencyBand == \"5GHz\"].Channel=48"
|
||||
|
||||
# Restrict channel bandwidth or the certification test could miss beacons
|
||||
# (see PPM-258)
|
||||
ba-cli "WiFi.Radio.[OperatingFrequencyBand == \"2.4GHz\"].OperatingChannelBandwidth=20MHz"
|
||||
ba-cli "WiFi.Radio.[OperatingFrequencyBand == \"5GHz\"].OperatingChannelBandwidth=20MHz"
|
||||
|
||||
# Traffic Separation Configuration
|
||||
ba-cli WiFi.AccessPoint.*.MultiAPProfile=3
|
||||
|
||||
# Increase log level of WHM components
|
||||
ba-cli "WiFi.set_trace_zone(zone=genHapd, level=500)"
|
||||
ba-cli "WiFi.set_trace_zone(zone=hapdAP, level=500)"
|
||||
ba-cli "WiFi.set_trace_zone(zone=chanMgt, level=500)"
|
||||
ba-cli "WiFi.set_trace_zone(zone=wpaCtrl, level=500)"
|
||||
|
||||
# Start the SSH server on WAN
|
||||
start_ssh_commands="
|
||||
iptables -P INPUT ACCEPT
|
||||
killall -9 dropbear
|
||||
dropbear -F -T 10 -p192.168.250.180:22 &"
|
||||
|
||||
sleep 5
|
||||
|
||||
# Copy generated SSH host keys
|
||||
cp /etc/config/ssh_server/*_key /etc/dropbear/
|
||||
|
||||
# Add command to start dropbear to rc.local to allow SSH access after reboot
|
||||
bootscript="/etc/rc.local"
|
||||
boot_cmd="sleep 60 && $start_ssh_commands"
|
||||
if ! grep -q "$boot_cmd" "$bootscript"; then { head -n -2 "$bootscript"; echo "$boot_cmd"; tail -2 "$bootscript"; } >> btscript.tmp; mv btscript.tmp "$bootscript"; fi
|
||||
set +e && eval "$start_ssh_commands"
|
||||
@@ -1 +1 @@
|
||||
3b89dc07f851ce8047fc1c9378b400c673b9b976
|
||||
16223ad7f6949649aa5e3c990d7597261d5429b8
|
||||
|
||||
@@ -9,7 +9,7 @@ variables:
|
||||
PACKAGE_REGISTRY_BASE_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic"
|
||||
TURRIS_OMNIA_RDKB_FULLIMAGE: "rdkb-generic-broadband-image_turris-omnia.rootfs.tar.gz"
|
||||
FREEDOM_FULLIMAGE: "openwrt-ipq95xx-generic-prpl_freedom-squashfs-sysupgrade.bin"
|
||||
MOZART_FULLIMAGE: "openwrt-mediatek-filogic-arcadyan_mozart-initramfs.itb"
|
||||
MOZART_FULLIMAGE: "openwrt-mediatek-filogic-arcadyan_mozart-squashfs-sysupgrade.itb"
|
||||
OSP_PACKAGE_ID: 13754300
|
||||
|
||||
workflow:
|
||||
@@ -21,6 +21,7 @@ stages:
|
||||
- test
|
||||
- certification-R1-freedom
|
||||
- certification-R4-freedom
|
||||
- certification-R4-mozart
|
||||
- upload
|
||||
- release
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ def main():
|
||||
or using sysupgrade, depending on the target device.""")
|
||||
parser.add_argument('-d', '--device',
|
||||
help="""Device to upgrade. Currently supported targets are:
|
||||
freedom urx_osp urx_ospv2""", required=True)
|
||||
freedom urx_osp urx_ospv2 mozart""", required=True)
|
||||
parser.add_argument(
|
||||
'-t',
|
||||
'--target-name',
|
||||
|
||||
@@ -13,8 +13,6 @@ import pexpect
|
||||
import pexpect.fdpexpect
|
||||
import pexpect.pxssh
|
||||
from device.prplos import GenericPrplOS
|
||||
from device.serial import SerialDevice
|
||||
from device.utils import ShellType
|
||||
|
||||
|
||||
class Mozart(GenericPrplOS):
|
||||
@@ -24,60 +22,20 @@ class Mozart(GenericPrplOS):
|
||||
and 'ipaddr' should already be set in the bootloader.
|
||||
"""
|
||||
|
||||
bootloader_prompt = r"MT7988> "
|
||||
"""The u-boot prompt on the target."""
|
||||
bootloader_prompt = r"MT7988> "
|
||||
boot_stop_sequence = "0"
|
||||
"""
|
||||
fakereset is an alias in the deployed device u-boot environment
|
||||
ramfsfile=openwrt-mediatek-filogic-arcadyan_mozart-initramfs.itb
|
||||
fakereset=tftpboot ${loadaddr} ${ramfsfile}; bootm ${loadaddr}
|
||||
"""
|
||||
bootloader_reboot_command = "run fakereset"
|
||||
bootloader_reboot_command = "run boot_production"
|
||||
|
||||
def upgrade_from_u_boot(self, shell: pexpect.fdpexpect.fdspawn):
|
||||
"""
|
||||
Note: do nothing here
|
||||
Mozart in boardfarm does not do real upgrade
|
||||
"""
|
||||
shell.sendline("")
|
||||
shell.expect(self.bootloader_prompt)
|
||||
# Give the ethernet interfaces some time to initialize:
|
||||
time.sleep(10)
|
||||
# do nothing
|
||||
|
||||
def reboot(self, serial_type: ShellType, stop_in_bootloader: bool = False):
|
||||
"""
|
||||
Note: do load initramfs via tftp
|
||||
Mozart in boardfarm do "upgrade" in this step
|
||||
By sendline(bootloader_reboot_command)
|
||||
"""
|
||||
with SerialDevice(self.baudrate, self.name,
|
||||
self.serial_prompt, expect_prompt_on_connect=False) as shell:
|
||||
print("Reset board.")
|
||||
|
||||
if serial_type == ShellType.UBOOT:
|
||||
if stop_in_bootloader:
|
||||
shell.sendline("reset")
|
||||
else:
|
||||
shell.sendline(self.bootloader_reboot_command)
|
||||
elif serial_type in [ShellType.PRPLOS, ShellType.RDKB, ShellType.LINUX_UNKNOWN]:
|
||||
shell.sendline("reboot ; sleep 15 && echo force rebooting && reboot -f")
|
||||
if stop_in_bootloader:
|
||||
print("Device will be stopped in its bootloader.")
|
||||
max_wait = 180 # total seconds to wait for boot menu
|
||||
start_time = time.time()
|
||||
boot_prompt_detected = False
|
||||
while time.time() - start_time < max_wait:
|
||||
try:
|
||||
shell.expect(self.boot_stop_expression, timeout=1)
|
||||
shell.sendline(self.boot_stop_sequence)
|
||||
except pexpect.TIMEOUT:
|
||||
shell.sendline(self.boot_stop_sequence)
|
||||
try:
|
||||
shell.expect(self.bootloader_prompt, timeout=1)
|
||||
boot_prompt_detected = True
|
||||
print("Device stopped in bootloader.")
|
||||
break
|
||||
except pexpect.TIMEOUT:
|
||||
continue
|
||||
if not boot_prompt_detected:
|
||||
raise TimeoutError("Failed to stop device in bootloader within timeout.")
|
||||
shell.sendline(f"setenv noboot 1; setenv replacevol 1; run boot_tftp_production")
|
||||
shell.sendline("")
|
||||
shell.expect("Loading: ")
|
||||
shell.expect("done")
|
||||
shell.expect("blocks erased: OK")
|
||||
shell.expect("blocks written: OK")
|
||||
shell.expect(self.bootloader_prompt)
|
||||
|
||||
Reference in New Issue
Block a user