Skip to content

Commit

Permalink
Use mounted repository filesystem in testing
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <[email protected]>
  • Loading branch information
ecdye committed Jun 7, 2024
1 parent 5ae6a5d commit 0b306a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/image.bash
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if [[ $1 == "setup" ]]; then
qemu-img resize -f raw "$3" 4G
echo ", +" | sfdisk -N 2 "$3"
imageFile "mount" "$3"
rsync -avr --exclude="*.img" --exclude="*.sig" --exclude="tests/fs" --exclude="tests/dtb" --exclude="tests/kernel" ./ tests/fs/opt/zram
# rsync -avr --exclude="*.img" --exclude="*.sig" --exclude="tests/fs" --exclude="tests/dtb" --exclude="tests/kernel" ./ tests/fs/opt/zram
systemd-nspawn --directory="tests/fs" /opt/zram/tests/install-packages.bash
echo "set enable-bracketed-paste off" >> tests/fs/etc/inputrc # Prevents weird character output
cp tests/fs/boot/kernel* tests/kernel
Expand Down
12 changes: 6 additions & 6 deletions tests/run.exp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ set loginPassword "raspberry"
# spawn qemu-system-aarch64 -machine "raspi3b" -cpu arm1176 -m 1G -drive "format=raw,file=raspios.img" -dtb "./tests/dtb/bcm2710-rpi-3-b.dtb" -kernel "./tests/kernel/kernel8.img" -append "loglevel=0 quiet console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes rootwait init=/bin/bash" -nographic -serial mon:stdio

# Setup user
expect "root@(none):/# "
send "mount -o remount,rw /dev/mmcblk0p2 /\r"
# expect "root@(none):/# "
# send "mount -o remount,rw /dev/mmcblk0p2 /\r"
expect "root@(none):/# "
send "passwd pi\r"
expect "New password:"
Expand All @@ -32,7 +32,7 @@ expect {
exp_continue
}
"pi@raspberrypi:~$ " {
send "sudo /opt/zram/install.bash\r"
send "sudo /zram-config/install.bash\r"
}
"Login incorrect" {
exit 1
Expand All @@ -41,18 +41,18 @@ expect {

# Run tests
expect "pi@raspberrypi:~$ "
send "/opt/zram/tests/test-zram-devices.bash\r"
send "/zram-config/test-zram-devices.bash\r"
expect {
-re "Test failed:.*$" {
set retval 1
exp_continue
}
"pi@raspberrypi:~$ " {
send "sudo /opt/zram/uninstall.bash\r"
send "sudo /zram-config/uninstall.bash\r"
}
}
expect "pi@raspberrypi:~$ "
send "/opt/zram/tests/test-zram-devices.bash removal\r"
send "/zram-config/test-zram-devices.bash removal\r"
expect {
-re "Test failed:.*$" {
set retval 1
Expand Down

0 comments on commit 0b306a3

Please sign in to comment.