Skip to content

Commit

Permalink
Update expect script to run in fully booted system
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <mrtops03@gmail.com>
  • Loading branch information
ecdye committed Jun 7, 2024
1 parent 5a50df1 commit c9f8f5b
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions tests/run.exp
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,38 @@ spawn /bin/bash
# Setup user
# expect "root@(none):/# "
# send "mount -o remount,rw /dev/mmcblk0p2 /\r"
expect "root@(none):/# "
expect "root@raspberrypi:/# "
send "passwd pi\r"
expect "New password:"
send "$loginPassword\r"
expect "Retype new password:"
send "$loginPassword\r"
expect "root@(none):/# "
send "sync\r"
expect "root@(none):/# "
send "exec /sbin/init\r"
expect "root@raspberrypi:/# "
send "sudo su - pi\r"

# Login process
expect {
"raspberrypi login: " {
send "$loginUser\r"
exp_continue
}
"Password: " {
send "$loginPassword\r"
exp_continue
}
"pi@raspberrypi:~$ " {
send "sudo /zram-config/install.bash\r"
}
"Login incorrect" {
exit 1
}
}

# # Login process
# expect {
# "raspberrypi login: " {
# send "$loginUser\r"
# exp_continue
# }
# "Password: " {
# send "$loginPassword\r"
# exp_continue
# }
# "pi@raspberrypi:~$ " {
# send "sudo /zram-config/install.bash\r"
# }
# "Login incorrect" {
# exit 1
# }
# }

# Run tests
expect "pi@raspberrypi:~$ "
send "sudo /zram-config/install.bash\r"

expect "pi@raspberrypi:~$ "
send "/zram-config/test-zram-devices.bash\r"
expect {
Expand Down

0 comments on commit c9f8f5b

Please sign in to comment.