diff --git a/scripts/sanitycheck b/scripts/sanitycheck index d55bf021533..20b4b02d0c0 100755 --- a/scripts/sanitycheck +++ b/scripts/sanitycheck @@ -1740,7 +1740,7 @@ class TestCase: def get_unique(self, testcase_root, workdir, name): canonical_testcase_root = os.path.realpath(testcase_root) - if canonical_testcase_root.startswith(canonical_zephyr_base): + if Path(canonical_zephyr_base) in Path(canonical_testcase_root).parents: # This is in ZEPHYR_BASE, so include path in name for uniqueness # FIXME: We should not depend on path of test for unique names. relative_tc_root = os.path.relpath(canonical_testcase_root,