mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 08:14:00 +08:00
handle unregistered devices (#20728)
* handle unregistered devices * cleanup * no uploader or athena * clean up old-commit-hash: 1786d042396bcc079be5de33ed900f48effcec17
This commit is contained in:
@@ -91,10 +91,6 @@ kj::Array<capnp::word> logger_build_init_data() {
|
||||
}
|
||||
#endif
|
||||
|
||||
const char* dongle_id = getenv("DONGLE_ID");
|
||||
if (dongle_id) {
|
||||
init.setDongleId(std::string(dongle_id));
|
||||
}
|
||||
init.setDirty(!getenv("CLEAN"));
|
||||
|
||||
// log params
|
||||
@@ -103,6 +99,7 @@ kj::Array<capnp::word> logger_build_init_data() {
|
||||
init.setGitBranch(params.get("GitBranch"));
|
||||
init.setGitRemote(params.get("GitRemote"));
|
||||
init.setPassive(params.getBool("Passive"));
|
||||
init.setDongleId(params.get("DongleId"));
|
||||
{
|
||||
std::map<std::string, std::string> params_map;
|
||||
params.read_db_all(¶ms_map);
|
||||
|
||||
@@ -76,9 +76,11 @@ class TestLoggerd(unittest.TestCase):
|
||||
|
||||
def test_init_data_values(self):
|
||||
os.environ["CLEAN"] = random.choice(["0", "1"])
|
||||
os.environ["DONGLE_ID"] = ''.join(random.choice(string.printable) for n in range(random.randint(1, 100)))
|
||||
|
||||
dongle = ''.join(random.choice(string.printable) for n in range(random.randint(1, 100)))
|
||||
fake_params = [
|
||||
# param, initData field, value
|
||||
("DongleId", "dongleId", dongle),
|
||||
("GitCommit", "gitCommit", "commit"),
|
||||
("GitBranch", "gitBranch", "branch"),
|
||||
("GitRemote", "gitRemote", "remote"),
|
||||
@@ -91,7 +93,6 @@ class TestLoggerd(unittest.TestCase):
|
||||
initData = lr[0].initData
|
||||
|
||||
self.assertTrue(initData.dirty != bool(os.environ["CLEAN"]))
|
||||
self.assertEqual(initData.dongleId, os.environ["DONGLE_ID"])
|
||||
self.assertEqual(initData.version, VERSION)
|
||||
|
||||
if os.path.isfile("/proc/cmdline"):
|
||||
|
||||
Reference in New Issue
Block a user