Fix race where password was printed on screen
This commit is contained in:
parent
37ae0c2d7b
commit
c4efcfec0a
2 changed files with 11 additions and 4 deletions
|
@ -8,8 +8,12 @@ spawn dsmc restore /opt/backup-test/ /opt/restore-target/ -asnodename=$nodename
|
|||
expect "Action \\\[1,2,3,A\\\] : " {
|
||||
send -- "1\r"
|
||||
expect -exact "Enter encryption key password: "
|
||||
# Some times the password shows up in the output,
|
||||
# we suspect this is a race condition with turning of echo for the tty, so sleep
|
||||
sleep 1
|
||||
send -- "$enc_password\r"
|
||||
expect -exact "Confirm encryption key password: "
|
||||
sleep 1
|
||||
send -- "$enc_password\r"
|
||||
}
|
||||
expect "ANS8013I Invalid encryption key password" {
|
||||
|
|
|
@ -6,11 +6,14 @@ set exit_val 1
|
|||
|
||||
spawn dsmc restore /opt/backup-test/ /opt/restore-target/ -asnodename=$nodename -subdir=yes
|
||||
expect "Action \\\[1,2,3,A\\\] : " {
|
||||
send -- "1\r"
|
||||
expect -exact "Enter encryption key password: " {
|
||||
send -- "1\r"
|
||||
expect -exact "Enter encryption key password: "
|
||||
# Sometimes the password shows up in the output,
|
||||
# we suspect this is a race condition with turning of echo for the tty, so sleep
|
||||
sleep 1
|
||||
send -- "$enc_password\r"
|
||||
}
|
||||
expect -exact "Confirm encryption key password: " {
|
||||
expect -exact "Confirm encryption key password: "
|
||||
sleep 1
|
||||
send -- "$enc_password\r"
|
||||
}
|
||||
expect "Restore processing finished." {
|
||||
|
|
Loading…
Add table
Reference in a new issue