|
@@ -14,8 +14,7 @@ from smgdc.validate import LinuxBinary
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
|
def game_bin(request) -> LinuxBinary:
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -25,6 +24,14 @@ def game_bin(request) -> LinuxBinary:
|
|
|
|
|
|
|
|
|
|
|
|
+ valid_hashes = {
|
|
|
+
|
|
|
+ "a5a1adde851be2c71f8de73830466cd20f8c34d26ade580d110c4f93c6ef1374",
|
|
|
+
|
|
|
+
|
|
|
+ "6a14d6460086836b710aaed901af3304f791b25409c84d182c6d7662a9e09401",
|
|
|
+ }
|
|
|
+
|
|
|
path_string = os.environ.get("TF_LINUX_BINARY")
|
|
|
if not path_string:
|
|
|
pytest.skip("No Linux binary given")
|
|
@@ -32,7 +39,7 @@ def game_bin(request) -> LinuxBinary:
|
|
|
bin_path = pathlib.Path(path_string)
|
|
|
with bin_path.open("rb") as f:
|
|
|
h = hashlib.file_digest(f, "sha256")
|
|
|
- if h.hexdigest() != "a5a1adde851be2c71f8de73830466cd20f8c34d26ade580d110c4f93c6ef1374":
|
|
|
+ if h.hexdigest() not in valid_hashes:
|
|
|
pytest.skip("Incorrect Linux binary")
|
|
|
|
|
|
return LinuxBinary(bin_path)
|