Skip to content

Commit 9ba7e9e

Browse files
committed
Release version 1.5.0 - Auto-detect resume drive
Major enhancement: --resume no longer requires device specification. Tool automatically searches and matches drive by serial number and model. New Features: - Auto-detect resume drive by serial number - Device path independence (drive can change from /dev/sdb to /dev/sdc) - New find_device_by_serial_model() function - Backwards compatible (can still specify device manually) Changes: - Updated argument parser help text and examples - Updated all --resume instructions throughout codebase - Improved user feedback for auto-detection Tests: - Added TestAutoDetectResume class with 7 new tests - Total: 174 tests passing with 97% code coverage Documentation: - Updated README.md with auto-detection examples - Updated CHANGES.md with v1.5.0 release notes - Updated TESTDESIGN.md with new test coverage
1 parent 41cd87f commit 9ba7e9e

File tree

6 files changed

+484
-26
lines changed

6 files changed

+484
-26
lines changed

DOCS/CHANGES.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
## [Unreleased]
1313

14+
## [1.5.0] - 2025-10-19
15+
16+
### Added
17+
- **Auto-Detect Resume Drive**: Major enhancement to `--resume` functionality
18+
- `--resume` no longer requires device specification
19+
- Automatically searches all drives and matches by serial number and model
20+
- Device path (e.g., `/dev/sdb`) can now change between sessions
21+
- New function `find_device_by_serial_model()` searches and matches drives
22+
- Maintains backwards compatibility: can still specify device manually
23+
- Shows clear feedback about which drive was detected
24+
- Provides helpful error messages when no matching drive is found
25+
26+
### Changed
27+
- **Argument Parser**: Updated help text and examples
28+
- Device argument is now optional with `--resume`
29+
- Updated help: "Resume previous wipe session (auto-detects drive by serial number)"
30+
- Updated examples to show both `wipeit --resume` and `wipeit --resume /dev/sdb`
31+
32+
### Improved
33+
- **User Messages**: Updated all `--resume` instructions throughout the codebase
34+
- KeyboardInterrupt message now shows auto-detection info
35+
- Device mismatch errors reference auto-detection
36+
- Resume prompts clarify no device specification needed
37+
38+
### Tests
39+
- **Comprehensive Test Coverage**: Added 7 new tests in `TestAutoDetectResume` class
40+
- `test_find_device_by_serial_model_found()` - Successful auto-detection
41+
- `test_find_device_by_serial_model_not_found()` - No matching device
42+
- `test_find_device_by_serial_model_no_progress_file()` - Missing progress file
43+
- `test_find_device_by_serial_model_no_serial_in_progress()` - Missing serial
44+
- `test_setup_argument_parser_resume_without_device()` - Parser validation
45+
- `test_main_resume_without_device_auto_detects()` - Integration test
46+
- `test_main_resume_without_device_no_match()` - Error handling
47+
- All 174 tests passing with 97% code coverage
48+
1449
## [1.4.4] - 2025-10-13
1550

1651
### Fixed

DOCS/TESTDESIGN.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,9 @@ jobs:
499499
500500
## Test Statistics
501501
502-
### Current Test Coverage (v1.2.0+)
503-
- **Total Test Classes**: 10
504-
- **Total Test Cases**: 75
502+
### Current Test Coverage (v1.5.0+)
503+
- **Total Test Classes**: 11
504+
- **Total Test Cases**: 82
505505
- **Test Coverage Breakdown**:
506506
- `TestParseSize`: 5 tests
507507
- `TestProgressFileFunctions`: 7 tests
@@ -513,6 +513,7 @@ jobs:
513513
- `TestWipeDeviceIntegration`: 2 tests (Added in 0.3.1)
514514
- `TestMountChecking`: 6 tests (Added in 1.1.0)
515515
- `TestDeviceDetector`: 35 tests (Added in 1.1.0+)
516+
- `TestAutoDetectResume`: 7 tests (Added in 1.5.0)
516517

517518
### DeviceDetector Test Coverage
518519
The new `TestDeviceDetector` class provides comprehensive coverage of the object-oriented device detection functionality:
@@ -566,6 +567,23 @@ This test design document provides comprehensive coverage for all wipeit feature
566567
- Added comprehensive test coverage for HDD pretest functionality
567568
- Added critical bug test for float-to-integer conversion in adaptive chunk sizing
568569
- Increased test count from 34 to 40 tests
570+
### TestAutoDetectResume Test Coverage (v1.5.0)
571+
The new `TestAutoDetectResume` class provides comprehensive coverage of the auto-detection resume functionality:
572+
573+
#### **Core Function Tests**
574+
- `test_find_device_by_serial_model_found()` - Successful device auto-detection by serial and model
575+
- `test_find_device_by_serial_model_not_found()` - No matching device scenario
576+
- `test_find_device_by_serial_model_no_progress_file()` - Missing progress file handling
577+
- `test_find_device_by_serial_model_no_serial_in_progress()` - Progress file without serial number
578+
579+
#### **Integration Tests**
580+
- `test_setup_argument_parser_resume_without_device()` - Argument parser validation
581+
- `test_main_resume_without_device_auto_detects()` - Full integration with main()
582+
- `test_main_resume_without_device_no_match()` - Error handling when no match found
583+
584+
### Recent Additions
585+
- **Added auto-detect resume test coverage (7 new tests)** (v1.5.0)
586+
- **Increased total test count from 75 to 82 tests** (v1.5.0)
569587
- Added comprehensive mount checking test coverage (6 new tests)
570588
- **Added comprehensive DeviceDetector class test coverage (35 new tests)**
571589
- **Increased total test count from 40 to 75 tests**

README.md

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ A secure device wiping utility that overwrites block devices with random data.
7272
### Configuration Options
7373
- **Buffer Size**: Configurable from 1MB to 1TB (default: 100MB)
7474
- **Skip Pretest**: Option to bypass HDD pretest for faster start
75-
- **Resume Flag**: Explicit --resume option for continuing interrupted wipes
75+
- **Resume Flag**: Auto-detects drive by serial number for seamless resume
7676
- **List Devices**: Dedicated --list option for device enumeration
7777

7878
### Technical Features
@@ -143,9 +143,10 @@ Found pending wipe operations:
143143
Written: 1.00 GB / 4.00 GB
144144
Buffer size: 100 MB
145145
Started: Thu Oct 9 18:04:00 2025
146-
Resume command: sudo ./wipeit.py --resume /dev/sdb
146+
Resume command: sudo ./wipeit.py --resume
147147

148-
NOTE: To resume any operation, use: sudo ./wipeit.py --resume <device>
148+
NOTE: To resume any operation, simply run: sudo ./wipeit.py --resume
149+
NOTE: The tool will automatically find the correct drive by serial number
149150
NOTE: To start fresh, the progress file will be overwritten
150151
==================================================
151152

@@ -334,20 +335,32 @@ Progress: 15.42% | Written: 19.74 GB | Speed: 82.15 MB/s | ETA: 17.23 min
334335
^C
335336
Wipe interrupted at 19.74 GB (15.42% complete)
336337
Progress saved. To resume, run:
337-
sudo ./wipeit.py --resume /dev/sdb
338+
sudo ./wipeit.py --resume
338339
```
339340

341+
The tool will automatically find the correct drive by matching the serial number from the progress file.
342+
340343
#### Resume an interrupted wipe
341344

342345
To continue from where you left off:
343346

344347
```bash
345-
sudo ./wipeit.py --resume /dev/sdb
348+
sudo ./wipeit.py --resume
346349
```
347350

351+
The tool will automatically find the correct drive by matching the serial number from the progress file.
352+
348353
**Example resume session with HDD and pretest results:**
349354
```bash
350-
$ sudo ./wipeit.py --resume /dev/sdb
355+
$ sudo ./wipeit.py --resume
356+
357+
======================================================================
358+
AUTO-DETECTING RESUME DRIVE
359+
======================================================================
360+
✓ Found matching drive: /dev/sdb
361+
Serial: WD-WMAYUA1234567
362+
Model: Hitachi_HTS545032B9A300
363+
Size: 128.00 GB
351364

352365
Detected disk type: HDD (confidence: HIGH)
353366
Detection details: Rotational device
@@ -373,7 +386,15 @@ Progress: 16.12% | Written: 20.64 GB | Speed: 85.32 MB/s | ETA: 16.45 min | Buff
373386

374387
**Example resume session without pretest results:**
375388
```bash
376-
$ sudo ./wipeit.py --resume /dev/sdb
389+
$ sudo ./wipeit.py --resume
390+
391+
======================================================================
392+
AUTO-DETECTING RESUME DRIVE
393+
======================================================================
394+
✓ Found matching drive: /dev/sdb
395+
Serial: WD-WMAYUA1234567
396+
Model: Hitachi_HTS545032B9A300
397+
Size: 128.00 GB
377398

378399
Detected disk type: HDD (confidence: HIGH)
379400
Detection details: Rotational device
@@ -435,7 +456,7 @@ $ sudo ./wipeit.py /dev/sdb
435456
Started: Wed Oct 1 18:30:45 2025
436457

437458
Options:
438-
1. Resume previous session: sudo ./wipeit.py --resume /dev/sdb
459+
1. Resume previous session: sudo ./wipeit.py --resume
439460
2. Start fresh (will overwrite previous progress)
440461

441462
Start fresh wipe? (y/n): n
@@ -576,9 +597,11 @@ sudo wipeit --buffer-size 2G /dev/sdd
576597

577598
### 4. Resume an interrupted wipe
578599
```bash
579-
sudo ./wipeit.py --resume /dev/sdb
600+
sudo ./wipeit.py --resume
580601
```
581602

603+
The tool will automatically find the correct drive by matching the serial number from the progress file.
604+
582605
### 5. Check what devices are available
583606
```bash
584607
sudo wipeit

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "wipeit"
3-
version = "1.4.4"
3+
version = "1.5.0"
44
description = "A secure device wiping utility that overwrites block devices with random data"
55
authors = [
66
{name = "Luis Cortes", email = "mrluiscortes@gmail.com"}

0 commit comments

Comments
 (0)