Skip to content

Commit

Permalink
test: Use stratis key set --keyfile-path
Browse files Browse the repository at this point in the history
The `--capture-key`, despite its documentation, is very insistent on
reading the password from the tty. In stratis-cli 3.6.0 it also changed
behaviour to expect the password twice. Move to the `--capture-key`
option which behaves as intended.

See https://bugzilla.redhat.com/show_bug.cgi?id=2246923
  • Loading branch information
martinpitt committed Oct 31, 2023
1 parent 2715d4d commit fd5d9d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/verify/check-storage-stratis
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ class TestStorageStratisReboot(storagelib.StorageCase):
# it. Cockpit will chose a key description for the pool and
# we occupy its first choice in order to force Cockpit to use
# something else.
m.execute("echo not-the-passphrase | stratis key set --capture-key pool0")
m.execute("echo not-the-passphrase | stratis key set --keyfile-path /dev/stdin pool0")
self.dialog_open_with_retry(trigger=lambda: self.devices_dropdown("Create Stratis pool"),
expect=lambda: (self.dialog_is_present('disks', dev_1) and
self.dialog_check({"name": "pool0"})))
Expand Down Expand Up @@ -484,7 +484,7 @@ class TestStorageStratisReboot(storagelib.StorageCase):
'new_passphrase': "boodeefoodeebar",
'new_passphrase2': "boodeefoodeebar"})
# do it again, with the old passphrase in the keyring
m.execute("echo boodeefoodeebar | stratis key set pool0 --capture-key")
m.execute("echo boodeefoodeebar | stratis key set pool0 --keyfile-path /dev/stdin")
b.click('#detail-header .pf-v5-c-description-list__group:contains(Passphrase) button:contains(Change)')
self.dialog({'new_passphrase': passphrase,
'new_passphrase2': passphrase})
Expand Down Expand Up @@ -944,7 +944,7 @@ class TestStorageStratisNBDE(packagelib.PackageCase, storagelib.StorageCase):
b.click('#detail-header .pf-v5-c-description-list__group:contains(Keyserver) button:contains(Remove)')
self.confirm()

m.execute("echo foobar | stratis key set pool0 --capture-key")
m.execute("echo foobar | stratis key set pool0 --keyfile-path /dev/stdin")
b.click('#detail-header button:contains(Add keyserver)')
self.dialog_wait_open()
self.dialog_set_val("tang_url", "10.111.112.5")
Expand All @@ -955,7 +955,7 @@ class TestStorageStratisNBDE(packagelib.PackageCase, storagelib.StorageCase):
with b.wait_timeout(60):
b.wait_in_text('#dialog', "Command failed")
m.execute("stratis key unset pool0")
m.execute("echo foodeeboodeebar | stratis key set pool0 --capture-key")
m.execute("echo foodeeboodeebar | stratis key set pool0 --keyfile-path /dev/stdin")
self.dialog_apply()
with b.wait_timeout(60):
self.dialog_wait_close()
Expand Down

0 comments on commit fd5d9d9

Please sign in to comment.