handle unregistered devices (#20728)

* handle unregistered devices

* cleanup

* no uploader or athena

* clean up
old-commit-hash: 1786d042396bcc079be5de33ed900f48effcec17
This commit is contained in:
Adeeb Shihadeh
2021-04-22 21:03:57 -07:00
committed by GitHub
parent 59fb5c6a72
commit 3e4eb2e343
5 changed files with 33 additions and 37 deletions
+1 -4
View File
@@ -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(&params_map);
+3 -2
View File
@@ -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"):