mirror of
https://github.com/trustedsec/hate_crack.git
synced 2026-07-28 14:47:22 -07:00
feat: add Lima VM E2E tests and fix princeprocessor build
Add Ubuntu 24.04 Lima VM test track that runs hate_crack installation end-to-end in a real VM, giving higher confidence than Docker-based tests. - Add lima/hate-crack-test.yaml: Ubuntu 24.04 VM config with hashcat and build deps pre-installed via apt; uv installed via official installer - Add tests/test_lima_vm_install.py: mirrors Docker E2E test structure; uses rsync with targeted excludes (wordlists, compiled host binaries) and builds wheel directly to avoid setuptools-scm sdist file filtering - Fix Makefile: add princeprocessor build step with aarch64-compatible CFLAGS (drops -m64); copy binary to submodule root for vendor-assets - Add Lima tests to prek.toml pre-push hook - Document Lima VM tests in TESTING.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
8469f5338c
commit
4a7b12adbb
+26
@@ -90,6 +90,7 @@ By default, external service checks are skipped. Enable them explicitly:
|
||||
- `HATE_CRACK_RUN_LIVE_HASHVIEW_TESTS=1` — run live Hashview wordlist upload tests
|
||||
- `HATE_CRACK_RUN_E2E=1` — run end-to-end local installation tests
|
||||
- `HATE_CRACK_RUN_DOCKER_TESTS=1` — run Docker-based end-to-end tests
|
||||
- `HATE_CRACK_RUN_LIMA_TESTS=1` — run Lima VM-based end-to-end tests (requires Lima installed)
|
||||
|
||||
When `HASHMOB_TEST_REAL` is enabled, tests will still skip if Hashmob returns errors like HTTP 523 (origin unreachable).
|
||||
|
||||
@@ -110,6 +111,7 @@ Highlights:
|
||||
7. UI menu options (all attack modes)
|
||||
8. Hashcat-utils submodule verification
|
||||
9. Docker and E2E installation tests (opt-in)
|
||||
10. Lima VM installation tests (opt-in)
|
||||
|
||||
## Benefits
|
||||
|
||||
@@ -151,8 +153,32 @@ HATE_CRACK_RUN_E2E=1 uv run pytest tests/test_e2e_local_install.py -v
|
||||
|
||||
# Run Docker tests
|
||||
HATE_CRACK_RUN_DOCKER_TESTS=1 uv run pytest tests/test_docker_script_install.py -v
|
||||
|
||||
# Run Lima VM tests
|
||||
# Prerequisite: brew install lima
|
||||
HATE_CRACK_RUN_LIMA_TESTS=1 uv run pytest tests/test_lima_vm_install.py -v
|
||||
```
|
||||
|
||||
## Lima VM Tests
|
||||
|
||||
`tests/test_lima_vm_install.py` runs hate_crack inside a real Ubuntu 24.04 VM via [Lima](https://lima-vm.io/). Unlike the Docker tests, this exercises a real kernel and full Ubuntu userspace, giving higher confidence that installation works on the distros users actually run.
|
||||
|
||||
**Prerequisites:**
|
||||
|
||||
```bash
|
||||
brew install lima
|
||||
```
|
||||
|
||||
**Run:**
|
||||
|
||||
```bash
|
||||
HATE_CRACK_RUN_LIMA_TESTS=1 uv run pytest tests/test_lima_vm_install.py -v
|
||||
```
|
||||
|
||||
**Note:** The first run takes several minutes - the VM provision script runs `apt-get install` for hashcat and all build dependencies. Subsequent runs on the same machine are faster if Lima caches the base image.
|
||||
|
||||
The VM is created with a unique name per test session and deleted automatically in teardown. To verify cleanup: `limactl list`.
|
||||
|
||||
## Note on Real API Testing
|
||||
|
||||
While these mocked tests validate the code logic, you may still want to occasionally run integration tests against a real Hashview instance to ensure the API hasn't changed. The test files can be easily modified to toggle between mocked and real API calls if needed.
|
||||
|
||||
Reference in New Issue
Block a user