Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[controller] Data wipe unit tests #128

Merged
merged 31 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
284f78e
preparing to tests
asergunov Feb 21, 2025
260f8d3
Tests for device and cleanup are added
asergunov Feb 21, 2025
a66b17c
Make test errors fatal
asergunov Feb 21, 2025
e765f07
Use `filepath.Join`
asergunov Feb 21, 2025
b5e35d2
ce tests are added
asergunov Feb 21, 2025
e290a0f
fix error
asergunov Feb 21, 2025
67b3d13
Check feature enable in tests
asergunov Feb 21, 2025
d6884b8
lint errors
asergunov Feb 21, 2025
20fadfc
Don't expect any calls if cleanup is not enabled
asergunov Feb 21, 2025
18554a3
ee lint fix
asergunov Feb 21, 2025
677fde6
lint for ee
asergunov Feb 21, 2025
575e690
ee context
asergunov Feb 21, 2025
b18ccb8
don't expect discard calls if feature is not enabled
asergunov Feb 21, 2025
1a84dac
replace `syscall` package by `golang.org/x/sys/unix`
asergunov Feb 21, 2025
8f4035c
anonymous struct
asergunov Feb 21, 2025
b953241
use `%w` in `fmt.Errorf`
asergunov Feb 21, 2025
7fa44d2
`== 0` for uint64
asergunov Feb 21, 2025
dd81476
cleanup
asergunov Feb 21, 2025
4f18f14
separate package for tests and mock
asergunov Feb 21, 2025
58a73ed
typed mock
asergunov Feb 21, 2025
ec18ad6
ginkgo cleanup tests
asergunov Feb 21, 2025
931a893
WIP
asergunov Feb 24, 2025
ba1cf31
block device open failure test
asergunov Feb 24, 2025
eea23de
Error checks
asergunov Feb 24, 2025
2eecdae
Move close expectation
asergunov Feb 24, 2025
0c32388
Handle closing errors
asergunov Feb 24, 2025
81cdf62
lint
asergunov Feb 24, 2025
1dc7e72
Remove test run we don't need
asergunov Feb 24, 2025
7eac719
Cleanup
asergunov Feb 24, 2025
bda11a5
Make se pass
asergunov Feb 24, 2025
b27d51e
cleanup
asergunov Feb 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions images/agent/src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ require (
github.com/prometheus/procfs v0.15.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.uber.org/mock v0.5.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/oauth2 v0.26.0 // indirect
golang.org/x/sync v0.11.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions images/agent/src/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU=
go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
Expand Down
2 changes: 1 addition & 1 deletion images/agent/src/internal/controller/llv/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ func (r *Reconciler) deleteLVIfNeeded(ctx context.Context, vgName string, llv *v
}
prevFailedMethod = &method
r.log.Debug(fmt.Sprintf("[deleteLVIfNeeded] running cleanup for LV %s in VG %s with method %s", lvName, vgName, method))
err = utils.VolumeCleanup(ctx, r.log, vgName, lvName, method)
err = utils.VolumeCleanup(ctx, r.log, utils.OsDeviceOpener(), vgName, lvName, method)
if err != nil {
r.log.Error(err, fmt.Sprintf("[deleteLVIfNeeded] unable to clean up LV %s in VG %s with method %s", lvName, vgName, method))
return true, err
Expand Down
Loading
Loading