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

Implement tests for gdb-pt-dump #11

Open
martinradev opened this issue Apr 9, 2022 · 2 comments
Open

Implement tests for gdb-pt-dump #11

martinradev opened this issue Apr 9, 2022 · 2 comments

Comments

@martinradev
Copy link
Owner

The project has a bunch of features which are not well-tested and protected against regressions. Tests are necessary to continue development.

@martinradev
Copy link
Owner Author

Tests are in development :)

@martinradev
Copy link
Owner Author

Tests repo: https://github.com/martinradev/gdb-pt-dump-tests
There's still quite a bit of work remaining, but adding tests has had some progress.

martinradev added a commit that referenced this issue Dec 3, 2023
This patch adds minimal integration test infrastructure for
x86_64 and adds 20 integration tests to cover the following
commands under x86_64:
- pt
- pt -kaslr
- pt -has
- pt -after
- pt -before
- pt -range
- pt -filter ...
- pt -ss, pt -s4, p4 -s8

Patch is for issue #11
martinradev added a commit that referenced this issue Dec 9, 2023
This patch adds the infrastructure to generate custom
x86_64 kernels that enter long mode and a generate page
table. Each generated kernel binary generates a single
page table that is chosen at compile time.

For example, this patch adds these 3 tests for page table
generation:
- x86_64_test_entry_setup_4k_page_table_simple.bin
- x86_64_test_entry_setup_4k_page_table_complex.bin
- x86_64_test_entry_setup_2mb_page_table_simple.bin
Each binary is a floppy-disk image.

The binaries can be used to have the QEMU VM's page tables
in a deterministic state. The output can be used to generate
audited golden images that can be in the future compared
against when running integration tests.

Patch is for issue #11
martinradev added a commit that referenced this issue Dec 21, 2023
This patch adds integration tests for aarch64. This is done by
abstracting the test infra to support more than a single vm arch
and then parametrizing the existing integration tests.

This patch also adds a small aarch64 bios for setting up page
tables. This bios is used for the pre-existing aarch64 golden
image testing. Currently, only 3 golden tests are added:
test_granularity_4k, test_granularity_16k, test_granularity_64k

Patch is for issue #11
martinradev added a commit that referenced this issue Dec 24, 2023
This patch adds a simple x86_32 test that covers
pt and pt -ss. The Kolibri OS was chosen since I
had a local floppy image and the OS is fairly
small.

For issue #11
martinradev added a commit that referenced this issue Dec 24, 2023
This patch does the following:
- Adds a fixture to handle init and deinit
- Parametrize Linux kernel image to handle Linux and arch pecularities
  like KPTI and aarch64 page granules.
- Update aarch64's default base image addr to be a list of possible
  addresses.
- Add two debug env variables: GDB_PT_DUMP_TESTS_PAUSE_AFTER_BOOT
  and GDB_PT_DUMP_TESTS_PAUSE_AFTER_BOOT

For issue #11
martinradev added a commit that referenced this issue Dec 24, 2023
martinradev added a commit that referenced this issue Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant