Commit Graph

10 Commits

Author SHA1 Message Date
Gulshan Singh b9c9f12efc Add qemu tests to CI 2023-01-25 03:32:17 -08:00
Disconnect3d f78e3250c7
Fix archlinux ci tests (#1411)
* Fix Arch CI: install missing netcat (#1400)

The arch linux test_command_procinfo was failing bcoz the netcat was not
installed on arch build. This commit fixes it by:
1) installing gnu-netcat for arch linux setup-dev.sh
2) asserting that nc is available in the test itself, to prevent similar
   regressions from happening on future/newer images

* Fix Arch CI: the load binary tests (#1400)

Before this commit we asserted whether the loaded binary in tests report
to find or not find debug symbols but this is irrelevant for the thing
we want to test there which is: pwndbg loading. What eventually cares is
whether Pwndbg got loaded and didn't raise an exception.

This commit fixes those tests so they should now work also on ArchLinux
CI and on all CI builds.

Additionally, it removes the `compile_binary` test utility function
which was redundant as we compile all test binaries via a makefile.

* fix lint

* cleanup tests/binaries/div_zero_binary
2022-12-03 17:10:08 +01:00
Disconnect3d c6ab8dc671
Fix vmmap coredump test (#1391)
* fix shlint

* Fix crash when unable to get ehdr and fix vmmap coredump test

This commit fixes two issues and test them.

1. It changes the reads in `get_ehdr` to partial reads so that inability
   to read the `vmmap.start` address there will not crash Pwndbg with
`gdb.error` but instead we will simply return `None` as expected from
this function. This crash could happen on Debian 10 (GDB 8.2.1) and
Ubuntu 18.04 (not sure which GDB) when you did:
- gdb ./binary-that-crashes
- `run`
- `generate-core-file /tmp/core`
- `file` - to unload the binary
- `core-file /tmp/core` - to load the generated core

At this point I think we may have preserved the old vmmap info and use
it in `get_ehdr` maybe, which then crashed? I am not sure, but this fix
here works.

To test this behavior properly I also added the `unload_file`
parametrization to the
`test_command_vmmap_on_coredump_on_crash_simple_binary` test.

2. We fix the vmmap coredump test case when the `info proc mappings` returns nothing on core
   dumps on old GDBs. In such case we are missing the vmmap info about
the binary mapping, so now we properly remove it in the test.
2022-11-22 21:15:39 +01:00
Disconnect3d 117e69f842
tests reference-binary.c: dont rely on connect to 1.1.1.1 (#1390) 2022-11-22 21:02:42 +01:00
Xeonacid 1224cf75ef
Support Arch Linux docker test (#1378)
* Specify dockerfile for ubuntu/debian

To add Dockerfile.arch later

* Support Arch Linux docker test

* Fix setup-dev supported distro

* Create set_zigpath function

* Download zig from upstream for archlinux

* Add hash as part of key for docker cache

as https://github.com/satackey/action-docker-layer-caching#inputs notes.
2022-11-22 19:21:40 +01:00
Gulshan Singh ac5a6ebe64
Minor lint and pre-hook changes (#1349) 2022-10-25 17:46:53 -07:00
ruijia-zhou 6252b3f666
Install a git pre-push lint hook as part of setup-test-tools.sh (#1345)
* Update windbg.py

* Update hexdump.py

* Update hexdump.py

* Update hexdump.py

* Update hexdump.py

* Update hexdump.py

* Update hexdump.py

* Update windbg.py

* Update windbg.py

* Update hexdump.py

* Update hexdump.py

* Update typeinfo.py

* Update hexdump.py

* Update windbg.py

* Update setup-dev.sh

* Update setup-dev.sh

* Update setup-dev.sh

* Update setup-dev.sh

* Update hexdump.py

* Update typeinfo.py

* Update windbg.py

* Update setup-dev.sh

* Update setup-dev.sh
2022-10-25 09:05:57 -07:00
Gulshan Singh f94bc27cb1
Run tests in parallel with GNU parallel (#1332) 2022-10-23 17:21:24 -07:00
Gulshan Singh 7efaa33b0c
Install shfmt on Ubuntu 22.04, otherwise skip running linter (#1323) 2022-10-23 01:33:00 +02:00
Gulshan Singh b0b6a8fa30
Rename setup-test-tools.sh to setup-dev.sh (#1320) 2022-10-22 09:50:48 -07:00