mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
20 lines
494 B
Python
Executable file
20 lines
494 B
Python
Executable file
#!/usr/bin/python3
|
|
|
|
import subprocess
|
|
import json
|
|
|
|
TEST_NAME = "Get serial number"
|
|
|
|
print("Running: " + TEST_NAME)
|
|
|
|
out = subprocess.Popen(['ubus', 'call', 'bbfdm', 'get', '{"path":"Device.DeviceInfo.SerialNumber", "optional":{"format":"raw"}}'],
|
|
stdout=subprocess.PIPE,
|
|
stderr=subprocess.STDOUT)
|
|
|
|
stdout,stderr = out.communicate()
|
|
|
|
jout = json.loads(stdout)
|
|
|
|
assert jout["results"][0]["data"] == "000000001", "FAIL: serial number mismatch"
|
|
|
|
print("PASS: " + TEST_NAME)
|