Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a040f9831b |
@@ -446,8 +446,6 @@ func TestChangingCommandsWaitForLock(t *testing.T) {
|
|||||||
// state directory lock by the time it writes its output. Holding it while
|
// state directory lock by the time it writes its output. Holding it while
|
||||||
// streaming would stall every other changing command for as long as the
|
// streaming would stall every other changing command for as long as the
|
||||||
// stream lasts, and forever when the other end of the pipe is one of them.
|
// stream lasts, and forever when the other end of the pipe is one of them.
|
||||||
//
|
|
||||||
//nolint:paralleltest // t.Setenv forbids t.Parallel
|
|
||||||
func TestEncryptStreamsUnlocked(t *testing.T) {
|
func TestEncryptStreamsUnlocked(t *testing.T) {
|
||||||
t.Setenv(secret.EnvMnemonic, testMnemonic)
|
t.Setenv(secret.EnvMnemonic, testMnemonic)
|
||||||
|
|
||||||
@@ -484,6 +482,7 @@ func TestEncryptStreamsUnlocked(t *testing.T) {
|
|||||||
// Let encrypt finish, so that it releases the lock, then free it
|
// Let encrypt finish, so that it releases the lock, then free it
|
||||||
// again for the tests that follow
|
// again for the tests that follow
|
||||||
_, _ = io.Copy(io.Discard, outputReader)
|
_, _ = io.Copy(io.Discard, outputReader)
|
||||||
|
|
||||||
(<-taken)()
|
(<-taken)()
|
||||||
t.Fatal("secret encrypt held the lock while streaming")
|
t.Fatal("secret encrypt held the lock while streaming")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ const currentFile = "current"
|
|||||||
const unlockerMetadataFile = "unlocker-metadata.json"
|
const unlockerMetadataFile = "unlocker-metadata.json"
|
||||||
|
|
||||||
// unlockerPassphrase protects the passphrase unlockers the tests create.
|
// unlockerPassphrase protects the passphrase unlockers the tests create.
|
||||||
|
//
|
||||||
|
//nolint:gosec // G101: test data, not a real credential
|
||||||
const unlockerPassphrase = "unlocker passphrase"
|
const unlockerPassphrase = "unlocker passphrase"
|
||||||
|
|
||||||
// hookFs passes every call through to Fs, but first calls before for each
|
// hookFs passes every call through to Fs, but first calls before for each
|
||||||
@@ -612,8 +614,6 @@ func TestWriteFileAtomicTempFile(t *testing.T) {
|
|||||||
// vault whose long-term key cannot be had: it must fail without writing
|
// vault whose long-term key cannot be had: it must fail without writing
|
||||||
// anything, so that it never leaves a partial unlocker, nor breaks the one
|
// anything, so that it never leaves a partial unlocker, nor breaks the one
|
||||||
// it would replace.
|
// it would replace.
|
||||||
//
|
|
||||||
//nolint:paralleltest // t.Setenv forbids t.Parallel
|
|
||||||
func TestPassphraseUnlockerGetsKeyFirst(t *testing.T) {
|
func TestPassphraseUnlockerGetsKeyFirst(t *testing.T) {
|
||||||
// No mnemonic, and no current unlocker to get the key from
|
// No mnemonic, and no current unlocker to get the key from
|
||||||
t.Setenv(secret.EnvMnemonic, "")
|
t.Setenv(secret.EnvMnemonic, "")
|
||||||
@@ -640,8 +640,6 @@ func TestPassphraseUnlockerGetsKeyFirst(t *testing.T) {
|
|||||||
// passphrase unlocker writes in its directory is its metadata: an unlocker
|
// passphrase unlocker writes in its directory is its metadata: an unlocker
|
||||||
// directory without metadata is never used, so one interrupted earlier
|
// directory without metadata is never used, so one interrupted earlier
|
||||||
// cannot be.
|
// cannot be.
|
||||||
//
|
|
||||||
//nolint:paralleltest // t.Setenv forbids t.Parallel
|
|
||||||
func TestPassphraseUnlockerWritesMetadataLast(t *testing.T) {
|
func TestPassphraseUnlockerWritesMetadataLast(t *testing.T) {
|
||||||
t.Setenv(secret.EnvMnemonic, testMnemonic)
|
t.Setenv(secret.EnvMnemonic, testMnemonic)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user