Skip to content

Commit a1617c7

Browse files
committed
add & for server as well and added failing command checks
1 parent 84694ed commit a1617c7

1 file changed

Lines changed: 22 additions & 8 deletions

File tree

.github/workflows/tpm-ssh.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
cd ibmswtpm2/src
4545
make
4646
./tpm_server &
47-
sleep 5
47+
sleep 2
4848
cd ../..
4949
5050
# Build and install wolfSSL
@@ -94,46 +94,60 @@ jobs:
9494
cd ..
9595
9696
# Start echoserver and wait for it to be ready
97+
echo "Starting echoserver..."
9798
cd wolfssh
98-
./examples/echoserver/echoserver -1 -s key.ssh
99+
./examples/echoserver/echoserver -1 -s key.ssh & || { echo "Echoserver failed to start"; exit 1; }
100+
echo "Echoserver started with PID: $!"
101+
sleep 2
99102
cd ..
100103
101104
# Test client connection with default password
105+
echo "Testing client connection..."
102106
cd wolfssh
103-
./examples/client/client -i ../wolftpm/keyblob.bin -u hansel -K ThisIsMyKeyAuth
107+
./examples/client/client -i ../wolftpm/keyblob.bin -u hansel -K ThisIsMyKeyAuth || { echo "Client connection failed"; exit 1; }
104108
cd ..
105109
106110
# Kill the server and simulator and restart them
107111
- name: Kill server and simulator and restart
108112
run: |
113+
echo "Killing server and simulator..."
109114
pkill -f tpm_server
110-
sleep 2
115+
sleep 2 # Wait for the server to be killed
116+
echo "Restarting server and simulator..."
111117
cd ibmswtpm2/src
112118
./tpm_server &
119+
sleep 2 # Wait for the server to be restarted
113120
cd ../..
114121
115122
# Test the TPM SSH Custom Password
116123
- name: Test TPM SSH Custom Password
117124
run: |
118125
# Test with custom password
119126
cd wolftpm
120-
./examples/keygen/keygen keyblob2.bin -rsa -t -pem -eh -auth=custompassword
127+
echo "Generating key with custom password..."
128+
./examples/keygen/keygen keyblob2.bin -rsa -t -pem -eh -auth=custompassword || { echo "Keygen failed"; exit 1; }
121129
122130
# Convert key to SSH format
123-
ssh-keygen -f key.pem -i -m PKCS8 > ../wolfssh/key.ssh
131+
echo "Converting to SSH key format..."
132+
ssh-keygen -f key.pem -i -m PKCS8 > ../wolfssh/key.ssh || { echo "SSH keygen failed"; exit 1; }
124133
cd ..
125134
126135
# Start echoserver and wait for it to be ready
136+
echo "Starting echoserver..."
127137
cd wolfssh
128-
./examples/echoserver/echoserver -1 -s key.ssh
138+
./examples/echoserver/echoserver -1 -s key.ssh & || { echo "Echoserver failed to start"; exit 1; }
139+
echo "Echoserver started with PID: $!"
140+
sleep 2
129141
cd ..
130142
131143
# Test with custom password
144+
echo "Testing client connection with custom password..."
132145
cd wolfssh
133-
./examples/client/client -i ../wolftpm/keyblob2.bin -u hansel -K custompassword
146+
./examples/client/client -i ../wolftpm/keyblob2.bin -u hansel -K custompassword || { echo "Client connection failed"; exit 1; }
134147
cd ..
135148
136149
# Cleanup
150+
echo "Cleaning up..."
137151
pkill -f tpm_server
138152
sleep 2
139153

0 commit comments

Comments
 (0)