mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-09-25 19:11:18 -04:00
csi: let constructor take care of setting up cryptsetup (#2312)
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
d3c940a6a0
commit
327315d5de
4 changed files with 15 additions and 10 deletions
|
@ -16,7 +16,6 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/edgelesssys/constellation/v2/csi/cryptmapper"
|
||||
"github.com/edgelesssys/constellation/v2/internal/cryptsetup"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.uber.org/goleak"
|
||||
|
@ -67,7 +66,7 @@ func TestOpenAndClose(t *testing.T) {
|
|||
setup()
|
||||
defer teardown(devicePath)
|
||||
|
||||
mapper := cryptmapper.New(&fakeKMS{}, cryptsetup.New())
|
||||
mapper := cryptmapper.New(&fakeKMS{})
|
||||
|
||||
newPath, err := mapper.OpenCryptDevice(context.Background(), devicePath, deviceName, false)
|
||||
require.NoError(err)
|
||||
|
@ -107,7 +106,7 @@ func TestOpenAndCloseIntegrity(t *testing.T) {
|
|||
setup()
|
||||
defer teardown(devicePath)
|
||||
|
||||
mapper := cryptmapper.New(&fakeKMS{}, cryptsetup.New())
|
||||
mapper := cryptmapper.New(&fakeKMS{})
|
||||
|
||||
newPath, err := mapper.OpenCryptDevice(context.Background(), devicePath, deviceName, true)
|
||||
require.NoError(err)
|
||||
|
@ -146,7 +145,7 @@ func TestDeviceCloning(t *testing.T) {
|
|||
setup()
|
||||
defer teardown(devicePath)
|
||||
|
||||
mapper := cryptmapper.New(&dynamicKMS{}, cryptsetup.New())
|
||||
mapper := cryptmapper.New(&dynamicKMS{})
|
||||
|
||||
_, err := mapper.OpenCryptDevice(context.Background(), devicePath, deviceName, false)
|
||||
assert.NoError(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue