harbor/tests/robot-cases/Group0-Util/notary-remove-image-signature.expect
Flávio Ramalho 3d3fabbd20
Make notary-remove-image-signature more flexible (#12536)
Instead of explicitly defining the expect path to /usr/local/bin/expect,
use the env command, so the expect executable is searched for and launched
from wherever it is first found.

Signed-off-by: Flávio Ramalho <framalho@suse.com>
2020-07-31 15:49:45 +08:00

20 lines
547 B
Plaintext
Executable File

#!/usr/bin/env expect
set HOST [lindex $argv 0]
set PROJECT [lindex $argv 1]
set IMAGE [lindex $argv 2]
set notaryServerEndpoint [lindex $argv 3]
set timeout 30
spawn notary -s https://$notaryServerEndpoint --tlscacert /notary_ca.crt -d /root/.docker/trust remove -p $HOST/$PROJECT/$IMAGE latest
expect {
"Enter username:" {send "admin\r";exp_continue}
"Enter password:" {send "Harbor12345\r";exp_continue}
"Enter passphrase for targets key with ID*" {send "Harbor12345\r"}
timeout {exit 1}
}
expect eof
exit 0