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

Add RPC-based tests #254

Closed
wants to merge 6 commits into from
Closed

Add RPC-based tests #254

wants to merge 6 commits into from

Conversation

zachriggle
Copy link
Contributor

(Note: Duplicate of #170 with the PR coming from my fork)

Allow testing Pwndbg itself by embedding an XMLRPC server inside the GDB instance, which exposes both the gdb and pwndbg modules, as well as eval.

Since the default XMLRPC behavior is terrible and doesn't know how to marshall any of the following:

  • bytearray object
  • bytes object
  • str or unicode with embedded \x00

We hack both the Marshaller and Unmarshaller to support a new datatype.

@zachriggle zachriggle self-assigned this Apr 28, 2017
@zachriggle zachriggle added the enhancement For enhancements to existing features label Apr 28, 2017
@disconnect3d
Copy link
Member

disconnect3d commented Nov 25, 2017

Do I understand correctly that the idea behind this is to be able to launch unit tests over easily testable functions (the ones that doesn't need running program under the hood)? As I guess we won't want to mock everything around (pwndbg.proc.*, getting memory and stuff).

Do we really need it so complicated? I mean, we probably could have something like:

  • launch gdb
  • send a pi import pwndbg.tests; pwndbg.tests.run()
  • gather results

At least for the functions that doesn't need a process under the hood (well we could mock stuff but it might be painful/hard?).

We could also start with having some end to end tests that would be produced manually, launched with predefined environment (envvars, config, theme) and just checked for this exact output for given list of commands.
E2E tests could also hook some interesting functions - the ones that instead of printing return specific values (e.g. list of Page objects etc).

@zachriggle
Copy link
Contributor Author

zachriggle commented Nov 26, 2017 via email

@disconnect3d
Copy link
Member

disconnect3d commented Nov 26, 2017

@zachriggle still how are we going to test commands that use gdb api? By mocking it?
This won't us check easily whether pwndbg works fine with particular gdb version.

@zachriggle
Copy link
Contributor Author

zachriggle commented Nov 26, 2017 via email

@disconnect3d
Copy link
Member

Guess this can be closed due to #375 ?

@zachriggle zachriggle closed this Dec 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For enhancements to existing features
Development

Successfully merging this pull request may close these issues.

2 participants