diff --git a/.gitlab/tests/cram/arcadyan-mozart/110-prplmesh-dataelements.t b/.gitlab/tests/cram/arcadyan-mozart/110-prplmesh-dataelements.t index 3372fa0fbc..8aad85138d 100644 --- a/.gitlab/tests/cram/arcadyan-mozart/110-prplmesh-dataelements.t +++ b/.gitlab/tests/cram/arcadyan-mozart/110-prplmesh-dataelements.t @@ -258,17 +258,17 @@ To disable wireless, disable instances of Network.AccessPoint{i} and call Access Restore Security.ModeEnabled for AccessPoints used in the test - $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.1'].Security.ModeEnabled='WPA3-Personal-Transition'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -v '>' + $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.1'].Security.ModeEnabled='WPA3-Personal-Transition'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -Ev '^(>|$)' WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) - $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.2'].Security.ModeEnabled='WPA3-Personal-Transition'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -v '>' + $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.2'].Security.ModeEnabled='WPA3-Personal-Transition'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -Ev '^(>|$)' WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) - $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.3'].Security.ModeEnabled='WPA3-Personal'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -v '>' + $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.3'].Security.ModeEnabled='WPA3-Personal'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -Ev '^(>|$)' WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal" (re) @@ -301,17 +301,17 @@ Check that SSIDs did not change: Restore Security Mode to default values - $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.1'].Security.ModeEnabled='WPA3-Personal-Transition'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -v '>' + $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.1'].Security.ModeEnabled='WPA3-Personal-Transition'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -Ev '^(>|$)' WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) - $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.2'].Security.ModeEnabled='WPA3-Personal-Transition'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -v '>' + $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.2'].Security.ModeEnabled='WPA3-Personal-Transition'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -Ev '^(>|$)' WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) - $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.3'].Security.ModeEnabled='WPA3-Personal'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -v '>' + $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.3'].Security.ModeEnabled='WPA3-Personal'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -Ev '^(>|$)' WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal" (re) diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/015-nat-reverse-portmapping.t b/.gitlab/tests/cram/generic/acceleration-plan-components/015-nat-reverse-portmapping.t index 9e73b42fb6..cfe0041562 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/015-nat-reverse-portmapping.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/015-nat-reverse-portmapping.t @@ -11,13 +11,11 @@ Prepare the test setup $ R "${S} && add_user_role --rolename full_caps --capabilities \"CAP_AUDIT_CONTROL,CAP_AUDIT_READ,CAP_AUDIT_WRITE,CAP_BLOCK_SUSPEND,CAP_BPF,CAP_CHECKPOINT_RESTORE,CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_DAC_READ_SEARCH,CAP_FOWNER,CAP_FSETID,CAP_IPC_LOCK,CAP_IPC_OWNER,CAP_KILL,CAP_LEASE,CAP_LINUX_IMMUTABLE,CAP_MAC_ADMIN,CAP_MAC_OVERRIDE,CAP_MKNOD,CAP_NET_ADMIN,CAP_NET_BIND_SERVICE,CAP_NET_BROADCAST,CAP_NET_RAW,CAP_PERFMON,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_ADMIN,CAP_SYS_BOOT,CAP_SYS_CHROOT,CAP_SYS_MODULE,CAP_SYS_NICE,CAP_SYS_PACCT,CAP_SYS_PTRACE,CAP_SYS_RAWIO,CAP_SYS_RESOURCE,CAP_SYS_TIME,CAP_SYS_TTY_CONFIG,CAP_SYSLOG,CAP_WAKE_ALARM\"" {"Device.Users.Role.*.":{"Alias":"full_caps","RoleName":"full_caps"}} (glob) - $ R "${S} && set_ee_roles --userroles \"full_caps\"" SoftwareModules.ExecEnv.1.ModifyAvailableRoles() returned ["",{"err_code":0,"err_msg":""}] - Install test container: @@ -66,14 +64,12 @@ Remove the role from the ExecutionEnvironment SoftwareModules.ExecEnv.1.ModifyAvailableRoles() returned ["",{"err_code":0,"err_msg":""}] - Remove full_caps from Devices.User.Role $ R "${S} && remove_user_role --rolename full_caps" ["Device.Users.Role.*."] (glob) - Cleanup test environment: diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/016-firewall-ipset.t b/.gitlab/tests/cram/generic/acceleration-plan-components/016-firewall-ipset.t index f42f6e9d6b..bc47600bac 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/016-firewall-ipset.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/016-firewall-ipset.t @@ -76,7 +76,6 @@ Utilize set in firewall rule: $ (R "ba-cli Firewall.Chain.2.Rule.1.Status?") | sed 's|[>,]||g' Firewall.Chain.2.Rule.1.Status? Firewall.Chain.2.Rule.1.Status="Enabled" - $ (R "iptables -L FORWARD_L_Low") | sed 's|[0123456789,]||g' Chain FORWARD_L_Low ( references) @@ -93,7 +92,6 @@ Not enabled set in firewall rule: $ (R "ba-cli Firewall.Chain.2.Rule.1.Status?") | sed 's|[>,]||g' Firewall.Chain.2.Rule.1.Status? Firewall.Chain.2.Rule.1.Status="Error_Misconfigured" - $ (R "ba-cli Firewall.Chain.2.Rule.1.SourceMatchSet=\"\"") >> /dev/null @@ -104,11 +102,10 @@ Exclude set parameter: $ (R "ba-cli Firewall.Chain.2.Rule.1.Status?") | sed 's|[>,]||g' Firewall.Chain.2.Rule.1.Status? Firewall.Chain.2.Rule.1.Status="Enabled" - $ (R "iptables -L FORWARD_L_Low") | sed 's|[0123456789,]||g' Chain FORWARD_L_Low ( references) target prot opt source destination ACCEPT all -- anywhere anywhere ! match-set exclude src - $ (R "ba-cli Firewall.Chain.2.Rule.1.SourceMatchSetExclude=\"\"") >> /dev/null \ No newline at end of file + $ (R "ba-cli Firewall.Chain.2.Rule.1.SourceMatchSetExclude=\"\"") >> /dev/null diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/020-security.t b/.gitlab/tests/cram/generic/acceleration-plan-components/020-security.t index e7589fcb6b..0e3dd341af 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/020-security.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/020-security.t @@ -39,7 +39,7 @@ Check that certs are in place as expected: Check that certificate can be disabled (PCF-1054): - $ R "ba-cli 'Security.Certificate.[SignatureAlgorithm==\"ecdsa-with-SHA512\"].Enable=0' | sed -n '3p'" + $ R "ba-cli 'Security.Certificate.[SignatureAlgorithm==\"ecdsa-with-SHA512\"].Enable=0' | grep -Ev '^(>|$)' | grep 'Enable=0'" Security.Certificate.\d+.Enable=0 (re) $ R "ba-cli --json 'Security.Certificate.[SignatureAlgorithm==\"ecdsa-with-SHA512\" && Enable==False].?' | sed -n '2p'" | jq --sort-keys .[0] | grep -v -E '(NotAfter|NotBefore|LastModif)' @@ -57,7 +57,7 @@ Check that certificate can be disabled (PCF-1054): Check that certificate can be enabled (PCF-1054): - $ R "ba-cli 'Security.Certificate.[SignatureAlgorithm==\"ecdsa-with-SHA512\"].Enable=1' | sed -n '3p'" + $ R "ba-cli 'Security.Certificate.[SignatureAlgorithm==\"ecdsa-with-SHA512\"].Enable=1' | grep -Ev '^(>|$)' | grep 'Enable=1'" Security.Certificate.\d+.Enable=1 (re) $ R "ba-cli --json 'Security.Certificate.[SignatureAlgorithm==\"ecdsa-with-SHA512\" && Enable==True].?' | sed -n '2p'" | jq --sort-keys .[0] | grep -v -E '(NotAfter|NotBefore|LastModif)' @@ -93,13 +93,12 @@ Check that CABundle are presents: $ R "echo '%populate{object Security{object CABundle{instance add(){parameter Enable=1; parameter Name=cram; parameter CAFileURI=\"/tmp/server-cert.crt\";}}}}' > /etc/amx/tr181-security/defaults.d/01_cram_periodic_transfer.odl" ; sleep 1 $ R '/etc/init.d/tr181-security restart' - $ R 'ba-cli Security.CABundleNumberOfEntries?' | grep -v '>' + $ R 'ba-cli Security.CABundleNumberOfEntries?' | grep -Ev '^(>|$)' Security.CABundleNumberOfEntries=1 - Check CABundle RPC: - $ R "ba-cli 'Security.CABundle.1.CAFile()'" | grep -v '>' + $ R "ba-cli 'Security.CABundle.1.CAFile()'" | grep -Ev '^(>|$)' Security.CABundle.1.CAFile() returned [ "", @@ -107,8 +106,7 @@ Check CABundle RPC: CAFile = "/tmp/server-cert.crt" } ] - - $ R "ba-cli 'Security.CABundle.1.CADir()'" | grep -v '>' + $ R "ba-cli 'Security.CABundle.1.CADir()'" | grep -Ev '^(>|$)' Security.CABundle.1.CADir() returned [ "", @@ -116,9 +114,8 @@ Check CABundle RPC: CADir = "" } ] - $ R "ba-cli 'Security.CABundle.1.CADirURI=/tmp'" >/dev/null - $ R "ba-cli 'Security.CABundle.1.CADir()'" | grep -v '>' + $ R "ba-cli 'Security.CABundle.1.CADir()'" | grep -Ev '^(>|$)' Security.CABundle.1.CADir() returned [ "", @@ -126,7 +123,6 @@ Check CABundle RPC: CADir = "/tmp" } ] - Restore the state of the system: diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/025-process-monitor.t b/.gitlab/tests/cram/generic/acceleration-plan-components/025-process-monitor.t index b372391c8e..8c64bd49c2 100755 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/025-process-monitor.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/025-process-monitor.t @@ -34,9 +34,8 @@ Get current tr181-led manager PID: Add test for checking tr181-leds manager using PID: - $ R "ba-cli 'ProcessMonitor.Test+{Type=Process,Name=tr181-led,Subject=/var/run/tr181-led.pid,FailAction=RESTART,TestInterval=30,MaxFailNum=1,ProcessMonitoringEnabled=0}' | grep -v '^>'" + $ R "ba-cli 'ProcessMonitor.Test+{Type=Process,Name=tr181-led,Subject=/var/run/tr181-led.pid,FailAction=RESTART,TestInterval=30,MaxFailNum=1,ProcessMonitoringEnabled=0}' | grep -Ev '^(>|$)'" ProcessMonitor.Test.\d+. (re) - Check the LED manager check datamodel settings: diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/026-processfaults-monitor.t b/.gitlab/tests/cram/generic/acceleration-plan-components/026-processfaults-monitor.t index cbbf41ad29..86aa8df1ff 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/026-processfaults-monitor.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/026-processfaults-monitor.t @@ -52,7 +52,7 @@ Check if core dump has been created: Cleanup only if entry is from this test: - $ number_of_entries="$( R "ba-cli -l 'ProcessFaults.ProcessFaultNumberOfEntries?' | sed -n '2p'")" + $ number_of_entries="$( R "ba-cli -l 'ProcessFaults.ProcessFaultNumberOfEntries?' | grep -Ev '^(>|$)'")" $ if [ "$number_of_entries" -eq 1 ]; then R "ba-cli 'ProcessFaults.RemoveAllProcessFaults()' >/dev/null"; fi Check if dump files have really been removed: @@ -61,7 +61,7 @@ Check if dump files have really been removed: Ensure that ProcessFaults does not contain any crashes, expected LastUpgradeCount to be 1 because of the simulated crash - $ R "ba-cli ProcessFaults.? | grep -v '^>' | head -n -1 | sort" + $ R "ba-cli ProcessFaults.? | grep -Ev '^(>|$)' | sort" ProcessFaults. ProcessFaults.LastUpgradeCount=1 ProcessFaults.MaxProcessFaultEntries=5 diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/040-lcm.t b/.gitlab/tests/cram/generic/acceleration-plan-components/040-lcm.t index 3b50fb97e5..a8d4bd5ed2 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/040-lcm.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/040-lcm.t @@ -67,7 +67,6 @@ Check that Rlyeh has no container images: $ R "ba-cli -l -j 'Rlyeh.Images.?'" [{}] - Check that registry.gitlab.com is accessible: @@ -79,7 +78,6 @@ Check that Rlyeh can download testing container: Rlyeh.pull() returned [""] - $ R 'i=1; while [ $i -lt 10 ] && [ "$(ba-cli -lj "Rlyeh.Images.[DUID == \"0f032bd7-54bd-5b81-b14e-9441d730092f\"].DUID?" | jsonfilter -e @[*].*.DUID)" != "0f032bd7-54bd-5b81-b14e-9441d730092f" ]; do i=$((i+1)); sleep 1; done' @@ -96,7 +94,6 @@ Remove testing container: Rlyeh.remove() returned [""] - $ R "ba-cli -l -j 'Rlyeh.Images.[DUID == \"0f032bd7-54bd-5b81-b14e-9441d730092f\"].?' | jsonfilter -e @[*].*.MarkForRemoval" 1 @@ -105,14 +102,12 @@ Remove testing container: Rlyeh.gc() returned [""] - Check that Rlyeh has no container images: $ R "ba-cli -l -j 'Rlyeh.Images.?'" [{}] - Check that testing image is gone from the filesystem as well: diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_1.t b/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_1.t index 770acaf0e8..f9185eca4c 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_1.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_1.t @@ -17,10 +17,9 @@ upnp-client definitions: Allow Reserved WAN IP Addresses: - $ R "ba-cli 'Device.UPnP.X_PRPLWARE-COM_IGDConfig.AllowReservedAddr=1'" | grep -v '^>' + $ R "ba-cli 'Device.UPnP.X_PRPLWARE-COM_IGDConfig.AllowReservedAddr=1'" | grep -Ev '^(>|$)' Device.UPnP.X_PRPLWARE-COM_IGDConfig. Device.UPnP.X_PRPLWARE-COM_IGDConfig.AllowReservedAddr=1 - $ sleep 3 Verify UPnP IGD is present in the network: @@ -41,49 +40,43 @@ Ged Description URL: Check there are no NAT PortMapping rules: - $ R "ba-cli 'Device.NAT.PortMapping.?'" | grep -v '^>' + $ R "ba-cli 'Device.NAT.PortMapping.?'" | grep -Ev '^(>|$)' No data found - Create NAT PortMapping rules: - $ R "ba-cli 'Device.NAT.PortMapping.+{Alias=testrule1,Enable=1,Interface=Device.IP.Interface.2,Origin=UPnP,RemoteHost=1.1.1.1,ExternalPort=12345,InternalPort=12345,InternalClient=192.168.1.123}'" | grep -v '^>' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' + $ R "ba-cli 'Device.NAT.PortMapping.+{Alias=testrule1,Enable=1,Interface=Device.IP.Interface.2,Origin=UPnP,RemoteHost=1.1.1.1,ExternalPort=12345,InternalPort=12345,InternalClient=192.168.1.123}'" | grep -Ev '^(>|$)' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' Device.NAT.PortMapping.X. Device.NAT.PortMapping.X.Alias="testrule1" Device.NAT.PortMapping.X.ExternalPort=12345 Device.NAT.PortMapping.X.Protocol="TCP" Device.NAT.PortMapping.X.RemoteHost="1.1.1.1" - - $ R "ba-cli 'Device.NAT.PortMapping.+{Alias=testrule2,Enable=1,Interface=Device.IP.Interface.2,Origin=UPnP,RemoteHost=1.1.1.1,ExternalPort=23456,InternalPort=23456,InternalClient=192.168.1.123}'" | grep -v '^>' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' + $ R "ba-cli 'Device.NAT.PortMapping.+{Alias=testrule2,Enable=1,Interface=Device.IP.Interface.2,Origin=UPnP,RemoteHost=1.1.1.1,ExternalPort=23456,InternalPort=23456,InternalClient=192.168.1.123}'" | grep -Ev '^(>|$)' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' Device.NAT.PortMapping.X. Device.NAT.PortMapping.X.Alias="testrule2" Device.NAT.PortMapping.X.ExternalPort=23456 Device.NAT.PortMapping.X.Protocol="TCP" Device.NAT.PortMapping.X.RemoteHost="1.1.1.1" - - $ R "ba-cli 'Device.NAT.PortMapping.+{Alias=testrule3,Enable=1,Interface=Device.IP.Interface.2,Origin=UPnP,RemoteHost=1.1.1.1,ExternalPort=34567,InternalPort=34567,InternalClient=192.168.1.123}'" | grep -v '^>' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' + $ R "ba-cli 'Device.NAT.PortMapping.+{Alias=testrule3,Enable=1,Interface=Device.IP.Interface.2,Origin=UPnP,RemoteHost=1.1.1.1,ExternalPort=34567,InternalPort=34567,InternalClient=192.168.1.123}'" | grep -Ev '^(>|$)' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' Device.NAT.PortMapping.X. Device.NAT.PortMapping.X.Alias="testrule3" Device.NAT.PortMapping.X.ExternalPort=34567 Device.NAT.PortMapping.X.Protocol="TCP" Device.NAT.PortMapping.X.RemoteHost="1.1.1.1" - - $ R "ba-cli 'Device.NAT.PortMapping.+{Alias=testrule4,Enable=1,Interface=Device.IP.Interface.2,Origin=Controller,RemoteHost=1.1.1.1,ExternalPort=45678,InternalPort=45678,InternalClient=192.168.1.123}'" | grep -v '^>' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' + $ R "ba-cli 'Device.NAT.PortMapping.+{Alias=testrule4,Enable=1,Interface=Device.IP.Interface.2,Origin=Controller,RemoteHost=1.1.1.1,ExternalPort=45678,InternalPort=45678,InternalClient=192.168.1.123}'" | grep -Ev '^(>|$)' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' Device.NAT.PortMapping.X. Device.NAT.PortMapping.X.Alias="testrule4" Device.NAT.PortMapping.X.ExternalPort=45678 Device.NAT.PortMapping.X.Protocol="TCP" Device.NAT.PortMapping.X.RemoteHost="1.1.1.1" - Delete the second NAT PortMapping rules: - $ R "ba-cli 'Device.NAT.PortMapping.testrule2.-'" | grep -v '^>' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' + $ R "ba-cli 'Device.NAT.PortMapping.testrule2.-'" | grep -Ev '^(>|$)' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' Device.NAT.PortMapping.X. - Rtrieve NAT PortMapping with index 0: @@ -137,14 +130,11 @@ Retrieve NAT PortMapping with index 3: Clean up: - $ R "ba-cli 'Device.NAT.PortMapping.testrule1.-'" | grep -v '^>' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' + $ R "ba-cli 'Device.NAT.PortMapping.testrule1.-'" | grep -Ev '^(>|$)' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' Device.NAT.PortMapping.X. - - $ R "ba-cli 'Device.NAT.PortMapping.testrule3.-'" | grep -v '^>' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' + $ R "ba-cli 'Device.NAT.PortMapping.testrule3.-'" | grep -Ev '^(>|$)' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' Device.NAT.PortMapping.X. - - $ R "ba-cli 'Device.NAT.PortMapping.testrule4.-'" | grep -v '^>' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' + $ R "ba-cli 'Device.NAT.PortMapping.testrule4.-'" | grep -Ev '^(>|$)' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' Device.NAT.PortMapping.X. - diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_2.t b/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_2.t index 613f4c719a..7a34c3525b 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_2.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_2.t @@ -17,10 +17,9 @@ upnp-client definitions: Allow Reserved WAN IP Addresses: - $ R "ba-cli 'Device.UPnP.X_PRPLWARE-COM_IGDConfig.AllowReservedAddr=1'" | grep -v '^>' + $ R "ba-cli 'Device.UPnP.X_PRPLWARE-COM_IGDConfig.AllowReservedAddr=1'" | grep -Ev '^(>|$)' Device.UPnP.X_PRPLWARE-COM_IGDConfig. Device.UPnP.X_PRPLWARE-COM_IGDConfig.AllowReservedAddr=1 - $ sleep 3 Verify UPnP IGD is present in the network: @@ -41,19 +40,17 @@ Ged Description URL: Check there are no NAT PortMapping rules: - $ R "ba-cli 'Device.NAT.PortMapping.?'" | grep -v '^>' + $ R "ba-cli 'Device.NAT.PortMapping.?'" | grep -Ev '^(>|$)' No data found - Create 1 NAT PortMapping rule with non-UPnP origin: - $ R "ba-cli 'Device.NAT.PortMapping.+{Alias=testrule1,Enable=1,Interface=Device.IP.Interface.2,Origin=Controller,RemoteHost=1.1.1.1,ExternalPort=12345,InternalPort=12345,InternalClient=192.168.1.123}'" | grep -v '^>' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' + $ R "ba-cli 'Device.NAT.PortMapping.+{Alias=testrule1,Enable=1,Interface=Device.IP.Interface.2,Origin=Controller,RemoteHost=1.1.1.1,ExternalPort=12345,InternalPort=12345,InternalClient=192.168.1.123}'" | grep -Ev '^(>|$)' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' Device.NAT.PortMapping.X. Device.NAT.PortMapping.X.Alias="testrule1" Device.NAT.PortMapping.X.ExternalPort=12345 Device.NAT.PortMapping.X.Protocol="TCP" Device.NAT.PortMapping.X.RemoteHost="1.1.1.1" - Retrieve NAT PortMapping with index 0: @@ -98,9 +95,8 @@ Rtrieve NAT PortMapping with index 0: Clean up: - $ R "ba-cli 'Device.NAT.PortMapping.testrule1.-'" | grep -v '^>' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' + $ R "ba-cli 'Device.NAT.PortMapping.testrule1.-'" | grep -Ev '^(>|$)' | sed -E 's/\.PortMapping\.[0-9]+\./.PortMapping.X./' Device.NAT.PortMapping.X. - $ upnp-client call-action $DESC_URL WANIPConn1/DeletePortMapping NewRemoteHost=2.2.2.2 NewExternalPort=23456 NewProtocol=TCP >/dev/null diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_3.t b/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_3.t index 9347dbe027..9053a8d6e6 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_3.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_3.t @@ -17,10 +17,9 @@ upnp-client definitions: Allow Reserved WAN IP Addresses: - $ R "ba-cli 'Device.UPnP.X_PRPLWARE-COM_IGDConfig.AllowReservedAddr=1'" | grep -v '^>' + $ R "ba-cli 'Device.UPnP.X_PRPLWARE-COM_IGDConfig.AllowReservedAddr=1'" | grep -Ev '^(>|$)' Device.UPnP.X_PRPLWARE-COM_IGDConfig. Device.UPnP.X_PRPLWARE-COM_IGDConfig.AllowReservedAddr=1 - $ sleep 3 Verify UPnP IGD is present in the network: diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_4.t b/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_4.t index 5ea668cb28..e20d3bfdac 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_4.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_4.t @@ -17,10 +17,9 @@ upnp-client definitions: Allow Reserved WAN IP Addresses: - $ R "ba-cli 'Device.UPnP.X_PRPLWARE-COM_IGDConfig.AllowReservedAddr=1'" | grep -v '^>' + $ R "ba-cli 'Device.UPnP.X_PRPLWARE-COM_IGDConfig.AllowReservedAddr=1'" | grep -Ev '^(>|$)' Device.UPnP.X_PRPLWARE-COM_IGDConfig. Device.UPnP.X_PRPLWARE-COM_IGDConfig.AllowReservedAddr=1 - $ sleep 3 Verify UPnP IGD is present in the network: diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_5.t b/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_5.t index 9fbf668446..6095b85c3c 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_5.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/065-upnp_5.t @@ -21,10 +21,9 @@ upnp-client definitions: Allow Reserved WAN IP Addresses: - $ R "ba-cli 'Device.UPnP.X_PRPLWARE-COM_IGDConfig.AllowReservedAddr=1'" | grep -v '^>' + $ R "ba-cli 'Device.UPnP.X_PRPLWARE-COM_IGDConfig.AllowReservedAddr=1'" | grep -Ev '^(>|$)' Device.UPnP.X_PRPLWARE-COM_IGDConfig. Device.UPnP.X_PRPLWARE-COM_IGDConfig.AllowReservedAddr=1 - $ sleep 3 Verify UPnP IGD is present in the network: diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/068-gmap-mod-dnssd.t b/.gitlab/tests/cram/generic/acceleration-plan-components/068-gmap-mod-dnssd.t index 4332a7277a..be3d289a3f 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/068-gmap-mod-dnssd.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/068-gmap-mod-dnssd.t @@ -12,9 +12,8 @@ Ensure avahi-daemon is running: Ensure DNS.SD service is enabled on HGW: - $ R "ba-cli 'DNSSD.Enable?'" | grep -v '>' + $ R "ba-cli 'DNSSD.Enable?'" | grep -Ev '^(>|$)' DNSSD.Enable=1 - Test 1: Service Advertisement (mDNS announcement): @@ -74,13 +73,12 @@ Wait for removal to propagate: Verify entry is removed from TR-181: - $ R 'ba-cli "Device.DNS.SD.Service.[InstanceName==\"CramTestService1\"].?"' 2>&1 | grep -v '>' + $ R 'ba-cli "Device.DNS.SD.Service.[InstanceName==\"CramTestService1\"].?"' 2>&1 | grep -Ev '^(>|$)' No data found - Verify entry is removed from gmap datamodel: - $ R 'ba-cli "Devices.Device.*.mDNSService.[Name==\"CramTestService1\"].?"' | grep -v '>' | grep 'CramTestService1' || echo "Not found" + $ R 'ba-cli "Devices.Device.*.mDNSService.[Name==\"CramTestService1\"].?"' | grep -Ev '^(>|$)' | grep 'CramTestService1' || echo "Not found" Not found Cleanup: diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/070-time.t b/.gitlab/tests/cram/generic/acceleration-plan-components/070-time.t index 441401ca2c..ab0b147b80 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/070-time.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/070-time.t @@ -153,7 +153,6 @@ Check LocalTimeZone correctly filter wrong TZ: Time.LocalTimeZone=JST-9 Time. Time.LocalTimeZone="JST-9" - $ (R "date +%Z") JST @@ -161,14 +160,12 @@ Check LocalTimeZone correctly filter wrong TZ: Time.LocalTimeZone=UTC0 Time. Time.LocalTimeZone="UTC0" - $ (R "date +%Z") UTC $ (R "ba-cli Time.LocalTimeZone=\"NOTAVALIDETZ\"") | sed 's|[>,]||g' Time.LocalTimeZone=NOTAVALIDETZ ERROR: set Time.LocalTimeZone failed (10 - invalid value) - $ (R "date +%Z") UTC @@ -176,14 +173,12 @@ Check LocalTimeZone correctly filter wrong TZ: Time.LocalTimeZone=GMT0 Time. Time.LocalTimeZone="GMT0" - $ (R "date +%Z") GMT $ (R "ba-cli Time.LocalTimeZone=\"/usr/share/zoneinfo/Universal\"") | sed 's|[>,]||g' Time.LocalTimeZone=/usr/share/zoneinfo/Universal ERROR: set Time.LocalTimeZone failed (10 - invalid value) - $ (R "date +%Z") GMT @@ -193,7 +188,6 @@ Set back default timezone: Time.LocalTimeZone=GMT0 Time. Time.LocalTimeZone="GMT0" - $ (R "date +%Z") GMT diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/095-syslog.t b/.gitlab/tests/cram/generic/acceleration-plan-components/095-syslog.t index 2df6b42d08..f7120e6b34 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/095-syslog.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/095-syslog.t @@ -17,11 +17,12 @@ Check logs appears in /var/log/messages with expected format: Check that filtering and command are working as expected (testing dhcp): - $ dhcplogfile=$(R "ba-cli 'Syslog.Action.[Alias==\"dhcp\"].LogFile.FilePath?'" | grep -v '^>' | head -n -2 | sed -E 's|.*"file://(.*)"|\1|') + $ dhcplogfile=$(R "ba-cli 'Syslog.Action.[Alias==\"dhcp\"].LogFile.FilePath?'" | grep -Ev '^(>|$)' | sed -E 's|.*"file://(.*)"|\1|') $ R "test -s $dhcplogfile && echo 'log file is non empty'" log file is non empty - $ dhcppattern=$(R "ba-cli 'Syslog.Filter.[Alias==\"dhcp\"].PatternMatch?'" | grep -v '^>' | head -n -2 | sed -E 's|.*="\^?(.+?)"|\1|') + $ dhcppattern=$(R "ba-cli 'Syslog.Filter.[Alias==\"dhcp\"].PatternMatch?'" | sed -nE 's|.*PatternMatch="?\^?([^"]*)"?$|\1|p' | sed -E 's|\\([()])|\1|g') + $ test -n "$dhcppattern" $ R "grep -v -E '^$datepattern [^ ]+ $dhcppattern' $dhcplogfile" || echo "Only expect filtered log found" Only expect filtered log found diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/100-captiveportal.t b/.gitlab/tests/cram/generic/acceleration-plan-components/100-captiveportal.t index f9e39718ef..fed28b0d70 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/100-captiveportal.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/100-captiveportal.t @@ -5,7 +5,7 @@ Create R alias: Enable Captive Portal (not activated by default): $ R "ba-cli 'CaptivePortal.Enable=1'" >/dev/null - $ R "ba-cli 'CaptivePortal.Status?' | sed -n '2p'" + $ R "ba-cli 'CaptivePortal.Status?' | grep -Ev '^(>|$)'" CaptivePortal.Status="Enabled" $ sleep 1 @@ -26,7 +26,7 @@ Wait for status change: Check openNDS http interface has been opened on br-lan: - $ R "ba-cli 'UserInterface.HTTPAccess.[Alias==\"captive\"].Interface?' | sed -n '2p'" + $ R "ba-cli 'UserInterface.HTTPAccess.[Alias==\"captive\"].Interface?' | grep -Ev '^(>|$)'" UserInterface.HTTPAccess.3.Interface="Device.IP.Interface.3" Send a curl http request to detectportal.firefox.com and check we have a 307 temporary redirect: @@ -36,9 +36,9 @@ Send a curl http request to detectportal.firefox.com and check we have a 307 tem Reenable WAN: - $ R "ba-cli -lj 'Device.IP.Interface.[Alias==\"wan\"].Enable=1' | sed -n '2p'" + $ R "ba-cli -lj 'Device.IP.Interface.[Alias==\"wan\"].Enable=1' | grep -Ev '^(>|$)'" [{"Device.IP.Interface.2.":{"Enable":1}}] - $ R "ba-cli 'CaptivePortal.Status?' | sed -n '2p'" + $ R "ba-cli 'CaptivePortal.Status?' | grep -Ev '^(>|$)'" CaptivePortal.Status="Enabled" Cleanup: diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/110-data-model-mapper.t b/.gitlab/tests/cram/generic/acceleration-plan-components/110-data-model-mapper.t index ecacad61e6..6bb3fc2297 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/110-data-model-mapper.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/110-data-model-mapper.t @@ -136,9 +136,8 @@ Check command tree is available: Check that no deployment units exist: - $ R "ba-cli 'SoftwareModules.DeploymentUnit.?'" | tail -n +2 + $ R "ba-cli 'SoftwareModules.DeploymentUnit.?'" | grep -Ev '^(>|$)' No data found - Check that registry.gitlab.com is accessible: @@ -155,7 +154,7 @@ Set Input for InstallDU command: > AllocatedMemory=\"-1\", \\ > Privileged=\"1\", \\ > ModuleVersion=\"v1\" \\ - > }" | tail -n +2 + > }" | grep -Ev '^(>|$)' X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.Input. X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.Input.AllocatedCPUPercent=100 X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.Input.AllocatedDiskSpace=-1 @@ -165,18 +164,16 @@ Set Input for InstallDU command: X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.Input.Privileged=1 X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.Input.URL="docker://registry.gitlab.com/prpl-foundation/prplos/prplos/prplos/*:prplos-v1" (glob) X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.Input.UUID="00000000-0000-5000-b000-000000000001" - Run InstallDU command and wait: - $ R "ba-cli X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.State='Requested'" | tail -n +2; sleep 30 + $ R "ba-cli X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.State='Requested'" | grep -Ev '^(>|$)'; sleep 30 X_PRPLWARE-COM_SoftwareModules.InstallDUCmd. X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.State="Requested" - Check new DeploymentUnit: - $ R "ba-cli 'SoftwareModules.DeploymentUnit.[ UUID == \"00000000-0000-5000-b000-000000000001\" ].?'" | tail -n +2 + $ R "ba-cli 'SoftwareModules.DeploymentUnit.[ UUID == \"00000000-0000-5000-b000-000000000001\" ].?'" | grep -Ev '^(>|$)' SoftwareModules.DeploymentUnit.*. (glob) SoftwareModules.DeploymentUnit.*.Alias="*" (glob) SoftwareModules.DeploymentUnit.*.DUID="*" (glob) @@ -195,29 +192,25 @@ Check new DeploymentUnit: SoftwareModules.DeploymentUnit.*.VendorConfigList="" (glob) SoftwareModules.DeploymentUnit.*.VendorLogList="" (glob) SoftwareModules.DeploymentUnit.*.Version="prplos-v1" (glob) - Get index of the new DeploymentUnit: - $ du_index=$(R "ba-cli 'SoftwareModules.DeploymentUnit.*.UUID?'" | tail -n +2 | awk -F'.' '{print $3}') + $ du_index=$(R "ba-cli 'SoftwareModules.DeploymentUnit.*.UUID?'" | grep -Ev '^(>|$)' | awk -F'.' '{print $3}') Remove new DeploymentUnit and wait: - $ R "ba-cli X_PRPLWARE-COM_SoftwareModules.DeploymentUnitUninstallCmd.CmdPath='Device.SoftwareModules.DeploymentUnit.${du_index}'" | tail -n +2 + $ R "ba-cli X_PRPLWARE-COM_SoftwareModules.DeploymentUnitUninstallCmd.CmdPath='Device.SoftwareModules.DeploymentUnit.${du_index}'" | grep -Ev '^(>|$)' X_PRPLWARE-COM_SoftwareModules.DeploymentUnitUninstallCmd. X_PRPLWARE-COM_SoftwareModules.DeploymentUnitUninstallCmd.CmdPath="Device.SoftwareModules.DeploymentUnit.*" (glob) - - $ R "ba-cli X_PRPLWARE-COM_SoftwareModules.DeploymentUnitUninstallCmd.State='Requested'" | tail -n +2; sleep 10 + $ R "ba-cli X_PRPLWARE-COM_SoftwareModules.DeploymentUnitUninstallCmd.State='Requested'" | grep -Ev '^(>|$)'; sleep 10 X_PRPLWARE-COM_SoftwareModules.DeploymentUnitUninstallCmd. X_PRPLWARE-COM_SoftwareModules.DeploymentUnitUninstallCmd.State="Requested" - Check that new DeploymentUnit is deleted: - $ R "ba-cli 'SoftwareModules.DeploymentUnit.?'" | tail -n +2 + $ R "ba-cli 'SoftwareModules.DeploymentUnit.?'" | grep -Ev '^(>|$)' No data found - Set Input for InstallDU command with error (AllocatedCPUPercent should <= 100): @@ -230,7 +223,7 @@ Set Input for InstallDU command with error (AllocatedCPUPercent should <= 100): > AllocatedMemory=\"-1\", \\ > Privileged=\"1\", \\ > ModuleVersion=\"v1\" \\ - > }" | tail -n +2 + > }" | grep -Ev '^(>|$)' X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.Input. X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.Input.AllocatedCPUPercent=500 X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.Input.AllocatedDiskSpace=-1 @@ -240,35 +233,28 @@ Set Input for InstallDU command with error (AllocatedCPUPercent should <= 100): X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.Input.Privileged=1 X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.Input.URL="docker://registry.gitlab.com/prpl-foundation/prplos/prplos/prplos/*:prplos-v1" (glob) X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.Input.UUID="00000000-0000-5000-b000-000000000001" - Run InstallDU command and wait: - $ R "ba-cli X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.State='Requested'" | tail -n +2; sleep 30 + $ R "ba-cli X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.State='Requested'" | grep -Ev '^(>|$)'; sleep 30 X_PRPLWARE-COM_SoftwareModules.InstallDUCmd. X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.State="Requested" - Check error: - $ R "ba-cli 'X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.State?'" | tail -n +2 + $ R "ba-cli 'X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.State?'" | grep -Ev '^(>|$)' X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.State="Error" - - $ R "ba-cli 'X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.ErrorCode?'" | tail -n +2 + $ R "ba-cli 'X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.ErrorCode?'" | grep -Ev '^(>|$)' X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.ErrorCode="7004" - - $ R "ba-cli 'X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.ErrorMessage?'" | tail -n +2 + $ R "ba-cli 'X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.ErrorMessage?'" | grep -Ev '^(>|$)' X_PRPLWARE-COM_SoftwareModules.InstallDUCmd.ErrorMessage="CPU should be between 0 and 100 [not 500]" - - $ R "ba-cli 'SoftwareModules.DeploymentUnit.?'" | tail -n +2 + $ R "ba-cli 'SoftwareModules.DeploymentUnit.?'" | grep -Ev '^(>|$)' No data found - Check that only generic ExecEnv is present: - $ R "ba-cli 'SoftwareModules.ExecEnv.*.Name?'" | tail -n +2 + $ R "ba-cli 'SoftwareModules.ExecEnv.*.Name?'" | grep -Ev '^(>|$)' SoftwareModules.ExecEnv.1.Name="generic" - Set Input for AddExecEnv command: @@ -281,7 +267,7 @@ Set Input for AddExecEnv command: > AllocatedMemory='-1', \\ > AllocatedDiskSpace='-1', \\ > AllocatedCPUPercent='100' \\ - > }" | tail -n +2 + > }" | grep -Ev '^(>|$)' X_PRPLWARE-COM_SoftwareModules.AddExecEnvCmd.Input. X_PRPLWARE-COM_SoftwareModules.AddExecEnvCmd.Input.AllocatedCPUPercent=100 X_PRPLWARE-COM_SoftwareModules.AddExecEnvCmd.Input.AllocatedDiskSpace=-1 @@ -291,43 +277,37 @@ Set Input for AddExecEnv command: X_PRPLWARE-COM_SoftwareModules.AddExecEnvCmd.Input.ParentExecEnv="SoftwareModules.ExecEnv.1" X_PRPLWARE-COM_SoftwareModules.AddExecEnvCmd.Input.Vendor="test_vendor" X_PRPLWARE-COM_SoftwareModules.AddExecEnvCmd.Input.Version="1" - Run AddExecEnv command: - $ R "ba-cli X_PRPLWARE-COM_SoftwareModules.AddExecEnvCmd.State='Requested'" | tail -n +2 + $ R "ba-cli X_PRPLWARE-COM_SoftwareModules.AddExecEnvCmd.State='Requested'" | grep -Ev '^(>|$)' X_PRPLWARE-COM_SoftwareModules.AddExecEnvCmd. X_PRPLWARE-COM_SoftwareModules.AddExecEnvCmd.State="Requested" - Check that new ExecEnv is present: - $ R "ba-cli 'SoftwareModules.ExecEnv.*.Name?'" | tail -n +2 + $ R "ba-cli 'SoftwareModules.ExecEnv.*.Name?'" | grep -Ev '^(>|$)' SoftwareModules.ExecEnv.1.Name="generic" SoftwareModules.ExecEnv.*.Name="TestEnv01" (glob) - Get index of the new ExecEnv: - $ exec_env_index=$(R "ba-cli 'SoftwareModules.ExecEnv.*.Name?'" | tail -n +2 | grep -v 'ExecEnv\.1\.' | awk -F'.' '{print $3}') + $ exec_env_index=$(R "ba-cli 'SoftwareModules.ExecEnv.*.Name?'" | grep -Ev '^(>|$)' | grep -v 'ExecEnv\.1\.' | awk -F'.' '{print $3}') Remove new ExecEnv: - $ R "ba-cli X_PRPLWARE-COM_SoftwareModules.ExecEnvDeleteCmd.CmdPath='Device.SoftwareModules.ExecEnv.${exec_env_index}'" | tail -n +2 + $ R "ba-cli X_PRPLWARE-COM_SoftwareModules.ExecEnvDeleteCmd.CmdPath='Device.SoftwareModules.ExecEnv.${exec_env_index}'" | grep -Ev '^(>|$)' X_PRPLWARE-COM_SoftwareModules.ExecEnvDeleteCmd. X_PRPLWARE-COM_SoftwareModules.ExecEnvDeleteCmd.CmdPath="Device.SoftwareModules.ExecEnv.*" (glob) - - $ R "ba-cli X_PRPLWARE-COM_SoftwareModules.ExecEnvDeleteCmd.State='Requested'" | tail -n +2 + $ R "ba-cli X_PRPLWARE-COM_SoftwareModules.ExecEnvDeleteCmd.State='Requested'" | grep -Ev '^(>|$)' X_PRPLWARE-COM_SoftwareModules.ExecEnvDeleteCmd. X_PRPLWARE-COM_SoftwareModules.ExecEnvDeleteCmd.State="Requested" - Check that new ExecEnv is deleted: - $ R "ba-cli 'SoftwareModules.ExecEnv.*.Name?'" | tail -n +2 + $ R "ba-cli 'SoftwareModules.ExecEnv.*.Name?'" | grep -Ev '^(>|$)' SoftwareModules.ExecEnv.1.Name="generic" - Cleanup: @@ -336,4 +316,3 @@ Cleanup: $ R "/etc/init.d/data-model-mapper stop" > /dev/null 2>&1 $ R "opkg remove -V0 data-model-mapper >/dev/null 2>&1;echo $?" 0 - diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/110-oopsmonitor.t b/.gitlab/tests/cram/generic/acceleration-plan-components/110-oopsmonitor.t index 2bc172aac9..bd0dbfd8d7 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/110-oopsmonitor.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/110-oopsmonitor.t @@ -13,4 +13,3 @@ Check Kernelfaults root datamodel: KernelFaults.MinFreeSpace=[0-9]* (re) KernelFaults.PreviousBootCount=[0-9]* (re) KernelFaults.StoragePath="/data/oops" - diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/119-tr181-mqtt.t b/.gitlab/tests/cram/generic/acceleration-plan-components/119-tr181-mqtt.t index 7a0ba2dcf5..bfa99efd99 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/119-tr181-mqtt.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/119-tr181-mqtt.t @@ -35,10 +35,10 @@ Sleep for a moment to ensure subscriber is ready before publishing messages: Add MQTT client and subscription: - $ R "ba-cli 'MQTT.Client.+{Alias=\"local_broker\", BrokerAddress=\"127.0.0.1\", Enable=\"true\"}' | grep -v '>' | grep 'local_broker'" + $ R "ba-cli 'MQTT.Client.+{Alias=\"local_broker\", BrokerAddress=\"127.0.0.1\", Enable=\"true\"}' | grep -Ev '^(>|$)' | grep 'local_broker'" MQTT.Client.[0-9]+.Alias="local_broker" (re) - $ R "ba-cli 'MQTT.Client.local_broker.Subscription.+{Topic=\"SAH_CRAM_tests\", Enable=\"true\"}' | grep -v '>' | grep 'Topic'" + $ R "ba-cli 'MQTT.Client.local_broker.Subscription.+{Topic=\"SAH_CRAM_tests\", Enable=\"true\"}' | grep -Ev '^(>|$)' | grep 'Topic'" MQTT.Client.[0-9]+.Subscription.1.Topic="SAH_CRAM_tests" (re) $ sleep 2 # Wait for MQTT client to connect and subscribe diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/120-bulkdata-initial.t b/.gitlab/tests/cram/generic/acceleration-plan-components/120-bulkdata-initial.t index d0cdfdd755..c2f614e5e3 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/120-bulkdata-initial.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/120-bulkdata-initial.t @@ -32,7 +32,7 @@ Check BulkData root datamodel: Enable BulkData and check object status: - $ R "ba-cli 'BulkData.Enable=1' | grep -v '>' | grep 'Enable'" + $ R "ba-cli 'BulkData.Enable=1' | grep -Ev '^(>|$)' | grep 'Enable'" BulkData.Enable=1 $ R "ba-cli 'BulkData.Status?' | grep '='" @@ -40,19 +40,19 @@ Enable BulkData and check object status: Check added new Profile: - $ alias=$(R "ba-cli 'BulkData.Profile.+{Protocol=USPEventNotif, Enable=true}' | grep -v '>' | grep 'Alias'| sed -E 's/.*Alias=\"([^\"]+)\"/\1/'") + $ alias=$(R "ba-cli 'BulkData.Profile.+{Protocol=USPEventNotif, Enable=true}' | grep -Ev '^(>|$)' | grep 'Alias'| sed -E 's/.*Alias=\"([^\"]+)\"/\1/'") $ echo "$alias" cpe-Profile-[0-9]+ (re) Check adding ReportingInterval value: - $ R "ba-cli 'BulkData.Profile.$alias.ReportingInterval=15' | sort | grep 'BulkData' | grep -v '>'" + $ R "ba-cli 'BulkData.Profile.$alias.ReportingInterval=15' | sort | grep 'BulkData' | grep -Ev '^(>|$)'" BulkData.Profile.[0-9]+. (re) BulkData.Profile.[0-9]+.ReportingInterval=15 (re) Check adding Reference information: - $ R "ba-cli "BulkData.Profile.$alias.Parameter.+{Reference="Device.DeviceInfo.SerialNumber"}" | sort | grep 'BulkData' | grep -v '>'" + $ R "ba-cli "BulkData.Profile.$alias.Parameter.+{Reference="Device.DeviceInfo.SerialNumber"}" | sort | grep 'BulkData' | grep -Ev '^(>|$)'" BulkData.Profile.[0-9]+.Parameter.[0-9]+. (re) Check push notification: diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/121-bulkdata-profiles.t b/.gitlab/tests/cram/generic/acceleration-plan-components/121-bulkdata-profiles.t index f7d05e2e07..028fb06df4 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/121-bulkdata-profiles.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/121-bulkdata-profiles.t @@ -41,7 +41,7 @@ Disable time synchronization and restart tr181-bulkdata to test BulkData module Enable BulkData and check object status: - $ R "ba-cli 'BulkData.Enable=1' | grep -v '>' | grep 'Enable'" + $ R "ba-cli 'BulkData.Enable=1' | grep -Ev '^(>|$)' | grep 'Enable'" BulkData.Enable=1 $ R "ba-cli 'BulkData.Status?' | grep '='" @@ -50,37 +50,37 @@ Enable BulkData and check object status: 1-HTTP Profile to send JSON report Check adding an object with HTTP profile to send JSON report: - $ R "ba-cli 'BulkData.Profile.+{Alias="http-json", EncodingType="JSON", Name="http-json", Protocol="HTTP", Enable="false", ReportingInterval = 30}' | grep -v '>' | grep 'http-json'" + $ R "ba-cli 'BulkData.Profile.+{Alias="http-json", EncodingType="JSON", Name="http-json", Protocol="HTTP", Enable="false", ReportingInterval = 30}' | grep -Ev '^(>|$)' | grep 'http-json'" BulkData.Profile.[0-9]+.Alias="http-json" (re) Check to update HTTP object: - $ R "ba-cli 'BulkData.Profile.http-json.HTTP.URL="https://postman-echo.com/post/"' | grep -v '>' | grep '='" + $ R "ba-cli 'BulkData.Profile.http-json.HTTP.URL="https://postman-echo.com/post/"' | grep -Ev '^(>|$)' | grep '='" BulkData.Profile.[0-9]+.HTTP.URL="https://postman-echo.com/post/" (re) - $ R "ba-cli 'BulkData.Profile.http-json.HTTP.Method="POST"' | grep -v '>' | grep '='" + $ R "ba-cli 'BulkData.Profile.http-json.HTTP.Method="POST"' | grep -Ev '^(>|$)' | grep '='" BulkData.Profile.[0-9]+.HTTP.Method="POST" (re) - $ R "ba-cli 'BulkData.Profile.http-json.HTTP.UseDateHeader=1' | grep -v '>' | grep '='" + $ R "ba-cli 'BulkData.Profile.http-json.HTTP.UseDateHeader=1' | grep -Ev '^(>|$)' | grep '='" BulkData.Profile.[0-9]+.HTTP.UseDateHeader=1 (re) Check to update JSON object: - $ R "ba-cli 'BulkData.Profile.http-json.JSONEncoding.ReportFormat="ObjectHierarchy"' | grep -v '>' | grep '='" + $ R "ba-cli 'BulkData.Profile.http-json.JSONEncoding.ReportFormat="ObjectHierarchy"' | grep -Ev '^(>|$)' | grep '='" BulkData.Profile.[0-9]+.JSONEncoding.ReportFormat="ObjectHierarchy" (re) - $ R "ba-cli 'BulkData.Profile.http-json.JSONEncoding.ReportTimestamp="Unix-Epoch"' | grep -v '>' | grep '='" + $ R "ba-cli 'BulkData.Profile.http-json.JSONEncoding.ReportTimestamp="Unix-Epoch"' | grep -Ev '^(>|$)' | grep '='" BulkData.Profile.[0-9]+.JSONEncoding.ReportTimestamp="Unix-Epoch" (re) Check adding a parameter to be sent in the report: - $ R "ba-cli 'BulkData.Profile.http-json.Parameter.+{Name="Contacts", Reference="Phonebook.Contact."}' | grep -v '>' | grep '.'" + $ R "ba-cli 'BulkData.Profile.http-json.Parameter.+{Name="Contacts", Reference="Phonebook.Contact."}' | grep -Ev '^(>|$)' | grep '.'" BulkData.Profile.[0-9]+.Parameter.[0-9]+. (re) Check after enabling the configured profile: $ sleep 5 # wait for object creation - $ R "ba-cli 'BulkData.Profile.http-json.Enable="true"' | grep -v '>' | grep '='" + $ R "ba-cli 'BulkData.Profile.http-json.Enable="true"' | grep -Ev '^(>|$)' | grep '='" BulkData.Profile.[0-9]+.Enable=1 (re) Check traces: @@ -93,44 +93,44 @@ Check adding an object with HTTP profile to send CSV report: $ R "ba-cli 'BulkData.Profile.*.-'" > /dev/null - $ R "ba-cli 'BulkData.Profile.+{Alias="http-csv", EncodingType="CSV", Name="http-csv", Protocol="HTTP", Enable="false", ReportingInterval = 30}' | grep -v '>' | grep 'http-csv'" + $ R "ba-cli 'BulkData.Profile.+{Alias="http-csv", EncodingType="CSV", Name="http-csv", Protocol="HTTP", Enable="false", ReportingInterval = 30}' | grep -Ev '^(>|$)' | grep 'http-csv'" BulkData.Profile.[0-9]+.Alias="http-csv" (re) Check to update HTTP object: - $ R "ba-cli 'BulkData.Profile.http-csv.HTTP.URL="https://postman-echo.com/post/"' | grep -v '>' | grep '='" + $ R "ba-cli 'BulkData.Profile.http-csv.HTTP.URL="https://postman-echo.com/post/"' | grep -Ev '^(>|$)' | grep '='" BulkData.Profile.[0-9]+.HTTP.URL="https://postman-echo.com/post/" (re) - $ R "ba-cli 'BulkData.Profile.http-csv.HTTP.Method="POST"' | grep -v '>' | grep '='" + $ R "ba-cli 'BulkData.Profile.http-csv.HTTP.Method="POST"' | grep -Ev '^(>|$)' | grep '='" BulkData.Profile.[0-9]+.HTTP.Method="POST" (re) - $ R "ba-cli 'BulkData.Profile.http-csv.HTTP.UseDateHeader=1' | grep -v '>' | grep '='" + $ R "ba-cli 'BulkData.Profile.http-csv.HTTP.UseDateHeader=1' | grep -Ev '^(>|$)' | grep '='" BulkData.Profile.[0-9]+.HTTP.UseDateHeader=1 (re) - $ R "ba-cli 'BulkData.Profile.http-csv.CSVEncoding.EscapeCharacter="\""' | grep -v '>' | grep '='" + $ R "ba-cli 'BulkData.Profile.http-csv.CSVEncoding.EscapeCharacter="\""' | grep -Ev '^(>|$)' | grep '='" BulkData.Profile.[0-9]+.CSVEncoding.EscapeCharacter=""" (re) - $ R "ba-cli 'BulkData.Profile.http-csv.CSVEncoding.FieldSeparator=\"\,\"' | grep -v '>' | grep '='" + $ R "ba-cli 'BulkData.Profile.http-csv.CSVEncoding.FieldSeparator=\"\,\"' | grep -Ev '^(>|$)' | grep '='" BulkData.Profile.[0-9]+.CSVEncoding.FieldSeparator="," (re) - $ R "ba-cli 'BulkData.Profile.http-csv.CSVEncoding.ReportFormat="ParameterPerRow"' | grep -v '>' | grep '='" + $ R "ba-cli 'BulkData.Profile.http-csv.CSVEncoding.ReportFormat="ParameterPerRow"' | grep -Ev '^(>|$)' | grep '='" BulkData.Profile.[0-9]+.CSVEncoding.ReportFormat="ParameterPerRow" (re) - $ R "ba-cli 'BulkData.Profile.http-csv.CSVEncoding.RowSeparator=\" \"' | grep -v '>' | grep '='" + $ R "ba-cli 'BulkData.Profile.http-csv.CSVEncoding.RowSeparator=\" \"' | grep -Ev '^(>|$)' | grep '='" BulkData.Profile.[0-9]+.CSVEncoding.RowSeparator=" " (re) - $ R "ba-cli 'BulkData.Profile.http-csv.CSVEncoding.RowTimestamp="Unix-Epoch"' | grep -v '>' | grep '='" + $ R "ba-cli 'BulkData.Profile.http-csv.CSVEncoding.RowTimestamp="Unix-Epoch"' | grep -Ev '^(>|$)' | grep '='" BulkData.Profile.[0-9]+.CSVEncoding.RowTimestamp="Unix-Epoch" (re) Check adding a parameter to be sent in the report: - $ R "ba-cli 'BulkData.Profile.http-csv.Parameter.+{Name="Contacts", Reference="Phonebook.Contact."}' | grep -v '>' | grep '.'" + $ R "ba-cli 'BulkData.Profile.http-csv.Parameter.+{Name="Contacts", Reference="Phonebook.Contact."}' | grep -Ev '^(>|$)' | grep '.'" BulkData.Profile.[0-9]+.Parameter.[0-9]+. (re) Check after enabling the configured profile: $ sleep 5 # wait for object creation - $ R "ba-cli 'BulkData.Profile.http-csv.Enable="true"' | grep -v '>' | grep '='" + $ R "ba-cli 'BulkData.Profile.http-csv.Enable="true"' | grep -Ev '^(>|$)' | grep '='" BulkData.Profile.[0-9]+.Enable=1 (re) Check traces: @@ -143,26 +143,26 @@ Check adding an object with MQTT profile: $ R "ba-cli 'BulkData.Profile.*.-'" > /dev/null - $ R "ba-cli 'BulkData.Profile.+{Alias="mqtt-json", EncodingType="JSON", Name="mqtt-json", Protocol="USPEventNotif", Enable="false", ReportingInterval = 10}' | grep -v '>' | grep 'mqtt-json'" + $ R "ba-cli 'BulkData.Profile.+{Alias="mqtt-json", EncodingType="JSON", Name="mqtt-json", Protocol="USPEventNotif", Enable="false", ReportingInterval = 10}' | grep -Ev '^(>|$)' | grep 'mqtt-json'" BulkData.Profile.[0-9]+.Alias="mqtt-json" (re) Check to update JSON object: - $ R "ba-cli 'BulkData.Profile.mqtt-json.JSONEncoding.ReportFormat="ObjectHierarchy"' | grep -v '>' | grep '='" + $ R "ba-cli 'BulkData.Profile.mqtt-json.JSONEncoding.ReportFormat="ObjectHierarchy"' | grep -Ev '^(>|$)' | grep '='" BulkData.Profile.[0-9]+.JSONEncoding.ReportFormat="ObjectHierarchy" (re) - $ R "ba-cli 'BulkData.Profile.mqtt-json.JSONEncoding.ReportTimestamp="Unix-Epoch"' | grep -v '>' | grep '='" + $ R "ba-cli 'BulkData.Profile.mqtt-json.JSONEncoding.ReportTimestamp="Unix-Epoch"' | grep -Ev '^(>|$)' | grep '='" BulkData.Profile.[0-9]+.JSONEncoding.ReportTimestamp="Unix-Epoch" (re) Check adding a parameter to be sent in the report: - $ R "ba-cli 'BulkData.Profile.mqtt-json.Parameter.+{Name="Contacts", Reference="Phonebook.Contact."}' | grep -v '>' | grep '.'" + $ R "ba-cli 'BulkData.Profile.mqtt-json.Parameter.+{Name="Contacts", Reference="Phonebook.Contact."}' | grep -Ev '^(>|$)' | grep '.'" BulkData.Profile.[0-9]+.Parameter.[0-9]+. (re) Check after enabling the configured profile: $ sleep 5 # wait for object creation - $ R "ba-cli 'BulkData.Profile.mqtt-json.Enable="true"' | grep -v '>' | grep '='" + $ R "ba-cli 'BulkData.Profile.mqtt-json.Enable="true"' | grep -Ev '^(>|$)' | grep '='" BulkData.Profile.[0-9]+.Enable=1 (re) Check traces: diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/123-bulkdata-profile-mqtt.t b/.gitlab/tests/cram/generic/acceleration-plan-components/123-bulkdata-profile-mqtt.t index e4be2263ce..2a268af026 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/123-bulkdata-profile-mqtt.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/123-bulkdata-profile-mqtt.t @@ -42,7 +42,7 @@ Disable time synchronization and restart tr181-bulkdata to test BulkData module Enable BulkData and check object status: - $ R "ba-cli 'Device.BulkData.Enable=1' | grep -v '>' | grep 'Enable'" + $ R "ba-cli 'Device.BulkData.Enable=1' | grep -Ev '^(>|$)' | grep 'Enable'" Device.BulkData.Enable=1 $ R "ba-cli 'Device.BulkData.Status?' | grep '='" @@ -50,7 +50,7 @@ Enable BulkData and check object status: Create MQTT client: - $ R "ba-cli 'Device.MQTT.Client.+{Alias=\"local_broker\", BrokerAddress=\"127.0.0.1\", Enable=\"true\"}' | grep -v '>' | grep 'local_broker'" + $ R "ba-cli 'Device.MQTT.Client.+{Alias=\"local_broker\", BrokerAddress=\"127.0.0.1\", Enable=\"true\"}' | grep -Ev '^(>|$)' | grep 'local_broker'" Device.MQTT.Client.[0-9]+.Alias="local_broker" (re) $ sleep 1 # Wait for MQTT client to connect and subscribe @@ -64,20 +64,20 @@ Check MQTT client connection status: Create MQTT profile: - $ R "ba-cli 'Device.BulkData.Profile.+{Alias=\"mqtt_profile\", EncodingType=\"JSON\", Protocol=\"MQTT\", Enable=\"false\", ReportingInterval = 5}' | grep -v '>' | grep 'mqtt_profile'" + $ R "ba-cli 'Device.BulkData.Profile.+{Alias=\"mqtt_profile\", EncodingType=\"JSON\", Protocol=\"MQTT\", Enable=\"false\", ReportingInterval = 5}' | grep -Ev '^(>|$)' | grep 'mqtt_profile'" Device.BulkData.Profile.[0-9]+.Alias="mqtt_profile" (re) Set the MQTT parameters: - $ R "ba-cli 'Device.BulkData.Profile.mqtt_profile.MQTT.PublishTopic=\"bulkdata/mqtt_profile\"' | grep -v '>' | grep 'PublishTopic'" + $ R "ba-cli 'Device.BulkData.Profile.mqtt_profile.MQTT.PublishTopic=\"bulkdata/mqtt_profile\"' | grep -Ev '^(>|$)' | grep 'PublishTopic'" Device.BulkData.Profile.[0-9]+.MQTT.PublishTopic="bulkdata/mqtt_profile" (re) - $ R "ba-cli 'Device.BulkData.Profile.mqtt_profile.MQTT.Reference=\"Device.MQTT.Client.local_broker.\"' | grep -v '>' | grep 'Reference'" + $ R "ba-cli 'Device.BulkData.Profile.mqtt_profile.MQTT.Reference=\"Device.MQTT.Client.local_broker.\"' | grep -Ev '^(>|$)' | grep 'Reference'" Device.BulkData.Profile.[0-9]+.MQTT.Reference="Device.MQTT.Client.local_broker." (re) Add new parameters to collect: - $ R "ba-cli 'Device.BulkData.Profile.mqtt_profile.Parameter.+{Name=\"SN\", Reference=\"DeviceInfo.SerialNumber\"}' | grep -v '>' | grep 'Parameter'" + $ R "ba-cli 'Device.BulkData.Profile.mqtt_profile.Parameter.+{Name=\"SN\", Reference=\"DeviceInfo.SerialNumber\"}' | grep -Ev '^(>|$)' | grep 'Parameter'" Device.BulkData.Profile.[0-9]+.Parameter.[0-9]+. (re) Start mosquitto_sub in the background to listen for published messages: @@ -89,7 +89,7 @@ Start mosquitto_sub in the background to listen for published messages: Enable the mqtt profile: - $ R "ba-cli 'Device.BulkData.Profile.mqtt_profile.Enable=\"true\"' | grep -v '>' | grep '='" + $ R "ba-cli 'Device.BulkData.Profile.mqtt_profile.Enable=\"true\"' | grep -Ev '^(>|$)' | grep '='" Device.BulkData.Profile.[0-9]+.Enable=1 (re) Wait for 6 seconds: diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/130-periodicfileupload.t b/.gitlab/tests/cram/generic/acceleration-plan-components/130-periodicfileupload.t index e6eccb3da8..6caec31883 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/130-periodicfileupload.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/130-periodicfileupload.t @@ -18,7 +18,7 @@ Check PeriodicFileTransfer profile creation in the data model: $ R "ba-cli 'Device.PeriodicFileTransfer.Profile+{Alias=\"cram-Profile-1\"}'" > /dev/null $ R "ba-cli 'Device.PeriodicFileTransfer.Profile.cram-Profile-1.HTTP.URL=\"http://$SERVER_IP:8181\"'" > /dev/null $ R 'ba-cli "Device.PeriodicFileTransfer.Profile.cram-Profile-1.HTTP.Compression=\"None\""' > /dev/null; sleep 1 - $ R 'ba-cli "Device.PeriodicFileTransfer.Profile.cram-Profile-1.?"' | grep -v '>' + $ R 'ba-cli "Device.PeriodicFileTransfer.Profile.cram-Profile-1.?"' | grep -Ev '^(>|$)' Device.PeriodicFileTransfer.Profile.(.+). (re) Device.PeriodicFileTransfer.Profile.(.+).Alias="cram-Profile-1" (re) Device.PeriodicFileTransfer.Profile.(.+).Name="" (re) @@ -37,14 +37,13 @@ Check PeriodicFileTransfer profile creation in the data model: Device.PeriodicFileTransfer.Profile.(.+).HTTP.RetryMinimumWaitInterval=5 (re) Device.PeriodicFileTransfer.Profile.(.+).HTTP.URL="http://(.*):8181" (re) Device.PeriodicFileTransfer.Profile.(.+).HTTP.Username="" (re) - Check PeriodicFileTransfer transfer instance creation: $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.+{Alias=\"cram-Transfer-1\", ProfileReference=\"Device.PeriodicFileTransfer.Profile.cram-Profile-1\", Type=\"KernelFaults\"}"' > /dev/null $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.UploadInterval=3600"' > /dev/null $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.Enable=1"' > /dev/null; sleep 1 - $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.?0"' | grep -v '>' + $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.?0"' | grep -Ev '^(>|$)' Device.PeriodicFileTransfer.Transfer.(.+). (re) Device.PeriodicFileTransfer.Transfer.(.+).Alias="cram-Transfer-1" (re) Device.PeriodicFileTransfer.Transfer.(.+).Enable=1 (re) @@ -57,37 +56,33 @@ Check PeriodicFileTransfer transfer instance creation: Device.PeriodicFileTransfer.Transfer.(.+).Type="KernelFaults" (re) Device.PeriodicFileTransfer.Transfer.(.+).UploadInterval=3600 (re) Device.PeriodicFileTransfer.Transfer.(.+).X_PRPLWARE-COM_ForceTransfer=0 (re) - Check PeriodicFileTransfer on demand file upload: - $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.ForceTransfer()"' | grep -v '>'; sleep 1 + $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.ForceTransfer()"' | grep -Ev '^(>|$)'; sleep 1 Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.ForceTransfer() returned [ { data = "Transfer ended with error code (0)" } ] - $ ls /tmp/130-periodicfileuploads/; rm /tmp/130-periodicfileuploads/* oops.tar Check PeriodicFileTransfer on demand file upload with GZIP compression: - $ R 'ba-cli "Device.PeriodicFileTransfer.Profile.cram-Profile-1.HTTP.Compression=GZIP"' | grep -v '>'; sleep 1 + $ R 'ba-cli "Device.PeriodicFileTransfer.Profile.cram-Profile-1.HTTP.Compression=GZIP"' | grep -Ev '^(>|$)'; sleep 1 Device.PeriodicFileTransfer.Profile.(.+).HTTP. (re) Device.PeriodicFileTransfer.Profile.(.+).HTTP.Compression="GZIP" (re) - - $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.ForceTransfer()"' | grep -v '>' + $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.ForceTransfer()"' | grep -Ev '^(>|$)' Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.ForceTransfer() returned [ { data = "Transfer ended with error code (0)" } ] - $ ls /tmp/130-periodicfileuploads/; rm /tmp/130-periodicfileuploads/* oops.tar @@ -96,10 +91,9 @@ Check PeriodicFileTransfer on demand file upload with GZIP compression: Check PeriodicFileTransfer periodic upload with configured intervals $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.Enable=0"' > /dev/null - $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.UploadInterval=3"' | grep -v '>'; sleep 1 + $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.UploadInterval=3"' | grep -Ev '^(>|$)'; sleep 1 Device.PeriodicFileTransfer.Transfer.(.+). (re) Device.PeriodicFileTransfer.Transfer.(.+).UploadInterval=3 (re) - $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.Enable=1"' > /dev/null; sleep 7 $ ls /tmp/130-periodicfileuploads/ |wc -l ; rm /tmp/130-periodicfileuploads/* 2 @@ -113,7 +107,7 @@ Check PeriodicFileTransfer retry mechanism for failed uploads: $ R 'ba-cli "Device.PeriodicFileTransfer.Profile.cram-Profile-1.HTTP.RetryIntervalMultiplier=2000"' > /dev/null $ R 'ba-cli "Device.PeriodicFileTransfer.Profile.cram-Profile-1.HTTP.RetryMinimumWaitInterval=3"' > /dev/null $ R 'ba-cli "Device.PeriodicFileTransfer.Profile.cram-Profile-1.HTTP.RetryEnable=1"' > /dev/null; sleep 1 - $ R 'ba-cli "Device.PeriodicFileTransfer.Profile.cram-Profile-1.?"' | grep -v '>' + $ R 'ba-cli "Device.PeriodicFileTransfer.Profile.cram-Profile-1.?"' | grep -Ev '^(>|$)' Device.PeriodicFileTransfer.Profile.(.+). (re) Device.PeriodicFileTransfer.Profile.(.+).Alias="cram-Profile-1" (re) Device.PeriodicFileTransfer.Profile.(.+).Name="" (re) @@ -132,11 +126,9 @@ Check PeriodicFileTransfer retry mechanism for failed uploads: Device.PeriodicFileTransfer.Profile.(.+).HTTP.RetryMinimumWaitInterval=3 (re) Device.PeriodicFileTransfer.Profile.(.+).HTTP.URL="http://(.*):8181" (re) Device.PeriodicFileTransfer.Profile.(.+).HTTP.Username="" (re) - $ sleep 2 - $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.Status?0"' | grep -v '>' + $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.Status?0"' | grep -Ev '^(>|$)' Device.PeriodicFileTransfer.Transfer.(.+).Status="Retrying" (re) - $ servefile -u /tmp/130-periodicfileuploads/ -p 8181 >/dev/null 2>&1 & $ servefile_pid="$!" $ sleep 6 @@ -157,14 +149,13 @@ Check PeriodicFileTransfer over HTTPS: $ R 'ba-cli "Device.PeriodicFileTransfer.Profile.cram-Profile-1.Protocol=HTTPS"' > /dev/null; sleep 1 $ R 'ba-cli "Device.PeriodicFileTransfer.Profile.cram-Profile-1.HTTP.CABundle=Device.Security.CABundle.cram"' > /dev/null; sleep 1 $ R "ba-cli 'Device.PeriodicFileTransfer.Profile.cram-Profile-1.HTTP.URL=\"https://$SERVER_IP:8181\"'" > /dev/null; sleep 1 - $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.ForceTransfer()"' | grep -v '>' ; sleep 1 + $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.ForceTransfer()"' | grep -Ev '^(>|$)' ; sleep 1 Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.ForceTransfer() returned [ { data = "Transfer ended with error code (0)" } ] - Check PeriodicFileTransfer error code reporting for various failure scenarios: @@ -172,7 +163,7 @@ Check PeriodicFileTransfer error code reporting for various failure scenarios: $ R 'ba-cli "Device.PeriodicFileTransfer.Profile.cram-Profile-1.Protocol=HTTP"' > /dev/null; sleep 1 $ R 'ba-cli "Device.PeriodicFileTransfer.Profile.cram-Profile-1.HTTP.CABundle="' > /dev/null; sleep 1 $ R "ba-cli 'Device.PeriodicFileTransfer.Profile.cram-Profile-1.HTTP.URL=\"http://$SERVER_IP:8181\"'" > /dev/null; sleep 1 - $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.ForceTransfer()"' | grep -v '>' + $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.ForceTransfer()"' | grep -Ev '^(>|$)' ERROR: call (null) failed with status 1 - unknown error Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.ForceTransfer() returned [ @@ -180,11 +171,10 @@ Check PeriodicFileTransfer error code reporting for various failure scenarios: data = "Transfer ended with error code (9015)" } ] - $ servefile -u /tmp/130-periodicfileuploads/ -p 8181 -a prpl:prpl >/dev/null 2>&1 & $ servefile_pid="$!" $ sleep 1 - $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.ForceTransfer()"' | grep -v '>'; sleep 1 + $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.ForceTransfer()"' | grep -Ev '^(>|$)'; sleep 1 ERROR: call (null) failed with status 1 - unknown error Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.ForceTransfer() returned [ @@ -192,14 +182,13 @@ Check PeriodicFileTransfer error code reporting for various failure scenarios: data = "Transfer ended with error code (9012)" } ] - $ kill -9 "$servefile_pid" $ servefile -u /tmp/130-periodicfileuploads/ -p 8181 --ssl >/dev/null 2>&1 & $ servefile_pid="$!" $ sleep 1 $ R 'ba-cli "Device.PeriodicFileTransfer.Profile.cram-Profile-1.Protocol=HTTPS"' > /dev/null; sleep 1 $ R "ba-cli 'Device.PeriodicFileTransfer.Profile.cram-Profile-1.HTTP.URL=\"https://$SERVER_IP:8181\"'" > /dev/null; sleep 1 - $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.ForceTransfer()"' | grep -v '>'; sleep 1 + $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.ForceTransfer()"' | grep -Ev '^(>|$)'; sleep 1 ERROR: call (null) failed with status 1 - unknown error Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.ForceTransfer() returned [ @@ -207,7 +196,6 @@ Check PeriodicFileTransfer error code reporting for various failure scenarios: data = "Transfer ended with error code (9003)" } ] - Cleanup test instances: diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/130-power-management-ethernet.t b/.gitlab/tests/cram/generic/acceleration-plan-components/130-power-management-ethernet.t index 851b483578..515460a454 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/130-power-management-ethernet.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/130-power-management-ethernet.t @@ -23,23 +23,22 @@ Check read-only parameters: Check ChangePowerMode function: - $ alias=$(R "ba-cli 'Ethernet.Interface.1.PowerCapability?' | grep -v '>' | grep 'PowerCapability'| sed -E 's/.*PowerCapability=\"([^\"]+)\"/\1/'") + $ alias=$(R "ba-cli 'Ethernet.Interface.1.PowerCapability?' | grep -Ev '^(>|$)' | grep 'PowerCapability'| sed -E 's/.*PowerCapability=\"([^\"]+)\"/\1/'") $ first=${alias%%,*} - $ R "ba-cli 'Ethernet.Interface.1.ChangePowerMode(PowerState = \"$first\")' | grep -v '>'" + $ R "ba-cli 'Ethernet.Interface.1.ChangePowerMode(PowerState = \"$first\")' | grep -Ev '^(>|$)'" Ethernet.Interface.1.ChangePowerMode() returned [ "" ] - Check invalid value for ChangePowerMode function: - $ R "ba-cli 'Ethernet.Interface.1.ChangePowerMode(PowerState = "InvalidState")' | grep -v '>' | grep 'ERROR'" + $ R "ba-cli 'Ethernet.Interface.1.ChangePowerMode(PowerState = "InvalidState")' | grep -Ev '^(>|$)' | grep 'ERROR'" ERROR: call (null) failed with status 1 - unknown error Check PowerStatus after ChangePowerMode: - $ status=$(R "ba-cli 'Ethernet.Interface.1.PowerStatus?' | grep -v '>' | sed -E 's/.*PowerStatus=\"([^\"]+)\".*/\1/'") + $ status=$(R "ba-cli 'Ethernet.Interface.1.PowerStatus?' | grep -Ev '^(>|$)' | sed -E 's/.*PowerStatus=\"([^\"]+)\".*/\1/'") $ if [ "$status" = "$first" ]; then > echo "PowerStatus has been updated successfully" diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/131-power-management-usb.t b/.gitlab/tests/cram/generic/acceleration-plan-components/131-power-management-usb.t index 1e76fa7c8c..c0e84e32aa 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/131-power-management-usb.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/131-power-management-usb.t @@ -23,23 +23,22 @@ Check read-only parameters: Check ChangePowerMode function: - $ alias=$(R "ba-cli 'USB.Port.1.PowerCapability?' | grep -v '>' | grep 'PowerCapability'| sed -E 's/.*PowerCapability=\"([^\"]+)\"/\1/'") + $ alias=$(R "ba-cli 'USB.Port.1.PowerCapability?' | grep -Ev '^(>|$)' | grep 'PowerCapability'| sed -E 's/.*PowerCapability=\"([^\"]+)\"/\1/'") $ first=${alias%%,*} - $ R "ba-cli 'USB.Port.1.ChangePowerMode(PowerState = \"$first\")' | grep -v '>'" + $ R "ba-cli 'USB.Port.1.ChangePowerMode(PowerState = \"$first\")' | grep -Ev '^(>|$)'" USB.Port.1.ChangePowerMode() returned [ "" ] - Check invalid value for ChangePowerMode function: - $ R "ba-cli 'USB.Port.1.ChangePowerMode(PowerState = "InvalidState")' | grep -v '>' | grep 'ERROR'" + $ R "ba-cli 'USB.Port.1.ChangePowerMode(PowerState = "InvalidState")' | grep -Ev '^(>|$)' | grep 'ERROR'" ERROR: call (null) failed with status 10 - invalid value Check PowerStatus after ChangePowerMode: - $ status=$(R "ba-cli 'USB.Port.1.PowerStatus?' | grep -v '>' | sed -E 's/.*PowerStatus=\"([^\"]+)\".*/\1/'") + $ status=$(R "ba-cli 'USB.Port.1.PowerStatus?' | grep -Ev '^(>|$)' | sed -E 's/.*PowerStatus=\"([^\"]+)\".*/\1/'") $ if [ "$status" = "$first" ]; then > echo "PowerStatus has been updated successfully" diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/135-powerstatus.t b/.gitlab/tests/cram/generic/acceleration-plan-components/135-powerstatus.t index 5c0d2b7a6c..41ea561328 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/135-powerstatus.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/135-powerstatus.t @@ -18,12 +18,12 @@ Add a dummy PowerSensor instance and restart the tr181-powerstatus service: Check the current number of PowerSensor instances: - $ R "ba-cli 'PowerStatus.PowerSensorNumberOfEntries?' | grep -v '>' | grep '='" + $ R "ba-cli 'PowerStatus.PowerSensorNumberOfEntries?' | grep -Ev '^(>|$)' | grep '='" PowerStatus.PowerSensorNumberOfEntries=[0-9]+ (re) Check the dummy PowerSensor instance: - $ R "ba-cli 'PowerStatus.PowerSensor.[Alias==\"dummy-sensor\"].?' | grep -v '>' | grep '=' | sort" + $ R "ba-cli 'PowerStatus.PowerSensor.[Alias==\"dummy-sensor\"].?' | grep -Ev '^(>|$)' | grep '=' | sort" PowerStatus.PowerSensor.[0-9]+.Alias="dummy-sensor" (re) PowerStatus.PowerSensor.[0-9]+.Current=0 (re) PowerStatus.PowerSensor.[0-9]+.Enable=0 (re) @@ -35,7 +35,7 @@ Check the dummy PowerSensor instance: Disable the dummy PowerSensor instance: - $ R "ba-cli 'PowerStatus.PowerSensor.[Alias==\"dummy-sensor\"].Enable=0' | grep -v '>' | grep '='" + $ R "ba-cli 'PowerStatus.PowerSensor.[Alias==\"dummy-sensor\"].Enable=0' | grep -Ev '^(>|$)' | grep '='" PowerStatus.PowerSensor.[0-9]+.Enable=0 (re) Check the status of dummy PowerSensor instance: @@ -45,7 +45,7 @@ Check the status of dummy PowerSensor instance: Enable the dummy PowerSensor instance: - $ R "ba-cli 'PowerStatus.PowerSensor.[Alias==\"dummy-sensor\"].Enable=1' | grep -v '>' | grep '='" + $ R "ba-cli 'PowerStatus.PowerSensor.[Alias==\"dummy-sensor\"].Enable=1' | grep -Ev '^(>|$)' | grep '='" PowerStatus.PowerSensor.[0-9]+.Enable=1 (re) Check the status of dummy PowerSensor instance: @@ -61,13 +61,13 @@ Create a mock power file and verify the sensor becomes enabled: Configure protected parameters and enable the sensor: - $ R "ba-cli 'PowerStatus.PowerSensor.[Alias==\"dummy-sensor\"].PowerPath=\"/tmp/mock_power\"' | grep -v '>' | grep '='" + $ R "ba-cli 'PowerStatus.PowerSensor.[Alias==\"dummy-sensor\"].PowerPath=\"/tmp/mock_power\"' | grep -Ev '^(>|$)' | grep '='" PowerStatus.PowerSensor.[0-9]+.PowerPath="/tmp/mock_power" (re) - $ R "ba-cli 'PowerStatus.PowerSensor.[Alias==\"dummy-sensor\"].PollingInterval=1' | grep -v '>' | grep '='" + $ R "ba-cli 'PowerStatus.PowerSensor.[Alias==\"dummy-sensor\"].PollingInterval=1' | grep -Ev '^(>|$)' | grep '='" PowerStatus.PowerSensor.[0-9]+.PollingInterval=1 (re) - $ R "ba-cli 'PowerStatus.PowerSensor.[Alias==\"dummy-sensor\"].Enable=1' | grep -v '>' | grep '='" + $ R "ba-cli 'PowerStatus.PowerSensor.[Alias==\"dummy-sensor\"].Enable=1' | grep -Ev '^(>|$)' | grep '='" PowerStatus.PowerSensor.[0-9]+.Enable=1 (re) Check the status of dummy PowerSensor instance: diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/150-deviceinfostats.t b/.gitlab/tests/cram/generic/acceleration-plan-components/150-deviceinfostats.t index c263d82e76..b9d373386a 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/150-deviceinfostats.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/150-deviceinfostats.t @@ -4,7 +4,7 @@ Create R alias: Check GetBusStats() function: - $ R "ba-cli 'DeviceInfo.GetBusStats()' | grep -v '>'" + $ R "ba-cli 'DeviceInfo.GetBusStats()' | grep -Ev '^(>|$)'" DeviceInfo.GetBusStats() returned [ { @@ -102,7 +102,6 @@ Check GetBusStats() function: } } ] - Check stats after doing an action: diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/154-tr181-schedules.t b/.gitlab/tests/cram/generic/acceleration-plan-components/154-tr181-schedules.t index bc53b1b001..5d031a28ca 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/154-tr181-schedules.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/154-tr181-schedules.t @@ -51,13 +51,13 @@ Check that we have expected datamodel: Verify ScheduleNumberOfEntries is updated correctly: - $ R "ba-cli Device.Schedules.ScheduleNumberOfEntries?" | tail -n +2 | head -n -1 + $ R "ba-cli Device.Schedules.ScheduleNumberOfEntries?" | grep -Ev '^(>|$)' Device.Schedules.ScheduleNumberOfEntries=2 Verify all Schedules.Schedule.*.Status parameters are set to StackDisabled $ R "ba-cli Device.Schedules.Enable=0" > /dev/null 2>&1 - $ R "ba-cli Device.Schedules.Schedule.*.Status?" | tail -n +2 | sed -E 's/\.Schedule\.[0-9]+\./.Schedule.X./' | head -n -1 + $ R "ba-cli Device.Schedules.Schedule.*.Status?" | grep -Ev '^(>|$)' | sed -E 's/\.Schedule\.[0-9]+\./.Schedule.X./' Device.Schedules.Schedule.X.Status="StackDisabled" Device.Schedules.Schedule.X.Status="StackDisabled" @@ -65,7 +65,7 @@ Verify all Schedules.Schedule.*.Status parameters are set to Disabled $ R "ba-cli Device.Schedules.Enable=1" > /dev/null 2>&1 $ R "ba-cli Device.Schedules.Schedule.*.Enable=0" > /dev/null 2>&1 - $ R "ba-cli Device.Schedules.Schedule.*.Status?" | tail -n +2 | sed -E 's/\.Schedule\.[0-9]+\./.Schedule.X./' | head -n -1 + $ R "ba-cli Device.Schedules.Schedule.*.Status?" | grep -Ev '^(>|$)' | sed -E 's/\.Schedule\.[0-9]+\./.Schedule.X./' Device.Schedules.Schedule.X.Status="X_PRPLWARE-COM_Disabled" Device.Schedules.Schedule.X.Status="X_PRPLWARE-COM_Disabled" @@ -76,12 +76,11 @@ Test InverseMode functionality: $ R "ba-cli ${SCHEDULE_PATH_WH}.InverseMode?" * (glob) Device.Schedules.Schedule.*.InverseMode=0 (glob) - * (glob) Verify initial status and TimeLeft (InverseMode=0): - $ INITIAL_STATUS=$(R "ba-cli ${SCHEDULE_PATH_WH}.Status?" | tail -n +2 | head -n -1 | cut -d= -f2 | tr -d '"') - $ INITIAL_TIMELEFT=$(R "ba-cli ${SCHEDULE_PATH_WH}.TimeLeft?" | tail -n +2 | head -n -1 | cut -d= -f2) + $ INITIAL_STATUS=$(R "ba-cli ${SCHEDULE_PATH_WH}.Status?" | grep -Ev '^(>|$)' | cut -d= -f2 | tr -d '"') + $ INITIAL_TIMELEFT=$(R "ba-cli ${SCHEDULE_PATH_WH}.TimeLeft?" | grep -Ev '^(>|$)' | cut -d= -f2) $ [ ${INITIAL_TIMELEFT} -ge 0 ] Enable InverseMode and verify status changes: @@ -90,11 +89,10 @@ Enable InverseMode and verify status changes: $ R "ba-cli ${SCHEDULE_PATH_WH}.InverseMode?" * (glob) Device.Schedules.Schedule.*.InverseMode=1 (glob) - * (glob) Verify status is inverted: - $ INVERSE_STATUS=$(R "ba-cli ${SCHEDULE_PATH_WH}.Status?" | tail -n +2 | head -n -1 | cut -d= -f2 | tr -d '"') + $ INVERSE_STATUS=$(R "ba-cli ${SCHEDULE_PATH_WH}.Status?" | grep -Ev '^(>|$)' | cut -d= -f2 | tr -d '"') $ [ "${INITIAL_STATUS}" != "${INVERSE_STATUS}" ] Disable InverseMode again: @@ -106,28 +104,27 @@ Test Duration and TimeLeft: $ R "ba-cli ${SCHEDULE_PATH_WH}.Duration?" * (glob) Device.Schedules.Schedule.*.Duration=32400 (glob) - * (glob) Verify TimeLeft is a non-negative integer: - $ TIMELEFT=$(R "ba-cli ${SCHEDULE_PATH_WH}.TimeLeft?" | tail -n +2 | head -n -1 | cut -d= -f2) + $ TIMELEFT=$(R "ba-cli ${SCHEDULE_PATH_WH}.TimeLeft?" | grep -Ev '^(>|$)' | cut -d= -f2) $ [ ${TIMELEFT} -ge 0 ] Verify TimeLeft changes over time: $ sleep 2 - $ TIMELEFT2=$(R "ba-cli ${SCHEDULE_PATH_WH}.TimeLeft?" | tail -n +2 | head -n -1 | cut -d= -f2) + $ TIMELEFT2=$(R "ba-cli ${SCHEDULE_PATH_WH}.TimeLeft?" | grep -Ev '^(>|$)' | cut -d= -f2) $ [ ${TIMELEFT2} -ge 0 ] Verify TimeLeft is within valid range (0 to Duration): - $ TIMELEFT_ACTUAL=$(R "ba-cli ${SCHEDULE_PATH_WH}.TimeLeft?" | tail -n +2 | head -n -1 | cut -d= -f2) - $ DURATION=$(R "ba-cli ${SCHEDULE_PATH_WH}.Duration?" | tail -n +2 | head -n -1 | cut -d= -f2) + $ TIMELEFT_ACTUAL=$(R "ba-cli ${SCHEDULE_PATH_WH}.TimeLeft?" | grep -Ev '^(>|$)' | cut -d= -f2) + $ DURATION=$(R "ba-cli ${SCHEDULE_PATH_WH}.Duration?" | grep -Ev '^(>|$)' | cut -d= -f2) $ [ ${TIMELEFT_ACTUAL} -ge 0 ] && [ ${TIMELEFT_ACTUAL} -le $((DURATION + 86400)) ] Test Schedule deletion and cleanup: - $ R "ba-cli Device.Schedules.ScheduleNumberOfEntries?" | tail -n +2 | head -n -1 + $ R "ba-cli Device.Schedules.ScheduleNumberOfEntries?" | grep -Ev '^(>|$)' Device.Schedules.ScheduleNumberOfEntries=2 Delete the first schedule: @@ -136,7 +133,7 @@ Delete the first schedule: Verify ScheduleNumberOfEntries is decremented: - $ R "ba-cli Device.Schedules.ScheduleNumberOfEntries?" | tail -n +2 | head -n -1 + $ R "ba-cli Device.Schedules.ScheduleNumberOfEntries?" | grep -Ev '^(>|$)' Device.Schedules.ScheduleNumberOfEntries=1 Delete the remaining schedule: @@ -145,5 +142,5 @@ Delete the remaining schedule: Verify ScheduleNumberOfEntries is now 0: - $ R "ba-cli Device.Schedules.ScheduleNumberOfEntries?" | tail -n +2 | head -n -1 + $ R "ba-cli Device.Schedules.ScheduleNumberOfEntries?" | grep -Ev '^(>|$)' Device.Schedules.ScheduleNumberOfEntries=0 diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/155-tr181-schedules-hosts.t b/.gitlab/tests/cram/generic/acceleration-plan-components/155-tr181-schedules-hosts.t index dd93c5c6c6..5774c46d4f 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/155-tr181-schedules-hosts.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/155-tr181-schedules-hosts.t @@ -48,7 +48,7 @@ Check AccessControl initial state: Find the LAN test device in Hosts datamodel: - $ R "ba-cli Device.Hosts.HostNumberOfEntries?" | tail -n +2 | head -n -1 + $ R "ba-cli Device.Hosts.HostNumberOfEntries?" | grep -Ev '^(>|$)' Device.Hosts.HostNumberOfEntries=\d+ (re) Get our LAN IP address from the LAN interface: @@ -57,12 +57,12 @@ Get our LAN IP address from the LAN interface: Get MAC address of this LAN test device from Hosts datamodel: - $ HOST_MAC=$(R "ba-cli 'Device.Hosts.Host.[IPAddress==\"${MY_IP}\"].PhysAddress?' | grep -v '^>' | grep -v '^root' | grep -v '^$' | head -1 | cut -d'=' -f2 | tr -d '\"'" 2>/dev/null) + $ HOST_MAC=$(R "ba-cli 'Device.Hosts.Host.[IPAddress==\"${MY_IP}\"].PhysAddress?' | grep -Ev '^(>|$)' | grep -v '^root' | grep -v '^$' | head -1 | cut -d'=' -f2 | tr -d '\"'" 2>/dev/null) Set PhysAddress for the AccessControl using the discovered MAC: $ R "ba-cli ${AC_PATH}.PhysAddress='${HOST_MAC}'" > /dev/null 2>&1 - $ R "ba-cli ${AC_PATH}.PhysAddress?" | tail -n +2 | head -n -1 + $ R "ba-cli ${AC_PATH}.PhysAddress?" | grep -Ev '^(>|$)' Device.Hosts.AccessControl.*.PhysAddress="([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}" (re) Verify baseline connectivity before access control: @@ -86,7 +86,7 @@ Link the schedule to AccessControl via ScheduleRef: Verify ScheduleRef is set: - $ R "ba-cli ${AC_PATH}.ScheduleRef?" | tail -n +2 | head -n -1 + $ R "ba-cli ${AC_PATH}.ScheduleRef?" | grep -Ev '^(>|$)' Device.Hosts.AccessControl.*.ScheduleRef="Device.Schedules.Schedule.*" (glob) Enable the AccessControl: @@ -113,12 +113,12 @@ Verify AccessControl is enabled with schedule: Check Schedule status: - $ R "ba-cli ${SCHED_PATH}.Status?" | tail -n +2 | head -n -1 + $ R "ba-cli ${SCHED_PATH}.Status?" | grep -Ev '^(>|$)' Device.Schedules.Schedule.*.Status="Active" (glob) Check Schedule TimeLeft: - $ TIMELEFT=$(R "ba-cli ${SCHED_PATH}.TimeLeft?" | tail -n +2 | head -n -1 | cut -d= -f2) + $ TIMELEFT=$(R "ba-cli ${SCHED_PATH}.TimeLeft?" | grep -Ev '^(>|$)' | cut -d= -f2) $ [ ${TIMELEFT} -ge 0 ] Test connectivity with AccessControl and Schedule enabled: @@ -129,10 +129,10 @@ Test connectivity with AccessControl and Schedule enabled: Test InverseMode effect on schedule and access: - $ INITIAL_STATUS=$(R "ba-cli ${SCHED_PATH}.Status?" | tail -n +2 | head -n -1 | cut -d= -f2 | tr -d '"') + $ INITIAL_STATUS=$(R "ba-cli ${SCHED_PATH}.Status?" | grep -Ev '^(>|$)' | cut -d= -f2 | tr -d '"') $ R "ba-cli ${SCHED_PATH}.InverseMode=1" > /dev/null 2>&1 $ sleep 5 - $ INVERSE_STATUS=$(R "ba-cli ${SCHED_PATH}.Status?" | tail -n +2 | head -n -1 | cut -d= -f2 | tr -d '"') + $ INVERSE_STATUS=$(R "ba-cli ${SCHED_PATH}.Status?" | grep -Ev '^(>|$)' | cut -d= -f2 | tr -d '"') $ [ "${INITIAL_STATUS}" != "${INVERSE_STATUS}" ] Test ping after InverseMode enabled (should be blocked): @@ -153,7 +153,7 @@ Reset InverseMode and verify connectivity restored: Change AccessPolicy to Deny and test: $ R "ba-cli ${AC_PATH}.AccessPolicy=Deny" > /dev/null 2>&1 - $ R "ba-cli ${AC_PATH}.AccessPolicy?" | tail -n +2 | head -n -1 + $ R "ba-cli ${AC_PATH}.AccessPolicy?" | grep -Ev '^(>|$)' Device.Hosts.AccessControl.*.AccessPolicy="Deny" (glob) $ sleep 5 @@ -173,12 +173,12 @@ Delete the schedule and verify cleanup: Verify ScheduleRef is cleared in AccessControl: - $ R "ba-cli ${AC_PATH}.ScheduleRef?" | tail -n +2 | head -n -1 + $ R "ba-cli ${AC_PATH}.ScheduleRef?" | grep -Ev '^(>|$)' Device.Hosts.AccessControl.*.ScheduleRef="" (glob) Verify ScheduleNumberOfEntries is back to 0: - $ R "ba-cli Device.Schedules.ScheduleNumberOfEntries?" | tail -n +2 | head -n -1 + $ R "ba-cli Device.Schedules.ScheduleNumberOfEntries?" | grep -Ev '^(>|$)' Device.Schedules.ScheduleNumberOfEntries=0 Cleanup - Delete the AccessControl entry: @@ -187,7 +187,7 @@ Cleanup - Delete the AccessControl entry: Verify AccessControlNumberOfEntries is decremented: - $ R "ba-cli Device.Hosts.AccessControlNumberOfEntries?" | tail -n +2 | head -n -1 + $ R "ba-cli Device.Hosts.AccessControlNumberOfEntries?" | grep -Ev '^(>|$)' Device.Hosts.AccessControlNumberOfEntries=0 Test if connectivity is back: @@ -195,4 +195,3 @@ Test if connectivity is back: $ R "iptables -L FORWARD_Hosts_Block -n | grep -ic ${HOST_MAC}" 0 [1] - diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/160-dhcpv6-forcesolicite.t b/.gitlab/tests/cram/generic/acceleration-plan-components/160-dhcpv6-forcesolicite.t index 24d9cfde37..fd3f28e5cc 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/160-dhcpv6-forcesolicite.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/160-dhcpv6-forcesolicite.t @@ -5,12 +5,12 @@ Create R alias: Check initial DHCPv6Client configuration: - $ R "ba-cli 'DHCPv6Client.Client.1.Enable?' | grep -v '>' | grep 'Enable'" + $ R "ba-cli 'DHCPv6Client.Client.1.Enable?' | grep -Ev '^(>|$)' | grep 'Enable'" DHCPv6Client.Client.1.Enable=1 Check current ForceSolicitPolicy value: - $ R "ba-cli 'DHCPv6Client.Client.1.X_PRPLWARE-COM_ForceSolicitPolicy?' | grep -v '>' | grep 'ForceSolicitPolicy'" + $ R "ba-cli 'DHCPv6Client.Client.1.X_PRPLWARE-COM_ForceSolicitPolicy?' | grep -Ev '^(>|$)' | grep 'ForceSolicitPolicy'" DHCPv6Client.Client.1.X_PRPLWARE-COM_ForceSolicitPolicy=0 Start tcpdump in background to capture DHCPv6 packets on testbed WAN interface: @@ -31,7 +31,7 @@ Enable ForceSolicitPolicy to trigger DHCPv6 Solicit message ( a restart of the c Verify the parameter was set correctly: - $ R "ba-cli 'DHCPv6Client.Client.1.X_PRPLWARE-COM_ForceSolicitPolicy?' | grep -v '>' | grep 'ForceSolicitPolicy'" + $ R "ba-cli 'DHCPv6Client.Client.1.X_PRPLWARE-COM_ForceSolicitPolicy?' | grep -Ev '^(>|$)' | grep 'ForceSolicitPolicy'" DHCPv6Client.Client.1.X_PRPLWARE-COM_ForceSolicitPolicy=1 Wait for DHCPv6 Solicit message to be sent and captured: @@ -53,5 +53,5 @@ Reset ForceSolicitPolicy to original value: Verify reset: - $ R "ba-cli 'DHCPv6Client.Client.1.X_PRPLWARE-COM_ForceSolicitPolicy?' | grep -v '>' | grep 'ForceSolicitPolicy'" + $ R "ba-cli 'DHCPv6Client.Client.1.X_PRPLWARE-COM_ForceSolicitPolicy?' | grep -Ev '^(>|$)' | grep 'ForceSolicitPolicy'" DHCPv6Client.Client.1.X_PRPLWARE-COM_ForceSolicitPolicy=0 diff --git a/.gitlab/tests/cram/generic/ba-cli-stdin.t b/.gitlab/tests/cram/generic/ba-cli-stdin.t new file mode 100644 index 0000000000..1b889be8cf --- /dev/null +++ b/.gitlab/tests/cram/generic/ba-cli-stdin.t @@ -0,0 +1,53 @@ +Create R alias: + + $ alias R="${CRAM_REMOTE_COMMAND:-}" + +Check that one-shot positional ba-cli commands do not consume inherited stdin: + + $ R " \ + > rm -f /tmp/test-ba-cli-stdin.out; \ + > printf '%s\n' 'BA_CLI_STDIN_SENTINEL' | ba-cli -- help > /tmp/test-ba-cli-stdin.out 2>&1; \ + > if grep -q 'BA_CLI_STDIN_SENTINEL' /tmp/test-ba-cli-stdin.out; then \ + > echo stdin-consumed; \ + > else \ + > echo stdin-preserved; \ + > fi \ + > " rm -f /tmp/test-ba-cli-open-stdin.fifo /tmp/test-ba-cli-open-stdin.out /tmp/test-ba-cli-open-stdin.rc; \ + > mkfifo /tmp/test-ba-cli-open-stdin.fifo; \ + > (sleep 5 > /tmp/test-ba-cli-open-stdin.fifo) & writer=\$!; \ + > (ba-cli -- help < /tmp/test-ba-cli-open-stdin.fifo > /tmp/test-ba-cli-open-stdin.out 2>&1; echo \$? > /tmp/test-ba-cli-open-stdin.rc) & cli=\$!; \ + > for _ in 1 2 3; do [ -s /tmp/test-ba-cli-open-stdin.rc ] && break; sleep 1; done; \ + > if [ ! -s /tmp/test-ba-cli-open-stdin.rc ]; then \ + > kill \$cli 2>/dev/null || true; \ + > echo positional-hung; \ + > else \ + > echo positional-exited; \ + > fi; \ + > kill \$writer 2>/dev/null || true; \ + > rm -f /tmp/test-ba-cli-open-stdin.fifo /tmp/test-ba-cli-open-stdin.rc \ + > " rm -f /tmp/test-ba-cli-automated-stdin.out /tmp/test-ba-cli-automated-stdin.rc; \ + > (printf '%s\n' '!amx exit' | ba-cli -a > /tmp/test-ba-cli-automated-stdin.out 2>&1; echo \$? > /tmp/test-ba-cli-automated-stdin.rc) & cli=\$!; \ + > for _ in 1 2 3; do [ -s /tmp/test-ba-cli-automated-stdin.rc ] && break; sleep 1; done; \ + > if [ ! -s /tmp/test-ba-cli-automated-stdin.rc ]; then \ + > kill \$cli 2>/dev/null || true; \ + > echo automated-stdin-hung; \ + > elif [ \"\$(cat /tmp/test-ba-cli-automated-stdin.rc)\" = 0 ]; then \ + > echo automated-stdin-exited; \ + > else \ + > echo automated-stdin-failed; \ + > fi; \ + > rm -f /tmp/test-ba-cli-automated-stdin.rc \ + > " ' + $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.3'].Security.ModesAvailable='WPA3-Personal,WPA3-Personal-Compatibility,OWE'\"" | grep 'ModesAvailable=' | sed '/^$/d' | grep -Ev '^(>|$)' WiFi.AccessPoint.\d+.Security.ModesAvailable="WPA3-Personal,WPA3-Personal-Compatibility,OWE" (re) WiFi.AccessPoint.\d+.Security.ModesAvailable="WPA3-Personal,WPA3-Personal-Compatibility,OWE" (re) WiFi.AccessPoint.\d+.Security.ModesAvailable="WPA3-Personal,WPA3-Personal-Compatibility,OWE" (re) diff --git a/.gitlab/tests/cram/mxl25641-hdk-6/110-prplmesh-dataelements.t b/.gitlab/tests/cram/mxl25641-hdk-6/110-prplmesh-dataelements.t index 9647acd29b..51697a5565 100644 --- a/.gitlab/tests/cram/mxl25641-hdk-6/110-prplmesh-dataelements.t +++ b/.gitlab/tests/cram/mxl25641-hdk-6/110-prplmesh-dataelements.t @@ -253,17 +253,17 @@ Check that wireless is disabled: Restore Security Mode to default values - $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.1'].Security.ModeEnabled='WPA3-Personal-Transition'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -v '>' + $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.1'].Security.ModeEnabled='WPA3-Personal-Transition'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -Ev '^(>|$)' WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) - $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.2'].Security.ModeEnabled='WPA3-Personal-Transition'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -v '>' + $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.2'].Security.ModeEnabled='WPA3-Personal-Transition'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -Ev '^(>|$)' WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) - $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.3'].Security.ModeEnabled='WPA3-Personal'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -v '>' + $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.3'].Security.ModeEnabled='WPA3-Personal'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -Ev '^(>|$)' WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal" (re) diff --git a/.gitlab/tests/cram/mxl25641-hdk-6/113-prplmesh-wpa3-cm.t b/.gitlab/tests/cram/mxl25641-hdk-6/113-prplmesh-wpa3-cm.t index 224398122a..3d730079f1 100644 --- a/.gitlab/tests/cram/mxl25641-hdk-6/113-prplmesh-wpa3-cm.t +++ b/.gitlab/tests/cram/mxl25641-hdk-6/113-prplmesh-wpa3-cm.t @@ -98,10 +98,10 @@ Create one instances of Network.AccessPoint with WPA3-Personal enabled and push $ R logger -t cram "Create instances of Network.AccessPoint and push them to the agent" - $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPoint+(Band2_4G=1,Band5GH=1,Band5GL=1,Band6G=1,MultiApMode=\"Fronthaul+Backhaul\",X_PRPLWARE_VapType=\"home\",SSID=\"SSID_WPA3CM\",Security.ModeEnabled=\"WPA3-Personal\",Security.KeyPassphrase=\"password\",Enable=1)\"" | tail -n +2 | sed '/^$/d' + $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPoint+(Band2_4G=1,Band5GH=1,Band5GL=1,Band6G=1,MultiApMode=\"Fronthaul+Backhaul\",X_PRPLWARE_VapType=\"home\",SSID=\"SSID_WPA3CM\",Security.ModeEnabled=\"WPA3-Personal\",Security.KeyPassphrase=\"password\",Enable=1)\"" | grep -Ev '^(>|$)' X_PRPLWARE-COM_WiFiController.Network.AccessPoint.* (re) - $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | tail -n +2 | sed '/^$/d' + $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | grep -Ev '^(>|$)' X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit() returned [ "" @@ -151,7 +151,7 @@ Push WPA3-Personal-Compatibility: $ R "ba-cli -l X_PRPLWARE-COM_WiFiController.Network.AccessPoint.1.Security.ModeEnabled=\"WPA3-Personal-Compatibility\"" | sed '/^$/d' WPA3-Personal-Compatibility - $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | tail -n +2 | sed '/^$/d' + $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | grep -Ev '^(>|$)' X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit() returned [ "" @@ -202,7 +202,7 @@ Restore security modes in two steps: WPA3 Transition to 2.4GHz/5GHz and then WPA $ R "ba-cli -l \"X_PRPLWARE-COM_WiFiController.Network.AccessPoint.1.Security.ModeEnabled=\"WPA3-Personal-Transition\"\"" | sed '/^$/d' WPA3-Personal-Transition - $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | tail -n +2 | sed '/^$/d' + $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | grep -Ev '^(>|$)' X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit() returned [ "" @@ -210,7 +210,7 @@ Restore security modes in two steps: WPA3 Transition to 2.4GHz/5GHz and then WPA $ sleep 5 - $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPoint.1.{Band2_4G=0,Band5GH=0,Band5GL=0,Band6G=1}\"" | sed '/^$/d' | tail -n +3 + $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPoint.1.{Band2_4G=0,Band5GH=0,Band5GL=0,Band6G=1}\"" | grep -Ev '^(>|$)' | sed '1d' X_PRPLWARE-COM_WiFiController.Network.AccessPoint.1.Band2_4G=0 X_PRPLWARE-COM_WiFiController.Network.AccessPoint.1.Band5GH=0 X_PRPLWARE-COM_WiFiController.Network.AccessPoint.1.Band5GL=0 @@ -219,7 +219,7 @@ Restore security modes in two steps: WPA3 Transition to 2.4GHz/5GHz and then WPA $ R "ba-cli -l \"X_PRPLWARE-COM_WiFiController.Network.AccessPoint.1.Security.ModeEnabled=\"WPA3-Personal\"\"" | sed '/^$/d' WPA3-Personal - $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | tail -n +2 | sed '/^$/d' + $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | grep -Ev '^(>|$)' X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit() returned [ "" diff --git a/.gitlab/tests/cram/mxl25641-hdk-6/acceleration-plan-components/109-cpu.t b/.gitlab/tests/cram/mxl25641-hdk-6/acceleration-plan-components/109-cpu.t index 15300b6f86..859c105d54 100644 --- a/.gitlab/tests/cram/mxl25641-hdk-6/acceleration-plan-components/109-cpu.t +++ b/.gitlab/tests/cram/mxl25641-hdk-6/acceleration-plan-components/109-cpu.t @@ -47,18 +47,17 @@ Verify CPUs — Data Model of OSPv2 Board: Enable the Dynamic Voltage and Frequency Scaling (DVFS) feature: - $ R 'ba-cli CPUs.CPU.1.DVFS.Enable=1'| sed -n '3p' + $ R 'ba-cli CPUs.CPU.1.DVFS.Enable=1' | grep -Ev '^(>|$)' | grep 'CPUs.CPU.1.DVFS.Enable=' CPUs.CPU.1.DVFS.Enable=1 Change governor to performance: - $ R 'ba-cli CPUs.CPU.1.DVFS.ScalingGovernor="performance"'| sed -n '3p' + $ R 'ba-cli CPUs.CPU.1.DVFS.ScalingGovernor="performance"' | grep -Ev '^(>|$)' | grep 'CPUs.CPU.1.DVFS.ScalingGovernor=' CPUs.CPU.1.DVFS.ScalingGovernor="performance" Check that the governor was changed to performance in datamodel: - $ R "ba-cli CPUs.CPU.*.DVFS.ScalingGovernor?" | tail -n+2 | LC_ALL=C sort - + $ R "ba-cli CPUs.CPU.*.DVFS.ScalingGovernor?" | grep -Ev '^(>|$)' | LC_ALL=C sort CPUs.CPU.1.DVFS.ScalingGovernor="performance" CPUs.CPU.2.DVFS.ScalingGovernor="powersave" @@ -70,13 +69,12 @@ Check that the governor was changed in sysfs: Change governor back to powersave: - $ R 'ba-cli CPUs.CPU.1.DVFS.ScalingGovernor="powersave"'| sed -n '3p' + $ R 'ba-cli CPUs.CPU.1.DVFS.ScalingGovernor="powersave"' | grep -Ev '^(>|$)' | grep 'CPUs.CPU.1.DVFS.ScalingGovernor=' CPUs.CPU.1.DVFS.ScalingGovernor="powersave" Check that the governor was changed back to powersave in datamodel: - $ R "ba-cli CPUs.CPU.*.DVFS.ScalingGovernor?" | tail -n+2 | LC_ALL=C sort - + $ R "ba-cli CPUs.CPU.*.DVFS.ScalingGovernor?" | grep -Ev '^(>|$)' | LC_ALL=C sort CPUs.CPU.1.DVFS.ScalingGovernor="powersave" CPUs.CPU.2.DVFS.ScalingGovernor="powersave" @@ -88,13 +86,12 @@ Check that the governor was changed back to powersave in sysfs: Check that its not possible to use unavailable conservative governor: - $ R 'ba-cli CPUs.CPU.1.DVFS.ScalingGovernor="Test"'| sed -n '2p' + $ R 'ba-cli CPUs.CPU.1.DVFS.ScalingGovernor="Test"' | grep -Ev '^(>|$)' | grep 'ERROR:' ERROR: set CPUs.CPU.1.DVFS.ScalingGovernor failed (10 - invalid value) Check that the governor is still set to powersave in datamodel: - $ R "ba-cli CPUs.CPU.*.DVFS.ScalingGovernor?" | tail -n+2 | LC_ALL=C sort - + $ R "ba-cli CPUs.CPU.*.DVFS.ScalingGovernor?" | grep -Ev '^(>|$)' | LC_ALL=C sort CPUs.CPU.1.DVFS.ScalingGovernor="powersave" CPUs.CPU.2.DVFS.ScalingGovernor="powersave" @@ -102,4 +99,4 @@ Check that the governor was is still set to powersave in sysfs: $ R "cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor" powersave - powersave \ No newline at end of file + powersave diff --git a/.gitlab/tests/cram/post/generic/50-check-for-crashes.t b/.gitlab/tests/cram/post/generic/50-check-for-crashes.t index 3ee292219f..10bfa33fe3 100644 --- a/.gitlab/tests/cram/post/generic/50-check-for-crashes.t +++ b/.gitlab/tests/cram/post/generic/50-check-for-crashes.t @@ -21,10 +21,10 @@ Check that there are no signs of crashes: Ensure that ProcessFaults does not contain any crashes: - $ R "ba-cli ProcessFaults.ProcessFault.? | grep -v '^>' | head -n -1 | sort" + $ R "ba-cli ProcessFaults.ProcessFault.? | grep -Ev '^(>|$)' | sort" No data found Ensure that there are no core dumps in the system: $ storage_path=$(R "ba-cli -l ProcessFaults.StoragePath?" | tr -d '\n') - $ R "test ! -f \"${storage_path}/count\"" \ No newline at end of file + $ R "test ! -f \"${storage_path}/count\"" diff --git a/.gitlab/tests/cram/wifi/process-manager-full.t b/.gitlab/tests/cram/wifi/process-manager-full.t index 22a84c7d8f..0a3cd66a34 100644 --- a/.gitlab/tests/cram/wifi/process-manager-full.t +++ b/.gitlab/tests/cram/wifi/process-manager-full.t @@ -118,7 +118,7 @@ Check that managing pWHM and prplMesh works: # Waiting for agent to complete statup $ R "amx_wait_for "X_PRPLWARE-COM_Agent.Info." " - $ R "ba-cli X_PRPLWARE-COM_ProcessManager.? | grep -v '>'" + $ R "ba-cli X_PRPLWARE-COM_ProcessManager.? | grep -Ev '^(>|$)'" X_PRPLWARE-COM_ProcessManager. X_PRPLWARE-COM_ProcessManager.PWHM. X_PRPLWARE-COM_ProcessManager.PWHM.Enable=1 @@ -134,7 +134,6 @@ Check that managing pWHM and prplMesh works: X_PRPLWARE-COM_ProcessManager.Sensing.Enable=1 X_PRPLWARE-COM_ProcessManager.Sensing.FaultCode="NoFault" X_PRPLWARE-COM_ProcessManager.Sensing.Status="Active" - # NOTE: # This test restarts PWHM and prplMesh services. # As a result, the system requires ~30 seconds to fully recover and stabilize. diff --git a/.gitlab/tests/cram/wifi/process-manager-smoke.t b/.gitlab/tests/cram/wifi/process-manager-smoke.t index f826bb9dad..97ec7d4f61 100644 --- a/.gitlab/tests/cram/wifi/process-manager-smoke.t +++ b/.gitlab/tests/cram/wifi/process-manager-smoke.t @@ -50,9 +50,8 @@ Check that managing WiFi Sensing works: Check Sensing datamodel again: - $ R "ba-cli X_PRPLWARE-COM_ProcessManager.Sensing.? | grep -v '>'" + $ R "ba-cli X_PRPLWARE-COM_ProcessManager.Sensing.? | grep -Ev '^(>|$)'" X_PRPLWARE-COM_ProcessManager.Sensing. X_PRPLWARE-COM_ProcessManager.Sensing.Enable=1 X_PRPLWARE-COM_ProcessManager.Sensing.FaultCode="NoFault" X_PRPLWARE-COM_ProcessManager.Sensing.Status="Active" - diff --git a/.gitlab/tests/cram/wifi/wifi-scheduler.t b/.gitlab/tests/cram/wifi/wifi-scheduler.t index 49063b6223..4da2215d18 100644 --- a/.gitlab/tests/cram/wifi/wifi-scheduler.t +++ b/.gitlab/tests/cram/wifi/wifi-scheduler.t @@ -144,7 +144,7 @@ Schedule a network activation at T1 with 1 minute duration: Check Wifi schedule is running: - $ R "ba-cli 'Device.X_PRPLWARE-COM_WiFiScheduler.Network.Schedule.1.Running?'" | sed '/^$/d' | tail -n +2 + $ R "ba-cli 'Device.X_PRPLWARE-COM_WiFiScheduler.Network.Schedule.1.Running?'" | grep -Ev '^(>|$)' Device.X_PRPLWARE-COM_WiFiScheduler.Network.Schedule.1.Running=1 Wait few seconds before checking wifi activation: diff --git a/.gitlab/tests/cram/wifi/wifi-sensing.t b/.gitlab/tests/cram/wifi/wifi-sensing.t index b687e51352..cf1f17b04b 100644 --- a/.gitlab/tests/cram/wifi/wifi-sensing.t +++ b/.gitlab/tests/cram/wifi/wifi-sensing.t @@ -53,7 +53,7 @@ Check sessions number: Check AddExchange API: Note: To fully test this API an associated station is required but let's test with a dummy MAC so we check that the API is reacting - $ R "ba-cli -j -l 'X_PRPLWARE-COM_WiFiSensing.Session.$SessionID.AddExchange(Transmitter = "AA:AA:AA:AA:AA:AA")'" | sed '/^$/d' | tail -n +2 + $ R "ba-cli -j -l 'X_PRPLWARE-COM_WiFiSensing.Session.$SessionID.AddExchange(Transmitter = "AA:AA:AA:AA:AA:AA")'" | grep -Ev '^(>|$)' | sed -n '2p' [{"ExchangeID":0,"ErrorCode":"NOT_PRESENT"}] Delete session using SessionID: diff --git a/.gitlab/tests/cram/wnc-freedom/110-prplmesh-dataelements.t b/.gitlab/tests/cram/wnc-freedom/110-prplmesh-dataelements.t index d1cdacee7b..6a0033f2f4 100644 --- a/.gitlab/tests/cram/wnc-freedom/110-prplmesh-dataelements.t +++ b/.gitlab/tests/cram/wnc-freedom/110-prplmesh-dataelements.t @@ -257,17 +257,17 @@ To disable wireless, disable instances of Network.AccessPoint{i} and call Access Restore Security.ModeEnabled for AccessPoints used in the test - $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.1'].Security.ModeEnabled='WPA3-Personal-Transition'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -v '>' + $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.1'].Security.ModeEnabled='WPA3-Personal-Transition'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -Ev '^(>|$)' WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) - $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.2'].Security.ModeEnabled='WPA3-Personal-Transition'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -v '>' + $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.2'].Security.ModeEnabled='WPA3-Personal-Transition'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -Ev '^(>|$)' WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal-Transition" (re) - $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.3'].Security.ModeEnabled='WPA3-Personal'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -v '>' + $ R "ba-cli \"WiFi.AccessPoint.[RadioReference == 'Device.WiFi.Radio.3'].Security.ModeEnabled='WPA3-Personal'\"" | grep 'ModeEnabled=' | sed '/^$/d' | grep -Ev '^(>|$)' WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal" (re) WiFi.AccessPoint.\d+.Security.ModeEnabled="WPA3-Personal" (re) diff --git a/.gitlab/tests/cram/wnc-freedom/113-prplmesh-wpa3-cm.t b/.gitlab/tests/cram/wnc-freedom/113-prplmesh-wpa3-cm.t index d32b2a381b..f83bdb2bad 100644 --- a/.gitlab/tests/cram/wnc-freedom/113-prplmesh-wpa3-cm.t +++ b/.gitlab/tests/cram/wnc-freedom/113-prplmesh-wpa3-cm.t @@ -98,10 +98,10 @@ Create one instances of Network.AccessPoint with WPA3-Personal enabled and push $ R logger -t cram "Create instances of Network.AccessPoint and push them to the agent" - $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPoint+(Band2_4G=1,Band5GH=1,Band5GL=1,Band6G=1,MultiApMode=\"Fronthaul+Backhaul\",X_PRPLWARE_VapType=\"home\",SSID=\"SSID_WPA3CM\",Security.ModeEnabled=\"WPA3-Personal\",Security.KeyPassphrase=\"password\",Enable=1)\"" | tail -n +2 | sed '/^$/d' + $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPoint+(Band2_4G=1,Band5GH=1,Band5GL=1,Band6G=1,MultiApMode=\"Fronthaul+Backhaul\",X_PRPLWARE_VapType=\"home\",SSID=\"SSID_WPA3CM\",Security.ModeEnabled=\"WPA3-Personal\",Security.KeyPassphrase=\"password\",Enable=1)\"" | grep -Ev '^(>|$)' X_PRPLWARE-COM_WiFiController.Network.AccessPoint.* (re) - $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | tail -n +2 | sed '/^$/d' + $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | grep -Ev '^(>|$)' X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit() returned [ "" @@ -151,7 +151,7 @@ Push WPA3-Personal-Compatibility: $ R "ba-cli -l X_PRPLWARE-COM_WiFiController.Network.AccessPoint.1.Security.ModeEnabled=\"WPA3-Personal-Compatibility\"" | sed '/^$/d' WPA3-Personal-Compatibility - $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | tail -n +2 | sed '/^$/d' + $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | grep -Ev '^(>|$)' X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit() returned [ "" @@ -202,7 +202,7 @@ Restore security modes in two steps: WPA3 Transition to 2.4GHz/5GHz and then WPA $ R "ba-cli -l \"X_PRPLWARE-COM_WiFiController.Network.AccessPoint.1.Security.ModeEnabled=\"WPA3-Personal-Transition\"\"" | sed '/^$/d' WPA3-Personal-Transition - $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | tail -n +2 | sed '/^$/d' + $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | grep -Ev '^(>|$)' X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit() returned [ "" @@ -210,7 +210,7 @@ Restore security modes in two steps: WPA3 Transition to 2.4GHz/5GHz and then WPA $ sleep 5 - $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPoint.1.{Band2_4G=0,Band5GH=0,Band5GL=0,Band6G=1}\"" | sed '/^$/d' | tail -n +3 + $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPoint.1.{Band2_4G=0,Band5GH=0,Band5GL=0,Band6G=1}\"" | grep -Ev '^(>|$)' | sed '1d' X_PRPLWARE-COM_WiFiController.Network.AccessPoint.1.Band2_4G=0 X_PRPLWARE-COM_WiFiController.Network.AccessPoint.1.Band5GH=0 X_PRPLWARE-COM_WiFiController.Network.AccessPoint.1.Band5GL=0 @@ -219,7 +219,7 @@ Restore security modes in two steps: WPA3 Transition to 2.4GHz/5GHz and then WPA $ R "ba-cli -l \"X_PRPLWARE-COM_WiFiController.Network.AccessPoint.1.Security.ModeEnabled=\"WPA3-Personal\"\"" | sed '/^$/d' WPA3-Personal - $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | tail -n +2 | sed '/^$/d' + $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | grep -Ev '^(>|$)' X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit() returned [ "" diff --git a/.gitlab/tests/cram/wnc-freedom/120-prplmesh-static-puncturing_step_1.t b/.gitlab/tests/cram/wnc-freedom/120-prplmesh-static-puncturing_step_1.t index bf0c7fcd9f..51f200bd73 100644 --- a/.gitlab/tests/cram/wnc-freedom/120-prplmesh-static-puncturing_step_1.t +++ b/.gitlab/tests/cram/wnc-freedom/120-prplmesh-static-puncturing_step_1.t @@ -71,7 +71,7 @@ First call of AccessPointCommit, controller should push empty config to agents: $ R logger -t cram "first call of AccessPointCommit pushes empty config, global teardown" - $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | tail -n +2 | sed '/^$/d' + $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | grep -Ev '^(>|$)' X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit() returned [ "" @@ -83,10 +83,10 @@ Create one instances of Network.AccessPoint and push it to the agent: $ R logger -t cram "create instances of Network.AccessPoint and push them to the agent" - $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPoint+(MLDUnit=0,Band5GH=1,Band5GL=1,MultiApMode=\"Fronthaul+Backhaul\",X_PRPLWARE_VapType=\"home\",SSID=\"SSIDforStaticPunct\",Security.ModeEnabled=\"WPA3-Personal\",Security.KeyPassphrase=\"password\",Enable=1)\"" | tail -n +2 | sed '/^$/d' + $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPoint+(MLDUnit=0,Band5GH=1,Band5GL=1,MultiApMode=\"Fronthaul+Backhaul\",X_PRPLWARE_VapType=\"home\",SSID=\"SSIDforStaticPunct\",Security.ModeEnabled=\"WPA3-Personal\",Security.KeyPassphrase=\"password\",Enable=1)\"" | grep -Ev '^(>|$)' X_PRPLWARE-COM_WiFiController.Network.AccessPoint.* (re) - $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | tail -n +2 | sed '/^$/d' + $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | grep -Ev '^(>|$)' X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit() returned [ "" diff --git a/.gitlab/tests/cram/wnc-freedom/120-prplmesh-static-puncturing_step_2.t b/.gitlab/tests/cram/wnc-freedom/120-prplmesh-static-puncturing_step_2.t index 196f474ffa..6e04d43f32 100644 --- a/.gitlab/tests/cram/wnc-freedom/120-prplmesh-static-puncturing_step_2.t +++ b/.gitlab/tests/cram/wnc-freedom/120-prplmesh-static-puncturing_step_2.t @@ -35,7 +35,7 @@ Restore defaults: $ R "ba-cli -l \"X_PRPLWARE-COM_WiFiController.Network.AccessPoint.1.Security.ModeEnabled=\"WPA3-Personal-Transition\"\"" | sed '/^$/d' WPA3-Personal-Transition - $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | tail -n +2 | sed '/^$/d' + $ R "ba-cli \"X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit()\"" | grep -Ev '^(>|$)' X_PRPLWARE-COM_WiFiController.Network.AccessPointCommit() returned [ "" diff --git a/.gitlab/tests/cram/wnc-freedom/acceleration-plan-components/109-cpu.t b/.gitlab/tests/cram/wnc-freedom/acceleration-plan-components/109-cpu.t index 7465a496ae..de3c86487e 100644 --- a/.gitlab/tests/cram/wnc-freedom/acceleration-plan-components/109-cpu.t +++ b/.gitlab/tests/cram/wnc-freedom/acceleration-plan-components/109-cpu.t @@ -79,18 +79,17 @@ Verify CPUs — Data Model of Freedom Board: Enable the Dynamic Voltage and Frequency Scaling (DVFS) feature: - $ R 'ba-cli CPUs.CPU.1.DVFS.Enable=1'| sed -n '3p' + $ R 'ba-cli CPUs.CPU.1.DVFS.Enable=1' | grep -Ev '^(>|$)' | grep 'CPUs.CPU.1.DVFS.Enable=' CPUs.CPU.1.DVFS.Enable=1 Change governor to performance: - $ R 'ba-cli CPUs.CPU.1.DVFS.ScalingGovernor="performance"'| sed -n '3p' + $ R 'ba-cli CPUs.CPU.1.DVFS.ScalingGovernor="performance"' | grep -Ev '^(>|$)' | grep 'CPUs.CPU.1.DVFS.ScalingGovernor=' CPUs.CPU.1.DVFS.ScalingGovernor="performance" Check that the governor was changed to performance in datamodel: - $ R "ba-cli CPUs.CPU.*.DVFS.ScalingGovernor?" | tail -n+2 | LC_ALL=C sort - + $ R "ba-cli CPUs.CPU.*.DVFS.ScalingGovernor?" | grep -Ev '^(>|$)' | LC_ALL=C sort CPUs.CPU.1.DVFS.ScalingGovernor="performance" CPUs.CPU.2.DVFS.ScalingGovernor="performance" CPUs.CPU.3.DVFS.ScalingGovernor="performance" @@ -106,13 +105,12 @@ Check that the governor was changed in sysfs: Change governor back to powersave: - $ R 'ba-cli CPUs.CPU.1.DVFS.ScalingGovernor="powersave"'| sed -n '3p' + $ R 'ba-cli CPUs.CPU.1.DVFS.ScalingGovernor="powersave"' | grep -Ev '^(>|$)' | grep 'CPUs.CPU.1.DVFS.ScalingGovernor=' CPUs.CPU.1.DVFS.ScalingGovernor="powersave" Check that the governor was changed back to powersave in datamodel: - $ R "ba-cli CPUs.CPU.*.DVFS.ScalingGovernor?" | tail -n+2 | LC_ALL=C sort - + $ R "ba-cli CPUs.CPU.*.DVFS.ScalingGovernor?" | grep -Ev '^(>|$)' | LC_ALL=C sort CPUs.CPU.1.DVFS.ScalingGovernor="powersave" CPUs.CPU.2.DVFS.ScalingGovernor="powersave" CPUs.CPU.3.DVFS.ScalingGovernor="powersave" @@ -128,13 +126,12 @@ Check that the governor was changed back to powersave in sysfs: Check that its not possible to use unavailable conservative governor: - $ R 'ba-cli CPUs.CPU.1.DVFS.ScalingGovernor="Test"'| sed -n '2p' + $ R 'ba-cli CPUs.CPU.1.DVFS.ScalingGovernor="Test"' | grep -Ev '^(>|$)' | grep 'ERROR:' ERROR: set CPUs.CPU.1.DVFS.ScalingGovernor failed (10 - invalid value) Check that the governor is still set to powersave in datamodel: - $ R "ba-cli CPUs.CPU.*.DVFS.ScalingGovernor?" | tail -n+2 | LC_ALL=C sort - + $ R "ba-cli CPUs.CPU.*.DVFS.ScalingGovernor?" | grep -Ev '^(>|$)' | LC_ALL=C sort CPUs.CPU.1.DVFS.ScalingGovernor="powersave" CPUs.CPU.2.DVFS.ScalingGovernor="powersave" CPUs.CPU.3.DVFS.ScalingGovernor="powersave" @@ -150,14 +147,13 @@ Check that the governor was is still set to powersave in sysfs: Set the governor back to performance to avoid affecting other tests: - $ R 'ba-cli CPUs.CPU.1.DVFS.ScalingGovernor="performance"'| sed -n '3p' + $ R 'ba-cli CPUs.CPU.1.DVFS.ScalingGovernor="performance"' | grep -Ev '^(>|$)' | grep 'CPUs.CPU.1.DVFS.ScalingGovernor=' CPUs.CPU.1.DVFS.ScalingGovernor="performance" Check that the governor was changed to performance in datamodel: - $ R "ba-cli CPUs.CPU.*.DVFS.ScalingGovernor?" | tail -n+2 | LC_ALL=C sort - + $ R "ba-cli CPUs.CPU.*.DVFS.ScalingGovernor?" | grep -Ev '^(>|$)' | LC_ALL=C sort CPUs.CPU.1.DVFS.ScalingGovernor="performance" CPUs.CPU.2.DVFS.ScalingGovernor="performance" CPUs.CPU.3.DVFS.ScalingGovernor="performance" - CPUs.CPU.4.DVFS.ScalingGovernor="performance" \ No newline at end of file + CPUs.CPU.4.DVFS.ScalingGovernor="performance" diff --git a/.gitlab/tests/cram/wnc-freedom/tr181-bridging/bridge_vlan_port_id.t b/.gitlab/tests/cram/wnc-freedom/tr181-bridging/bridge_vlan_port_id.t index 8084fa248e..6a95c51f76 100644 --- a/.gitlab/tests/cram/wnc-freedom/tr181-bridging/bridge_vlan_port_id.t +++ b/.gitlab/tests/cram/wnc-freedom/tr181-bridging/bridge_vlan_port_id.t @@ -4,19 +4,16 @@ Create R alias: Add a VLAN with unique ID: - $ R ba-cli Bridging.Bridge.lan.VLAN.+{VLANID=100, Enable=1}? | grep -v '^>' + $ R ba-cli Bridging.Bridge.lan.VLAN.+{VLANID=100, Enable=1}? | grep -Ev '^(>|$)' Bridging.Bridge.1.VLAN.1. Bridging.Bridge.1.VLAN.1.Alias="cpe-VLAN-1" - Add a VLAN with duplicate ID: - $ R "ba-cli 'Bridging.Bridge.lan.VLAN.+{VLANID=100, Enable=1}?'" | grep -v '^>' + $ R "ba-cli 'Bridging.Bridge.lan.VLAN.+{VLANID=100, Enable=1}?'" | grep -Ev '^(>|$)' ERROR: add Bridging.Bridge.lan.VLAN. failed (13 - duplicate) - Cleanup: - $ R "ba-cli Bridging.Bridge.lan.VLAN.[VLANID==100].-" | grep -v '^>' + $ R "ba-cli Bridging.Bridge.lan.VLAN.[VLANID==100].-" | grep -Ev '^(>|$)' Bridging.Bridge.1.VLAN.1. - diff --git a/.gitlab/tests/cram/wnc-freedom/tr181-bridging/lower_layers.t b/.gitlab/tests/cram/wnc-freedom/tr181-bridging/lower_layers.t index 4ffdd4ec90..8452fcedfe 100644 --- a/.gitlab/tests/cram/wnc-freedom/tr181-bridging/lower_layers.t +++ b/.gitlab/tests/cram/wnc-freedom/tr181-bridging/lower_layers.t @@ -19,9 +19,8 @@ Check lan bridge ports: Replace a port with WAN interface: $ R ba-cli 'Device.Bridging.Bridge.lan.Port.12.LowerLayers=Device.Ethernet.Interface.1' >/dev/null - $ R ba-cli 'Device.Bridging.Bridge.lan.Port.12.Name?' | grep -v '^>' + $ R ba-cli 'Device.Bridging.Bridge.lan.Port.12.Name?' | grep -Ev '^(>|$)' Device.Bridging.Bridge.1.Port.12.Name="wan" - Check lan bridge ports: @@ -41,7 +40,6 @@ Check lan bridge ports: Restore: - $ R ba-cli 'Device.Bridging.Bridge.lan.Port.12.LowerLayers=Device.Ethernet.Interface.5' | grep -v '^>' + $ R ba-cli 'Device.Bridging.Bridge.lan.Port.12.LowerLayers=Device.Ethernet.Interface.5' | grep -Ev '^(>|$)' Device.Bridging.Bridge.1.Port.12. Device.Bridging.Bridge.1.Port.12.LowerLayers="Device.Ethernet.Interface.5" - diff --git a/.gitlab/tests/cram/wnc-freedom/tr181-bridging/port_name.t b/.gitlab/tests/cram/wnc-freedom/tr181-bridging/port_name.t index d9910b5b72..3b9d8fb44a 100644 --- a/.gitlab/tests/cram/wnc-freedom/tr181-bridging/port_name.t +++ b/.gitlab/tests/cram/wnc-freedom/tr181-bridging/port_name.t @@ -4,20 +4,17 @@ Create R alias: Add an entry with a unique name: - $ R ba-cli 'Device.Bridging.Bridge.lan.Port.+{Name="eth100"}' | grep -v '^>' + $ R ba-cli 'Device.Bridging.Bridge.lan.Port.+{Name="eth100"}' | grep -Ev '^(>|$)' Device\.Bridging\.Bridge\.1\.Port\.\d+\. (re) Device\.Bridging\.Bridge\.1\.Port\.\d+\.Alias="cpe-Port-\d+" (re) - Add an entry with a duplicate name: - $ R ba-cli 'Device.Bridging.Bridge.lan.Port.+{Name="eth100"}' | grep -v '^>' + $ R ba-cli 'Device.Bridging.Bridge.lan.Port.+{Name="eth100"}' | grep -Ev '^(>|$)' ERROR: add Device.Bridging.Bridge.lan.Port. failed (13 - duplicate) - Restore: - $ R "ba-cli 'Device.Bridging.Bridge.lan.Port.[Name==\"eth100\"].-'" | grep -v '^>' + $ R "ba-cli 'Device.Bridging.Bridge.lan.Port.[Name==\"eth100\"].-'" | grep -Ev '^(>|$)' Device\.Bridging\.Bridge\.1\.Port\.\d+\. (re) Device\.Bridging\.Bridge\.1\.Port\.\d+\.Stats\. (re) - diff --git a/.gitlab/tests/cram/wnc-freedom/tr181-bridging/priority_regeneration.t b/.gitlab/tests/cram/wnc-freedom/tr181-bridging/priority_regeneration.t index e4706f7e1f..d26a82a033 100644 --- a/.gitlab/tests/cram/wnc-freedom/tr181-bridging/priority_regeneration.t +++ b/.gitlab/tests/cram/wnc-freedom/tr181-bridging/priority_regeneration.t @@ -6,42 +6,35 @@ Check priority regeneration on eth0: $ R ba-cli 'Device.Bridging.Bridge.lan.Port.1.PriorityRegeneration?' | grep -Ev '^>' Device.Bridging.Bridge.1.Port.1.PriorityRegeneration="0,1,2,3,4,5,6,7" - Set the value bigger than allowed: $ R "ba-cli 'Device.Bridging.Bridge.lan.Port.1.PriorityRegeneration=\"0,1,2,3,4,5,6,8\"'" | grep -Ev '^>' ERROR: set Device.Bridging.Bridge.lan.Port.1.PriorityRegeneration failed (10 - invalid value) - Set the value lower than allowed: - $ R "ba-cli 'Device.Bridging.Bridge.lan.Port.1.PriorityRegeneration=\"0,1,2,3,4,5,6,-1\"'" | grep -v '^>' + $ R "ba-cli 'Device.Bridging.Bridge.lan.Port.1.PriorityRegeneration=\"0,1,2,3,4,5,6,-1\"'" | grep -Ev '^(>|$)' ERROR: set Device.Bridging.Bridge.lan.Port.1.PriorityRegeneration failed (10 - invalid value) - Set the value with an extra item: - $ R "ba-cli 'Device.Bridging.Bridge.lan.Port.1.PriorityRegeneration=\"0,1,2,3,4,5,6,7,7\"'" | grep -v '^>' + $ R "ba-cli 'Device.Bridging.Bridge.lan.Port.1.PriorityRegeneration=\"0,1,2,3,4,5,6,7,7\"'" | grep -Ev '^(>|$)' ERROR: set Device.Bridging.Bridge.lan.Port.1.PriorityRegeneration failed (10 - invalid value) - Set the value with a missing item: - $ R "ba-cli 'Device.Bridging.Bridge.lan.Port.1.PriorityRegeneration=\"0,1,2,3,4,5,6\"'" | grep -v '^>' + $ R "ba-cli 'Device.Bridging.Bridge.lan.Port.1.PriorityRegeneration=\"0,1,2,3,4,5,6\"'" | grep -Ev '^(>|$)' ERROR: set Device.Bridging.Bridge.lan.Port.1.PriorityRegeneration failed (10 - invalid value) - Set a correct value: - $ R "ba-cli 'Device.Bridging.Bridge.lan.Port.1.PriorityRegeneration=\"0,1,2,3,4,5,6,6\"'" | grep -v '^>' + $ R "ba-cli 'Device.Bridging.Bridge.lan.Port.1.PriorityRegeneration=\"0,1,2,3,4,5,6,6\"'" | grep -Ev '^(>|$)' Device.Bridging.Bridge.1.Port.1. Device.Bridging.Bridge.1.Port.1.PriorityRegeneration="0,1,2,3,4,5,6,6" - Restore: - $ R "ba-cli 'Device.Bridging.Bridge.lan.Port.1.PriorityRegeneration=\"0,1,2,3,4,5,6,7\"'" | grep -v '^>' + $ R "ba-cli 'Device.Bridging.Bridge.lan.Port.1.PriorityRegeneration=\"0,1,2,3,4,5,6,7\"'" | grep -Ev '^(>|$)' Device.Bridging.Bridge.1.Port.1. Device.Bridging.Bridge.1.Port.1.PriorityRegeneration="0,1,2,3,4,5,6,7" - diff --git a/.gitlab/tests/cram/wnc-freedom/tr181-bridging/stp_bridge_priority.t b/.gitlab/tests/cram/wnc-freedom/tr181-bridging/stp_bridge_priority.t index fc09ab90d1..16d61645b0 100644 --- a/.gitlab/tests/cram/wnc-freedom/tr181-bridging/stp_bridge_priority.t +++ b/.gitlab/tests/cram/wnc-freedom/tr181-bridging/stp_bridge_priority.t @@ -4,32 +4,27 @@ Create R alias: Check default value: - $ R ba-cli Bridging.Bridge.lan.STP.BridgePriority? | grep -v '^>' + $ R ba-cli Bridging.Bridge.lan.STP.BridgePriority? | grep -Ev '^(>|$)' Bridging.Bridge.1.STP.BridgePriority=32768 - Try to set a negative value: - $ R ba-cli Bridging.Bridge.lan.STP.BridgePriority=-1 | grep -v '^>' + $ R ba-cli Bridging.Bridge.lan.STP.BridgePriority=-1 | grep -Ev '^(>|$)' ERROR: set Bridging.Bridge.lan.STP.BridgePriority failed (10 - invalid value) - Try to set a value bigger than allowed: - $ R ba-cli Bridging.Bridge.lan.STP.BridgePriority=61441 | grep -v '^>' + $ R ba-cli Bridging.Bridge.lan.STP.BridgePriority=61441 | grep -Ev '^(>|$)' ERROR: set Bridging.Bridge.lan.STP.BridgePriority failed (10 - invalid value) - Try to set the maximal allowed value: - $ R ba-cli Bridging.Bridge.lan.STP.BridgePriority=61440 | grep -v '^>' + $ R ba-cli Bridging.Bridge.lan.STP.BridgePriority=61440 | grep -Ev '^(>|$)' Bridging.Bridge.1.STP. Bridging.Bridge.1.STP.BridgePriority=61440 - Restore: - $ R ba-cli Bridging.Bridge.lan.STP.BridgePriority=32768 | grep -v '^>' + $ R ba-cli Bridging.Bridge.lan.STP.BridgePriority=32768 | grep -Ev '^(>|$)' Bridging.Bridge.1.STP. Bridging.Bridge.1.STP.BridgePriority=32768 - \ No newline at end of file diff --git a/.gitlab/tests/cram/wnc-freedom/tr181-dhcpv6client/dscp_mark.t b/.gitlab/tests/cram/wnc-freedom/tr181-dhcpv6client/dscp_mark.t index 581f6e4b46..839c7f6cd9 100644 --- a/.gitlab/tests/cram/wnc-freedom/tr181-dhcpv6client/dscp_mark.t +++ b/.gitlab/tests/cram/wnc-freedom/tr181-dhcpv6client/dscp_mark.t @@ -4,7 +4,6 @@ Create R alias: Check DSCPMark value: - $ R "ba-cli Device.DHCPv6.Client.1.DSCPMark?" | grep -v '^>' + $ R "ba-cli Device.DHCPv6.Client.1.DSCPMark?" | grep -Ev '^(>|$)' Device.DHCPv6.Client.1.DSCPMark=48 - diff --git a/.gitlab/tests/cram/wnc-freedom/tr181-dhcpv6client/interface.t b/.gitlab/tests/cram/wnc-freedom/tr181-dhcpv6client/interface.t index 96f938a6ef..cde653cbf5 100644 --- a/.gitlab/tests/cram/wnc-freedom/tr181-dhcpv6client/interface.t +++ b/.gitlab/tests/cram/wnc-freedom/tr181-dhcpv6client/interface.t @@ -5,6 +5,5 @@ Create R alias: Set unexistent interface: - $ R "ba-cli Device.DHCPv6.Client.1.Interface=Device.IP.Interface.99" | grep -v '^>' + $ R "ba-cli Device.DHCPv6.Client.1.Interface=Device.IP.Interface.99" | grep -Ev '^(>|$)' ERROR: set Device.DHCPv6.Client.1.Interface failed (21 - invalid path) - \ No newline at end of file diff --git a/.gitlab/tests/cram/wnc-freedom/tr181-dhcv6s/dscp_mark.t b/.gitlab/tests/cram/wnc-freedom/tr181-dhcv6s/dscp_mark.t index ad31880905..78b69ce121 100644 --- a/.gitlab/tests/cram/wnc-freedom/tr181-dhcv6s/dscp_mark.t +++ b/.gitlab/tests/cram/wnc-freedom/tr181-dhcv6s/dscp_mark.t @@ -4,7 +4,6 @@ Create R alias: $ alias R="${CRAM_REMOTE_COMMAND:-}" Check DSCPMark value: - $ R "ba-cli Device.DHCPv6.Server.Pool.1.DSCPMark?" | grep -v '^>' + $ R "ba-cli Device.DHCPv6.Server.Pool.1.DSCPMark?" | grep -Ev '^(>|$)' Device.DHCPv6.Server.Pool.1.DSCPMark=48 - diff --git a/profiles/prpl_core.yml b/profiles/prpl_core.yml index 66a82f2a11..a30bd1a302 100644 --- a/profiles/prpl_core.yml +++ b/profiles/prpl_core.yml @@ -3,7 +3,7 @@ description: A minimal set of prpl packages and configs (no WAN support, no LCM, feeds: - name: feed_amx uri: https://gitlab.com/prpl-foundation/prplos/feeds/feed_amx.git - revision: main@0f228e1165a3bd9c530e4b20f3cdbd10d313ffa8 + revision: main@9581259339defc48d1023351b38a5bebbd15d973 - name: feed_prplmesh uri: https://gitlab.com/prpl-foundation/prplos/feeds/feed-prplmesh.git