Blame testcases/init_token.sh.in

Packit 8681c6
#!/usr/bin/expect -f
Packit 8681c6
#
Packit 8681c6
# COPYRIGHT (c) International Business Machines Corp. 2001-2017
Packit 8681c6
#
Packit 8681c6
# This program is provided under the terms of the Common Public License,
Packit 8681c6
# version 1.0 (CPL-1.0). Any use, reproduction or distribution for this software
Packit 8681c6
# constitutes recipient's acceptance of CPL-1.0 terms which can be found
Packit 8681c6
# in the file LICENSE file or at https://opensource.org/licenses/cpl1.0.php
Packit 8681c6
#
Packit 8681c6
Packit 8681c6
set timeout 5
Packit 8681c6
Packit 8681c6
spawn @sbindir@/pkcsconf -c [lindex $argv 0] -I
Packit 8681c6
expect "Enter the SO PIN: "
Packit 8681c6
sleep .1
Packit 8681c6
send "87654321\r"
Packit 8681c6
sleep .1
Packit 8681c6
expect "label: "
Packit 8681c6
sleep .1
Packit 8681c6
send "ibmtest\r"
Packit 8681c6
sleep .1
Packit 8681c6
expect eof {} \
Packit 8681c6
"Incorrect PIN Entered." {exit 1}
Packit 8681c6
Packit 8681c6
spawn @sbindir@/pkcsconf -c [lindex $argv 0] -P
Packit 8681c6
expect "Enter the SO PIN: "
Packit 8681c6
sleep .1
Packit 8681c6
send "87654321\r"
Packit 8681c6
sleep .1
Packit 8681c6
expect "Enter the new SO PIN: "
Packit 8681c6
sleep .1
Packit 8681c6
send "76543210\r"
Packit 8681c6
sleep .1
Packit 8681c6
expect "Re-enter the new SO PIN: "
Packit 8681c6
sleep .1
Packit 8681c6
send "76543210\r"
Packit 8681c6
sleep .1
Packit 8681c6
expect eof {} \
Packit 8681c6
"Incorrect PIN Entered." {exit 1}
Packit 8681c6
Packit 8681c6
spawn @sbindir@/pkcsconf -c [lindex $argv 0] -u
Packit 8681c6
expect "Enter the SO PIN: "
Packit 8681c6
sleep .1
Packit 8681c6
send "76543210\r"
Packit 8681c6
sleep .1
Packit 8681c6
expect "Enter the new user PIN: "
Packit 8681c6
sleep .1
Packit 8681c6
send "12345678\r"
Packit 8681c6
sleep .1
Packit 8681c6
expect "Re-enter the new user PIN: "
Packit 8681c6
sleep .1
Packit 8681c6
send "12345678\r"
Packit 8681c6
sleep .1
Packit 8681c6
expect eof {} \
Packit 8681c6
"Incorrect PIN Entered." {exit 1}
Packit 8681c6
Packit 8681c6
spawn @sbindir@/pkcsconf -c [lindex $argv 0] -p
Packit 8681c6
expect "Enter user PIN: "
Packit 8681c6
sleep .1
Packit 8681c6
send "12345678\r"
Packit 8681c6
sleep .1
Packit 8681c6
expect "Enter the new user PIN: "
Packit 8681c6
sleep .1
Packit 8681c6
send "01234567\r"
Packit 8681c6
sleep .1
Packit 8681c6
expect "Re-enter the new user PIN: "
Packit 8681c6
sleep .1
Packit 8681c6
send "01234567\r"
Packit 8681c6
sleep .1
Packit 8681c6
expect eof {} \
Packit 8681c6
"Incorrect PIN Entered." {exit 1}