From e6d118c08cae8c07ddfc3bf90930efa4d20a0d58 Mon Sep 17 00:00:00 2001 From: Gulshan Singh Date: Mon, 31 Oct 2022 15:34:50 -0700 Subject: [PATCH] Don't run pwn commands in test (#1358) --- pwndbg/commands/shell.py | 4 ++-- tests/gdb-tests/tests/test_commands.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pwndbg/commands/shell.py b/pwndbg/commands/shell.py index 1e314c4ee..d905e59d6 100644 --- a/pwndbg/commands/shell.py +++ b/pwndbg/commands/shell.py @@ -7,7 +7,7 @@ import os import pwndbg.commands import pwndbg.lib.which -pwncmds = ["asm", "constgrep", "disasm", "pwn", "unhex"] +pwncmd_names = ["asm", "constgrep", "disasm", "pwn", "unhex"] shellcmd_names = [ "awk", "bash", @@ -60,7 +60,7 @@ shellcmd_names = [ "zsh", ] -pwncmds = list(filter(pwndbg.lib.which.which, pwncmds)) +pwncmds = list(filter(pwndbg.lib.which.which, pwncmd_names)) shellcmds = list(filter(pwndbg.lib.which.which, shellcmd_names)) diff --git a/tests/gdb-tests/tests/test_commands.py b/tests/gdb-tests/tests/test_commands.py index 8a3e2150d..9b60a8df2 100644 --- a/tests/gdb-tests/tests/test_commands.py +++ b/tests/gdb-tests/tests/test_commands.py @@ -5,6 +5,7 @@ import pytest import tests from pwndbg.commands import command_names +from pwndbg.commands.shell import pwncmd_names from pwndbg.commands.shell import shellcmd_names BINARY = tests.binaries.get("heap_bins.out") @@ -21,6 +22,7 @@ disallowed_commands = set( # Don't run any shell commands disallowed_commands.update(shellcmd_names) +disallowed_commands.update(pwncmd_names) filtered_commands = command_names - disallowed_commands @@ -33,6 +35,7 @@ allowed_exceptions = [ ] +# Only run on CI, unless the user requests this with the RUN_FLAKY environment variable running_on_ci = os.getenv("GITHUB_ACTIONS") run_flaky = os.getenv("RUN_FLAKY")