test_updated: ensure symlinks are copied properly (#31825)

test symlink
pull/31826/head
Justin Newberry 1 year ago committed by GitHub
parent 8a03884500
commit 7779f6875f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      selfdrive/updated/tests/test_base.py

@ -32,6 +32,10 @@ def update_release(directory, name, version, agnos_version, release_notes):
with open(directory / "launch_env.sh", "w") as f:
f.write(f'export AGNOS_VERSION="{agnos_version}"')
test_symlink = directory / "test_symlink"
if not os.path.exists(str(test_symlink)):
os.symlink("common/version.h", test_symlink)
@pytest.mark.slow # TODO: can we test overlayfs in GHA?
class BaseUpdateTest(unittest.TestCase):
@ -111,6 +115,9 @@ class BaseUpdateTest(unittest.TestCase):
self.assertEqual(get_version(str(self.staging_root / "finalized")), version)
self.assertEqual(get_consistent_flag(), True)
with open(self.staging_root / "finalized" / "test_symlink") as f:
self.assertIn(version, f.read())
def wait_for_condition(self, condition, timeout=12):
start = time.monotonic()
while True:

Loading…
Cancel
Save