diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index ba09bdaca3..79b0173bd1 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -4,7 +4,7 @@ Thanks for contributing to Pwntools! When reporting an issue, be sure that you are running the latest released version of pwntools (`pip install --upgrade pwntools`). -Please verify that your issue occurs on 64-bit Ubuntu 14.04. You can use the Dockerfile on `docker.io` for quick testing. +Please verify that your issue occurs on 64-bit Ubuntu 22.04. You can use the Dockerfile on `docker.io` for quick testing. ``` $ docker pull pwntools/pwntools:stable diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca1da827c9..697bd9a6d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,9 +7,6 @@ jobs: matrix: python_version: ['3.10', '3.12'] os: [ubuntu-latest] - include: - - python_version: '2.7' - os: ubuntu-22.04 runs-on: ${{ matrix.os }} timeout-minutes: 30 services: @@ -66,17 +63,8 @@ jobs: sudo apt-get update && sudo apt-get install -y python3-pip gdb gdbserver /usr/bin/python -m pip install --break-system-packages rpyc || /usr/bin/python -m pip install rpyc gdb --batch --quiet --nx --nh --ex 'py import rpyc; print(rpyc.version.version)' - - - name: Cache for pip - uses: actions/cache@v4 - if: matrix.python_version == '2.7' - with: - path: ~/.cache/pip - key: ${{ matrix.os }}-${{ matrix.python_version }}-cache-pip-${{ hashFiles('**/pyproject.toml', '**/requirements*.txt') }} - restore-keys: ${{ matrix.os }}-${{ matrix.python_version }}-cache-pip- - name: Set up Python ${{ matrix.python_version }} - if: matrix.python_version != '2.7' uses: actions/setup-python@v5 with: python-version: ${{ matrix.python_version }} @@ -85,17 +73,6 @@ jobs: **/pyproject.toml **/requirements*.txt - - name: Set up Python 2.7 - if: matrix.python_version == '2.7' - run: | - sudo apt-get update - sudo apt-get install -y \ - python2.7 python2.7-dev python2-pip-whl - sudo ln -sf python2.7 /usr/bin/python - export PYTHONPATH=`echo /usr/share/python-wheels/pip-*py2*.whl` - sudo --preserve-env=PYTHONPATH python -m pip install --upgrade pip setuptools wheel - sudo chown -R $USER /usr/local/lib/python2.7 - - name: Verify tag against version if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') @@ -155,10 +132,6 @@ jobs: - name: Install documentation dependencies run: pip install -r docs/requirements.txt - - name: Manually install non-broken Unicorn - if: matrix.python_version == '2.7' - run: pip install unicorn==2.0.0rc7 - - name: Disable yama ptrace_scope run: | echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope # required by some gdb doctests @@ -244,7 +217,6 @@ jobs: pwn libcdb hash b229d1da1e161f95e839cf90cded5f719e5de308 - name: Build source and wheel distributions - if: matrix.python_version != '2.7' run: | python -m build diff --git a/README.md b/README.md index 464b007cbc..afe7eb702a 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,9 @@ To get you started, we've provided some example solutions for past CTF challenge # Installation -Pwntools is best supported on 64-bit Ubuntu LTS releases (18.04, 20.04, 22.04, and 24.04). Most functionality should work on any Posix-like distribution (Debian, Arch, FreeBSD, OSX, etc.). +Pwntools is best supported on 64-bit Ubuntu LTS releases (22.04 and 24.04). Most functionality should work on any Posix-like distribution (Debian, Arch, FreeBSD, OSX, etc.). -Python3 is suggested, but Pwntools still works with Python 2.7. Most of the functionality of pwntools is self-contained and Python-only. You should be able to get running quickly with +Pwntools requires Python 3.10 since version 5.0.0. Use Pwntools 4.x for older versions as well as Python 2.7. Most of the functionality of pwntools is self-contained and Python-only. You should be able to get running quickly with ```sh sudo apt-get update diff --git a/TESTING.md b/TESTING.md index 4674e565bb..8c4f2e80a6 100644 --- a/TESTING.md +++ b/TESTING.md @@ -4,7 +4,7 @@ Pwntools makes extensive use of unit tests and integration tests to ensure every ## Test Suite -To run the test suite, it is best to use Ubuntu 12.04 or 14.04, and run the following commands. **Be aware** that this will add a user to the machine, and create a public key for SSH login! +To run the test suite, it is best to use Ubuntu 22.04 or 24.04, and run the following commands. **Be aware** that this will add a user to the machine, and create a public key for SSH login! ```sh bash travis/install.sh @@ -15,7 +15,7 @@ PWNLIB_NOTERM=1 make -C docs doctest ## Testing in Docker -A `Dockerfile` has been provided which has a clean testing environment with Ubuntu Xenial. It is very similar to the online Travis CI testing environment, but uses a more modern version of Ubuntu. +A `Dockerfile` has been provided which has a clean testing environment with Ubuntu Jammy. It is very similar to the online Github Actions CI testing environment, but uses a more modern version of Ubuntu. See `travis/docker/README.md` for more information. diff --git a/docs/requirements.txt b/docs/requirements.txt index f9da2e5250..28a5f0b51c 100755 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,15 +2,13 @@ capstone coverage[toml] python-dateutil doc2dash -docutils<0.18; python_version<'3' -docutils>=0.18; python_version>='3' +docutils>=0.18 intervaltree isort mako>=1.0.0 paramiko>=1.15.2 pip>=6.0.8 -pyelftools>=0.29, <0.30; python_version<'3' -pyelftools>=0.29; python_version>='3' +pyelftools>=0.29 pygments>=2.0 pypandoc pyserial>=2.7 @@ -18,7 +16,6 @@ pysocks psutil requests>=2.5.1 ropgadget>=5.3 -sphinx==1.8.6; python_version<'3' -sphinx>=7.0.0; python_version>='3' +sphinx>=7.0.0 sphinx_rtd_theme sphinxcontrib-autoprogram<=0.1.5 diff --git a/docs/source/conf.py b/docs/source/conf.py index d908e24360..7c0a5b183f 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -99,7 +99,6 @@ def __setattr__(self, name, value): travis_ci = os.environ.get('USER') == 'travis' local_doctest = os.environ.get('USER') == 'pwntools' skip_android = True -is_python2 = six.PY2 ''' autoclass_content = 'both' @@ -388,7 +387,6 @@ def linkcode_resolve(domain, info): # -- Customization to Sphinx autodoc generation -------------------------------------------- -import sphinx.ext.autodoc # Test hidden members (e.g. def _foo(...)) def dont_skip_any_doctests(app, what, name, obj, skip, options): @@ -396,53 +394,16 @@ def dont_skip_any_doctests(app, what, name, obj, skip, options): autodoc_default_options = {'special-members': None, 'private-members': None} -class _DummyClass(object): pass - -class Py2OutputChecker(_DummyClass, doctest.OutputChecker): - def check_output(self, want, got, optionflags): - sup = super(Py2OutputChecker, self).check_output - if sup(want, got, optionflags): - return True - try: - rly_want = pwnlib.util.safeeval.const(want) - if sup(repr(rly_want), got, optionflags): - return True - rly_got = pwnlib.util.safeeval.const(got) - if rly_want == rly_got: - return True - except ValueError: - pass - rly_want = ' '.join(x[:2].replace('b"','"').replace("b'","'")+x[2:] for x in want.replace('\n','\n ').split(' ')).replace('\n ','\n') - if sup(rly_want, got, optionflags): - return True - rly_want = ' '.join(x[:2].replace('b"',' "').replace("b'"," '")+x[2:] for x in want.replace('\n','\n ').split(' ')).replace('\n ','\n') - if sup(rly_want, got, optionflags): - return True - for wantl, gotl in six.moves.zip_longest(want.splitlines(), got.splitlines(), fillvalue=''): - rly_want1 = '['.join(x[:2].replace('b"','"').replace("b'","'")+x[2:] for x in wantl.split('[')) - rly_want2 = ' '.join(x[:2].replace('b"',' "').replace("b'"," '")+x[2:] for x in wantl.split(' ')) - if not sup(rly_want1, gotl, optionflags) and not sup(rly_want2, gotl, optionflags): - return False - return True - -def py2_doctest_init(self, checker=None, verbose=None, optionflags=0): - if checker is None: - checker = Py2OutputChecker() - doctest.DocTestRunner.__init__(self, checker, verbose, optionflags) - if 'doctest' in sys.argv: def setup(app): pass # app.connect('autodoc-skip-member', dont_skip_any_doctests) - if sys.version_info[:1] < (3,): - import sphinx.ext.doctest - sphinx.ext.doctest.SphinxDocTestRunner.__init__ = py2_doctest_init - else: - # monkey patching paramiko due to https://github.com/paramiko/paramiko/pull/1661 - import paramiko.client - import binascii - paramiko.client.hexlify = lambda x: binascii.hexlify(x).decode() - paramiko.util.safe_string = lambda x: '' # function result never *actually used* + # monkey patching paramiko due to https://github.com/paramiko/paramiko/pull/1661 + import paramiko.client + import binascii + paramiko.client.hexlify = lambda x: binascii.hexlify(x).decode() + paramiko.util.safe_string = lambda x: '' # function result never *actually used* + class EndlessLoop(Exception): pass def alrm_handler(sig, frame): signal.alarm(180) # three minutes diff --git a/docs/source/install.rst b/docs/source/install.rst index 2087826a63..dfc0da91ed 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -1,7 +1,7 @@ Installation ============ -Pwntools is best supported on 64-bit Ubuntu LTS releases (14.04, 16.04, 18.04, and 20.04). Most functionality should work on any Posix-like distribution (Debian, Arch, FreeBSD, OSX, etc.). +Pwntools is best supported on 64-bit Ubuntu LTS releases (22.04 and 24.04). Most functionality should work on any Posix-like distribution (Debian, Arch, FreeBSD, OSX, etc.). Prerequisites ------------- @@ -37,6 +37,8 @@ Python3 Python2 (Deprecated) ^^^^^^^^^^^^^^^^^^^^ +Python2 support has been removed in Pwntools v5.0.0. The last version to support Python2 was v4.15.0. + NOTE: Pwntools maintainers STRONGLY recommend using Python3 for all future Pwntools-based scripts and projects. Additionally, due to `pip` dropping support for Python2, a specfic version of `pip` must be installed. diff --git a/extra/docker/base/Dockerfile b/extra/docker/base/Dockerfile index 0d07c33f56..052de97636 100644 --- a/extra/docker/base/Dockerfile +++ b/extra/docker/base/Dockerfile @@ -20,9 +20,6 @@ RUN apt-get update \ git \ libssl-dev \ libffi-dev \ - python2.7 \ - python2.7-dev \ - python2-pip-whl \ python3 \ python3-pip \ python3-dev \ @@ -40,8 +37,6 @@ RUN apt-get update \ patchelf \ && locale-gen en_US.UTF-8 \ && update-locale LANG=en_US.UTF-8 \ - && PYTHONPATH=`echo /usr/share/python-wheels/pip-*.whl` python2.7 -m pip install --no-cache-dir --upgrade pip setuptools wheel \ - && python2.7 -m pip install --no-cache-dir --upgrade pwntools \ && python3 -m pip install --no-cache-dir --upgrade pip \ && python3 -m pip install --no-cache-dir --upgrade pwntools \ && PWNLIB_NOTERM=1 pwn update \ diff --git a/extra/docker/beta/Dockerfile b/extra/docker/beta/Dockerfile index a83bd0f4ef..65f0d25ac1 100644 --- a/extra/docker/beta/Dockerfile +++ b/extra/docker/beta/Dockerfile @@ -1,7 +1,6 @@ FROM pwntools/pwntools:stable USER root -RUN python2.7 -m pip install --no-cache-dir --upgrade git+https://github.com/Gallopsled/pwntools@beta \ - && python3 -m pip install --no-cache-dir --force-reinstall --upgrade git+https://github.com/Gallopsled/pwntools@beta +RUN python3 -m pip install --no-cache-dir --force-reinstall --upgrade git+https://github.com/Gallopsled/pwntools@beta RUN PWNLIB_NOTERM=1 pwn update USER pwntools diff --git a/extra/docker/buster/Dockerfile b/extra/docker/buster/Dockerfile deleted file mode 100644 index 33a9491d62..0000000000 --- a/extra/docker/buster/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -from debian:buster - -RUN apt-get update -RUN apt-get -y dist-upgrade -RUN apt-get -y install python3 python3-pip -RUN apt-get -y install git wget unzip - -RUN pip3 install --no-cache-dir --upgrade git+https://github.com/Gallopsled/pwntools@dev \ No newline at end of file diff --git a/extra/docker/dev/Dockerfile b/extra/docker/dev/Dockerfile index 77d04d3310..19579a9169 100644 --- a/extra/docker/dev/Dockerfile +++ b/extra/docker/dev/Dockerfile @@ -1,7 +1,6 @@ FROM pwntools/pwntools:stable USER root -RUN python2.7 -m pip install --upgrade git+https://github.com/Gallopsled/pwntools@dev \ - && python3 -m pip install --force-reinstall --upgrade git+https://github.com/Gallopsled/pwntools@dev +RUN python3 -m pip install --force-reinstall --upgrade git+https://github.com/Gallopsled/pwntools@dev RUN PWNLIB_NOTERM=1 pwn update USER pwntools diff --git a/extra/docker/develop/Dockerfile b/extra/docker/develop/Dockerfile index c2845c5b51..d3b8a879c8 100644 --- a/extra/docker/develop/Dockerfile +++ b/extra/docker/develop/Dockerfile @@ -5,8 +5,7 @@ ENV HISTFILE=/home/pwntools/.history # Uninstall existing versions of pwntools USER root -RUN python2.7 -m pip uninstall -q -y pwntools \ - && python3 -m pip uninstall -q -y pwntools +RUN python3 -m pip uninstall -q -y pwntools # Switch back to the pwntools user from here forward USER pwntools @@ -18,17 +17,14 @@ ENV PATH="/home/pwntools/.local/bin:${PATH}" # Install Pwntools to the home directory, make it an editable install RUN git clone https://github.com/Gallopsled/pwntools \ - && python2.7 -m pip install --upgrade --editable pwntools \ && python3 -m pip install --upgrade --editable pwntools \ && PWNLIB_NOTERM=1 pwn version # Requirements for running the tests -RUN python2.7 -m pip install --upgrade --requirement pwntools/docs/requirements.txt \ - && python3 -m pip install --upgrade --requirement pwntools/docs/requirements.txt +RUN python3 -m pip install --upgrade --requirement pwntools/docs/requirements.txt # Python niceties for debugging -RUN python2.7 -m pip install -U ipython ipdb \ - && python3 -m pip install -U ipython ipdb +RUN python3 -m pip install -U ipython ipdb # Dependencies from .travis.yml addons -> apt -> packages ARG DEBIAN_FRONTEND=noninteractive diff --git a/extra/docker/stable/Dockerfile b/extra/docker/stable/Dockerfile index aa241c1fb8..d896184725 100644 --- a/extra/docker/stable/Dockerfile +++ b/extra/docker/stable/Dockerfile @@ -1,7 +1,6 @@ FROM pwntools/pwntools:base USER root -RUN python2.7 -m pip install --no-cache-dir --upgrade git+https://github.com/Gallopsled/pwntools@stable \ - && python3 -m pip install --no-cache-dir --force-reinstall --upgrade git+https://github.com/Gallopsled/pwntools@stable +RUN python3 -m pip install --no-cache-dir --force-reinstall --upgrade git+https://github.com/Gallopsled/pwntools@stable RUN PWNLIB_NOTERM=1 pwn update USER pwntools diff --git a/pwnlib/gdb.py b/pwnlib/gdb.py index 9dd509360b..ae7d03c864 100644 --- a/pwnlib/gdb.py +++ b/pwnlib/gdb.py @@ -587,9 +587,6 @@ def debug(args, gdbscript=None, gdb_args=None, exe=None, ssh=None, env=None, por Using GDB Python API: - .. doctest:: - :skipif: is_python2 - Debug a new process >>> io = gdb.debug(['echo', 'foo'], api=True) @@ -988,9 +985,6 @@ def attach(target, gdbscript = '', exe = None, gdb_args = None, ssh = None, sysr Using GDB Python API: - .. doctest:: - :skipif: is_python2 - >>> io = process('bash') Attach a debugger diff --git a/pyproject.toml b/pyproject.toml index 1e394d838d..b0672e5329 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=44.0", "wheel", "toml; python_version<'3.4'"] +requires = ["setuptools>=61.0", "wheel"] build-backend = "setuptools.build_meta" [project] @@ -19,7 +19,6 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: POSIX :: Linux", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Security", "Topic :: Software Development :: Assemblers", @@ -32,13 +31,12 @@ classifiers = [ ] keywords = ["pwntools", "exploit", "ctf", "capture", "the", "flag", "binary", "wargame", "overflow", "stack", "heap", "defcon"] -requires-python = ">=2.7" +requires-python = ">=3.10" dependencies = [ "paramiko>=1.15.2", "mako>=1.0.0", - "pyelftools>=0.29, <0.30; python_version < '3'", - "pyelftools>=0.29; python_version >= '3'", - "capstone>=3.0.5rc2", # see Gallopsled/pwntools#971, Gallopsled/pwntools#1160 + "pyelftools>=0.29", + "capstone>=4.0.0", "ropgadget>=5.3", "pyserial>=2.7", "requests>=2.0", @@ -53,10 +51,8 @@ dependencies = [ "unicorn>=2.0.1", "six>=1.12.0", "rpyc", - "colored_traceback<0.4; python_version < '3'", - "colored_traceback; python_version >= '3'", - "pathlib2; python_version < '3.4'", - "unix-ar; python_version >= '3'", + "colored_traceback", + "unix-ar", "zstandard", ] @@ -83,7 +79,9 @@ omit = [ source = [ "pwn", "pwnlib", - "~/.cache/.pwntools-cache-2.7/", "~/.cache/.pwntools-cache-3.10/", + "~/.cache/.pwntools-cache-3.11/", + "~/.cache/.pwntools-cache-3.12/", + "~/.cache/.pwntools-cache-3.13/", ] disable_warnings = ["module-not-imported"] diff --git a/setup.py b/setup.py index 6f6cdd10d2..80ffe5c06b 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -from __future__ import print_function import glob import os @@ -8,7 +7,6 @@ from distutils.sysconfig import get_python_inc from distutils.util import convert_path -from setuptools import find_packages from setuptools import setup # Get all template files @@ -23,14 +21,6 @@ console_scripts = ['pwn=pwnlib.commandline.main:main'] -# Find all of the ancillary console scripts -# We have a magic flag --include-all-scripts -flag = '--only-use-pwn-command' -if flag in sys.argv: - sys.argv.remove(flag) -else: - flag = False - DEPRECATED_SCRIPTS= [ 'asm', # 'checksec', @@ -63,21 +53,7 @@ script = '%s=pwnlib.commandline.common:deprecated_main' % filename else: script = '%s=pwnlib.commandline.common:main' % filename - if not flag: - console_scripts.append(script) - -compat = {} -if sys.version_info < (3, 4): - import site - - import toml - project = toml.load('pyproject.toml')['project'] - compat['packages'] = find_packages() - compat['install_requires'] = project['dependencies'] - compat['name'] = project['name'] - # https://github.com/pypa/pip/issues/7953 - site.ENABLE_USER_SITE = "--user" in sys.argv[1:] - + console_scripts.append(script) # Check that the user has installed the Python development headers PythonH = os.path.join(get_python_inc(), 'Python.h') @@ -102,5 +78,4 @@ ] + templates, }, entry_points = {'console_scripts': console_scripts}, - **compat ) diff --git a/travis/docker/Dockerfile b/travis/docker/Dockerfile index d04663cea0..bcd15fcde7 100644 --- a/travis/docker/Dockerfile +++ b/travis/docker/Dockerfile @@ -5,8 +5,7 @@ ENV HISTFILE=/home/pwntools/.history # Uninstall existing versions of pwntools USER root -RUN python2.7 -m pip uninstall -q -y pwntools \ - && python3 -m pip uninstall -q -y pwntools +RUN python3 -m pip uninstall -q -y pwntools # Switch back to the pwntools user from here forward USER pwntools @@ -18,17 +17,14 @@ ENV PATH="/home/pwntools/.local/bin:${PATH}" # Install Pwntools to the home directory, make it an editable install RUN git clone https://github.com/Gallopsled/pwntools \ - && python2.7 -m pip install --no-cache-dir --upgrade --editable pwntools \ - && python3 -m pip install --no-cache-dir --upgrade --editable pwntools \ + && python3 -m pip install --upgrade --editable pwntools \ && PWNLIB_NOTERM=1 pwn version # Requirements for running the tests -RUN python2.7 -m pip install --no-cache-dir --upgrade --requirement pwntools/docs/requirements.txt \ - && python3 -m pip install --no-cache-dir --upgrade --requirement pwntools/docs/requirements.txt +RUN python3 -m pip install --upgrade --requirement pwntools/docs/requirements.txt # Python niceties for debugging -RUN python2.7 -m pip install --no-cache-dir -U ipython ipdb \ - && python3 -m pip install --no-cache-dir -U ipython ipdb +RUN python3 -m pip install -U ipython ipdb # Dependencies from .travis.yml addons -> apt -> packages ARG DEBIAN_FRONTEND=noninteractive @@ -86,8 +82,7 @@ ADD ipython_config.py /home/pwntools/.ipython/profile_default RUN echo "pwntools ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/travis # Some additional debugging tools that are useful -RUN python2.7 -m pip install --no-cache-dir ipdb && \ - python3 -m pip install --no-cache-dir ipdb +RUN python3 -m pip install --no-cache-dir ipdb # Install debugging utilities USER root @@ -127,14 +122,14 @@ RUN mkdir -m 0700 ~/.ssh && \ # Add the doctest entrypoint to /usr/bin so we don't have to supply the full path USER root -ADD doctest2 doctest3 /usr/bin +ADD doctest3 /usr/bin # Switch back to pwntools to actually run the image USER pwntools WORKDIR /home/pwntools # Copy in the Doctest script -COPY doctest2 doctest3 tmux.sh /home/pwntools +COPY doctest3 tmux.sh /home/pwntools # Do everything in UTF-8 mode! ENV LANG=C.UTF-8 diff --git a/travis/docker/Dockerfile.travis b/travis/docker/Dockerfile.travis index 4346d87990..2729d3923b 100644 --- a/travis/docker/Dockerfile.travis +++ b/travis/docker/Dockerfile.travis @@ -1,7 +1,6 @@ # Some additional debugging tools that are useful -RUN python2.7 -m pip install --no-cache-dir ipdb && \ - python3 -m pip install --no-cache-dir ipdb +RUN python3 -m pip install --no-cache-dir ipdb # Install debugging utilities USER root @@ -41,14 +40,14 @@ RUN mkdir -m 0700 ~/.ssh && \ # Add the doctest entrypoint to /usr/bin so we don't have to supply the full path USER root -ADD doctest2 doctest3 /usr/bin +ADD doctest3 /usr/bin # Switch back to pwntools to actually run the image USER pwntools WORKDIR /home/pwntools # Copy in the Doctest script -COPY doctest2 doctest3 tmux.sh /home/pwntools +COPY doctest3 tmux.sh /home/pwntools # Do everything in UTF-8 mode! ENV LANG=C.UTF-8 diff --git a/travis/docker/Makefile b/travis/docker/Makefile index 50aa8cf7ee..0b4c1b7ef2 100644 --- a/travis/docker/Makefile +++ b/travis/docker/Makefile @@ -18,7 +18,7 @@ shell bash: image --entrypoint ./tmux.sh \ travis -doctest2 doctest3: image FORCE +doctest3: image FORCE @echo Running doctests docker run -it --privileged --net=host --hostname localhost \ --ulimit core=-1:-1 \ @@ -31,4 +31,4 @@ image: Dockerfile docker build -t travis . FORCE: -.PHONY: all image doctest2 doctest3 bash +.PHONY: all image doctest3 bash diff --git a/travis/docker/README.md b/travis/docker/README.md index 7aae9f7db7..fad3bda6b5 100644 --- a/travis/docker/README.md +++ b/travis/docker/README.md @@ -9,12 +9,6 @@ $ make -C travis/docker ANDROID=yes $ make -C travis/docker ANDROID=no TARGET=ssh.rst ``` -By default the Python 3 tests are run. You can choose the Python version using the `doctest2` or `doctest3` target. - -```shell -$ make -C travis/docker ANDROID=no doctest2 -``` - You can get drop into a tmux session in the container to debug tests using the `shell` or `bash` targets. ```shell diff --git a/travis/docker/doctest2 b/travis/docker/doctest2 deleted file mode 100755 index bad37834d3..0000000000 --- a/travis/docker/doctest2 +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash - -reset - -# We have to explicitly start the ssh service -sudo service ssh start - -# Enable the IPv6 interface -echo 0 | sudo tee /proc/sys/net/ipv6/conf/all/disable_ipv6 - -# Run the tests from the repo -cd ~ - -ORIG_TARGET="$TARGET" - -if [ -n "$TARGET" ]; then - TARGET=$(find ~/pwntools/docs/source -iname "$TARGET") - - if [ -z "$TARGET" ]; then - echo "Could not find target $ORIG_TARGET" - exit 1 - fi - - echo "DOCTEST TARGET is $TARGET" -fi - -# GDB tests currently don't work inside Docker for unknown reasons. -# Disable these tests until we can get them working. -echo > ~/pwntools/docs/source/gdb.rst - -# Android tests are disabled in general, support is deprecateds -echo > ~/pwntools/docs/source/adb.rst -echo > ~/pwntools/docs/source/protocols.rst - -export PWNLIB_NOTERM=1 -python2.7 -bb -m coverage run -m sphinx -b doctest $HOME/pwntools/docs/source $HOME/pwntools/docs/build/doctest $TARGET -