refactor: ship the exploit client only; drop the bundled lab harness
ci / macos-latest / py3.12 (push) Canceled after 0s
ci / macos-latest / py3.9 (push) Canceled after 0s
ci / ubuntu-latest / py3.12 (push) Canceled after 0s
ci / ubuntu-latest / py3.9 (push) Canceled after 0s
ci / windows-latest / py3.12 (push) Canceled after 0s
ci / windows-latest / py3.9 (push) Canceled after 0s
ci / macos-latest / py3.12 (push) Canceled after 0s
ci / macos-latest / py3.9 (push) Canceled after 0s
ci / ubuntu-latest / py3.12 (push) Canceled after 0s
ci / ubuntu-latest / py3.9 (push) Canceled after 0s
ci / windows-latest / py3.12 (push) Canceled after 0s
ci / windows-latest / py3.9 (push) Canceled after 0s
- remove lab/ (index.php, apache conf, up/down/status shims) - remove poc/lab.py and the 'poc lab' subcommand - proof path defaults to a fixed per-user dir so the working directory no longer matters - README: target recipe documented instead of shipped
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from poc import outdir
|
||||
|
||||
|
||||
class OutdirTest(unittest.TestCase):
|
||||
def test_path_is_absolute_and_ends_with_out(self):
|
||||
path = outdir.default_outdir()
|
||||
self.assertTrue(os.path.isabs(path))
|
||||
self.assertTrue(path.endswith("out"))
|
||||
|
||||
def test_contains_php2shell(self):
|
||||
self.assertIn("php2shell", outdir.default_outdir())
|
||||
|
||||
def test_honours_env(self):
|
||||
key = "XDG_DATA_HOME" if os.name != "nt" else "LOCALAPPDATA"
|
||||
old = os.environ.get(key)
|
||||
os.environ[key] = os.path.join(os.sep, "tmp" if os.name != "nt" else "C:\\", "poc-env")
|
||||
try:
|
||||
self.assertIn("poc-env", outdir.default_outdir())
|
||||
finally:
|
||||
if old is None:
|
||||
os.environ.pop(key, None)
|
||||
else:
|
||||
os.environ[key] = old
|
||||
|
||||
def test_ensure_creates_directory(self):
|
||||
key = "XDG_DATA_HOME" if os.name != "nt" else "LOCALAPPDATA"
|
||||
old = os.environ.get(key)
|
||||
import tempfile
|
||||
tmp = tempfile.mkdtemp(prefix="poc-out-")
|
||||
os.environ[key] = tmp
|
||||
try:
|
||||
path = outdir.ensure()
|
||||
self.assertTrue(os.path.isdir(path))
|
||||
finally:
|
||||
if old is None:
|
||||
os.environ.pop(key, None)
|
||||
else:
|
||||
os.environ[key] = old
|
||||
Reference in New Issue
Block a user