Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update EFI load option UUID #415

Merged
merged 5 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Define hexdump textconv with "git config diff.efivars.textconv hd"
tests/efivars/* diff=efivars
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+++ b/tests/efivars/PlatformLangCodes-8be4df61-93ca-11d2-aa0d-00e098032b8c
@@ -0,0 +1,3 @@
+00000000  06 00 00 00 65 6e 3b 66  72 3b 65 6e 2d 55 53 3b  |....en;fr;en-US;|
+00000010  66 72 2d 46 52 00                                 |fr-FR.|
+00000016

Interesting, I wonder where French came from?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷 This comes from TianoCore (EDK2), so my guess is someone bothered to do French translations for it. Yeah, now I see some translations.

2 changes: 2 additions & 0 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ TESTS = \
EXTRA_DIST = \
$(TESTS) \
__init__.py \
conftest.py \
efivars \
test_image_boot.py \
test_live_storage.py \
test_migrate_chromium_profile.py \
Expand Down
28 changes: 28 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2024 Endless OS Foundation LLC
# SPDX-License-Identifier: GPL-2.0-or-later

# pytest fixtures

import pytest
from shutil import copyfile, copytree

from .util import EFIVARFS_PATH


@pytest.fixture
def efivarfs(tmp_path, monkeypatch):
"""Temporary efivarfs data

Copy the test efivarfs data to a temporary location. The environment
variable EFIVARFS_PATH is set to the temporary location. This is supported
by libefivar.
"""
# Only the data is copied in case EFIVARFS_PATH is read only like
# during distcheck. None of the metadata matters here.
tmp_efivarfs = tmp_path / 'efivars'
copytree(EFIVARFS_PATH, tmp_efivarfs, copy_function=copyfile)

# libefivar expects this to end with a trailing /.
monkeypatch.setenv('EFIVARFS_PATH', f'{tmp_efivarfs}/')

return tmp_efivarfs
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
import importlib.machinery
import importlib.util
import os
from pathlib import Path
import subprocess
import tempfile
import unittest

TESTS_PATH = Path(__file__).parent.resolve()
EFIVARFS_PATH = TESTS_PATH / 'efivars'

run_needs_root_tests = bool(os.environ.get('EBH_ROOT_TESTS'))
needs_root = unittest.skipIf(not run_needs_root_tests,
Expand Down