]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
tests: Add simple u-boot tests
authorMichal Sojka <michal.sojka@cvut.cz>
Tue, 26 Jan 2021 17:53:55 +0000 (18:53 +0100)
committerMichal Sojka <michal.sojka@cvut.cz>
Tue, 26 Jan 2021 18:05:20 +0000 (19:05 +0100)
tests/.gitignore
tests/uboot.wv [new file with mode: 0755]

index 38fbd2085eb0ec436c3df5815d0bb780780e1106..3178782c5bab4b3d428030f427e11fe51196f555 100644 (file)
@@ -1,3 +1,4 @@
 /test.*/
 /.novaboot-shell
 /home-novaboot-test/.bash_history
+/uboot-sim
diff --git a/tests/uboot.wv b/tests/uboot.wv
new file mode 100755 (executable)
index 0000000..f271a35
--- /dev/null
@@ -0,0 +1,74 @@
+#!/usr/bin/env bash
+
+cd $(dirname $0)
+. wvtest.sh
+
+WVPASS tee uboot-sim <<'EOF'
+#!/usr/bin/env bash
+
+rm -rf log
+
+echo "Hit any key to stop autoboot:"
+read -r
+
+while true; do
+      echo -n "uboot> "
+      read -r CMD
+      echo "$CMD" >> log
+done
+EOF
+WVPASS chmod +x uboot-sim
+
+WVSTART "Basic U-Boot support"
+WVPASS cp "$WV_BASE_DIR/uboot-sim" .
+WVPASS touch kernel
+WVPASS novaboot --remote-cmd="./uboot-sim" --uboot="uboot> " <<<'load kernel console=ttyS0'
+WVPASS diff -u - log <<'EOF'
+tftpboot ${kernel_addr_r} kernel
+setenv bootargs console=ttyS0
+bootm ${kernel_addr_r} -
+EOF
+
+WVSTART "Ramdisk support"
+WVPASS cp "$WV_BASE_DIR/uboot-sim" .
+WVPASS touch kernel ramdisk
+WVPASS novaboot --remote-cmd="./uboot-sim" --uboot="uboot> " <<'EOF'
+load kernel console=ttyS0
+load ramdisk
+EOF
+WVPASS diff -u - log <<'EOF'
+tftpboot ${kernel_addr_r} kernel
+tftpboot ${ramdisk_addr_r} ramdisk
+setenv bootargs console=ttyS0
+bootm ${kernel_addr_r} ${ramdisk_addr_r}
+EOF
+
+WVSTART "Device tree support"
+WVPASS cp "$WV_BASE_DIR/uboot-sim" .
+WVPASS touch kernel devicetree.dtb
+WVPASS novaboot --remote-cmd="./uboot-sim" --uboot="uboot> " <<'EOF'
+load kernel console=ttyS0
+load devicetree.dtb
+EOF
+WVPASS diff -u - log <<'EOF'
+tftpboot ${kernel_addr_r} kernel
+tftpboot ${fdt_addr_r} devicetree.dtb
+setenv bootargs console=ttyS0
+bootm ${kernel_addr_r} - ${fdt_addr_r}
+EOF
+
+WVSTART "Ramdisk and device tree support"
+WVPASS cp "$WV_BASE_DIR/uboot-sim" .
+WVPASS touch kernel ramdisk devicetree.dtb
+WVPASS novaboot --remote-cmd="./uboot-sim" --uboot="uboot> " <<'EOF'
+load kernel console=ttyS0
+load devicetree.dtb
+load ramdisk
+EOF
+WVPASS diff -u - log <<'EOF'
+tftpboot ${kernel_addr_r} kernel
+tftpboot ${fdt_addr_r} devicetree.dtb
+tftpboot ${ramdisk_addr_r} ramdisk
+setenv bootargs console=ttyS0
+bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
+EOF