Skip to content

Commit

Permalink
Set date internally
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <mrtops03@gmail.com>
  • Loading branch information
ecdye committed Jul 1, 2024
1 parent 74766e1 commit 9905cdb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/image.bash
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ if [[ $1 == "setup" ]]; then
qemu-img resize -f raw "$3" 4G
echo ", +" | sfdisk -N 2 "$3"
imageFile "mount" "$3"
sed -i -e "s|[DATE]|$(date)|" tests/run.exp
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 "$(date)"
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
# Compile a customized DTB
Expand Down
1 change: 0 additions & 1 deletion tests/install-packages.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ systemctl mask rpi-eeprom-update.service hciuart.service systemd-logind.service
rm -f /var/lib/apt/lists/lock
rm -f /var/cache/apt/archives/lock
rm -f /var/lib/dpkg/lock*
sudo date -s "$1"
4 changes: 3 additions & 1 deletion tests/run.exp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ expect {
exp_continue
}
"pi@raspberrypi:~$ " {
send "sudo /opt/zram/install.bash\r"
send "sudo date -s \"[DATE]\"\r"
}
"Login incorrect" {
exit 1
Expand All @@ -41,6 +41,8 @@ expect {

# Run tests
expect "pi@raspberrypi:~$ "
send "sudo /opt/zram/install.bash\r"
expect "pi@raspberrypi:~$ "
send "/opt/zram/tests/test-zram-devices.bash\r"
expect {
-re "Test failed:.*$" {
Expand Down

0 comments on commit 9905cdb

Please sign in to comment.