mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-02-03 20:37:43 +01:00
20 lines
471 B
Python
Executable file
20 lines
471 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', 'usp.raw', 'get', '{"path":"Device.DeviceInfo.SerialNumber"}'],
|
|
stdout=subprocess.PIPE,
|
|
stderr=subprocess.STDOUT)
|
|
|
|
stdout,stderr = out.communicate()
|
|
|
|
jout = json.loads(stdout)
|
|
|
|
assert jout["parameters"][0]["value"] == "000000001", "FAIL: serial number mismatch"
|
|
|
|
print("PASS: " + TEST_NAME)
|