From 346c8d2e89613d2019d4f23b7d32f3b281feca60 Mon Sep 17 00:00:00 2001 From: bo41 Date: Sat, 18 Sep 2021 19:00:44 +0200 Subject: [PATCH] CI: check empty deviceinfo variables (MR 2534) --- .ci/testcases/test_deviceinfo.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.ci/testcases/test_deviceinfo.py b/.ci/testcases/test_deviceinfo.py index 7c6b85bcd..517836fa3 100644 --- a/.ci/testcases/test_deviceinfo.py +++ b/.ci/testcases/test_deviceinfo.py @@ -34,7 +34,16 @@ def test_deviceinfo(args): for folder in glob.glob(args.aports + "/device/*/device-*"): device = folder[len(args.aports):].split("-", 1)[1] + f = open(folder[len(args.aports):][1:] + "/deviceinfo") + lines = f.read().split("\n") + f.close() + try: + # variable can not be empty + for line in lines: + if '=""' in line: + raise RuntimeError("Please remove the empty variable: " + line) + # Successful deviceinfo parsing / obsolete options info = pmb.parse.deviceinfo(args, device) deviceinfo_obsolete(info)