Blob Blame History Raw
#!/usr/bin/expect -f
#
# COPYRIGHT (c) International Business Machines Corp. 2001-2017
#
# This program is provided under the terms of the Common Public License,
# version 1.0 (CPL-1.0). Any use, reproduction or distribution for this software
# constitutes recipient's acceptance of CPL-1.0 terms which can be found
# in the file LICENSE file or at https://opensource.org/licenses/cpl1.0.php
#

set timeout 5

spawn @sbindir@/pkcsconf -c [lindex $argv 0] -I
expect "Enter the SO PIN: "
sleep .1
send "87654321\r"
sleep .1
expect "label: "
sleep .1
send "ibmtest\r"
sleep .1
expect eof {} \
"Incorrect PIN Entered." {exit 1}

spawn @sbindir@/pkcsconf -c [lindex $argv 0] -P
expect "Enter the SO PIN: "
sleep .1
send "87654321\r"
sleep .1
expect "Enter the new SO PIN: "
sleep .1
send "76543210\r"
sleep .1
expect "Re-enter the new SO PIN: "
sleep .1
send "76543210\r"
sleep .1
expect eof {} \
"Incorrect PIN Entered." {exit 1}

spawn @sbindir@/pkcsconf -c [lindex $argv 0] -u
expect "Enter the SO PIN: "
sleep .1
send "76543210\r"
sleep .1
expect "Enter the new user PIN: "
sleep .1
send "12345678\r"
sleep .1
expect "Re-enter the new user PIN: "
sleep .1
send "12345678\r"
sleep .1
expect eof {} \
"Incorrect PIN Entered." {exit 1}

spawn @sbindir@/pkcsconf -c [lindex $argv 0] -p
expect "Enter user PIN: "
sleep .1
send "12345678\r"
sleep .1
expect "Enter the new user PIN: "
sleep .1
send "01234567\r"
sleep .1
expect "Re-enter the new user PIN: "
sleep .1
send "01234567\r"
sleep .1
expect eof {} \
"Incorrect PIN Entered." {exit 1}