Commit 803d3f48 authored by Vivek Kumar Dutta's avatar Vivek Kumar Dutta

test: Validate schema update notification

parent 68c23cea
Pipeline #15041 failed with stages
in 8 minutes and 6 seconds
......@@ -5,20 +5,26 @@ pwd
source ./gitlab-ci/shared.sh
# install required packages
exec_cmd apt update
exec_cmd apt install -y python3-pip
exec_cmd pip3 install pexpect
# install libbbf
cd /opt/dev
rm -rf bbf
exec_cmd git clone -b devel https://dev.iopsys.eu/iopsys/bbf.git
cd /opt/dev/bbf
#exec_cmd git checkout a9dff9e62134c3b758afc243eee1da5ed8a0a439
echo "BBF Upstream Hash ${UPSTREAM_BBF_SHA}"
if [ -n "${UPSTREAM_BBF_SHA}" ]; then
exec_cmd git checkout ${UPSTREAM_BBF_SHA}
fi
git log -1
echo "Compiling bbf"
exec_cmd autoreconf -i
exec_cmd ./configure --enable-tr181 --enable-tr104 --enable-tr143 --enable-tr157 CPPFLAGS=-DCUSTOM_PREFIX=\\\"X_IOPSYS_EU_\\\"
exec_cmd ./configure --enable-tr181 --enable-tr104 --enable-tr143 CPPFLAGS=-DCUSTOM_PREFIX=\\\"X_IOPSYS_EU_\\\"
exec_cmd make
exec_cmd make install
ldconfig
......
#!/usr/bin/python3
import pexpect
import os
print("Running: Schema updater notification validation")
ret = 1
child = pexpect.spawn('ubus monitor')
# force change in schema, by removing dependency uci file
os.rename("/etc/config/users", "/etc/config/users_1")
try:
ret = child.expect('notify', timeout=35)
except:
print("FAIL: Schema updater notification")
if ret == 0:
try:
ret = child.expect('schema_update_available')
except:
print("FAIL: Schema updater notification")
# Revert back uci changes
os.rename("/etc/config/users_1", "/etc/config/users")
if ret == 0:
print("PASS: Schema updater notification")
exit(ret)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment