"""SIM2 boot gates with fake AT brokers; no modem devices or host /run writes. The cold start, its warm-up wrapper (the fallback to SIM1 when it cannot be done, the first-data check of a second card) and init.d/mu300-atd's dual-SIM path, on macOS too.""" import os import subprocess import time import unittest from helpers import BIN, TOP, ShellTest class Sim2ColdStart(ShellTest): def setUp(self): super().setUp() self.run = self.tmp / 'run' self.etc = self.tmp / 'etc' self.etc.mkdir() (self.etc / 'openwrt_release').touch() (self.run / 'mu300').mkdir(parents=True) (self.run / 'mu300-radio-freeze').touch() for name in ('mu300-at', 'mu300-at2', 'mu300-at4', 'mu300-at5'): d = self.run / name (d / 'owner').mkdir(parents=True) (d / 'owner/pid').write_text(str(os.getpid())) os.mkfifo(d / 'cmd') urc = self.run / 'mu300-at/urc' urc.mkdir() (urc / 'stty_nr0.log').write_text('CP ready\n') self.stub('mu300-device', 'echo "${T_DEVICE-u30air}"') # network.wan options other than the two the selector writes: files named uci-