diff --git a/.github/workflows/test-exercises.yml b/.github/workflows/test-exercises.yml index 6df15fd8..61105396 100644 --- a/.github/workflows/test-exercises.yml +++ b/.github/workflows/test-exercises.yml @@ -41,13 +41,11 @@ jobs: - name: Checkout code uses: actions/checkout@v6 - - name: Install build dependencies + - name: Install test dependencies shell: bash run: | apt-get update - apt-get install -y make python3-pip sudo libboost-iostreams-dev libboost-graph-dev - mv /usr/local/lib/python3.12/site-packages/* /usr/local/lib/python3.12/dist-packages - sudo pip3 install --break-system-packages protobuf==3.20.3 grpcio googleapis-common-protos scapy ptf + apt-get install -y make sudo - name: Run PTF Tests run: | diff --git a/vm-ubuntu-26.04/clean.sh b/vm-ubuntu-26.04/clean.sh index 6dc3a5be..ed5da21a 100755 --- a/vm-ubuntu-26.04/clean.sh +++ b/vm-ubuntu-26.04/clean.sh @@ -28,17 +28,30 @@ cd p4c cd .. /bin/rm usr-local-*.txt pip3-list-2b-*.txt $HOME/.ssh/* +/bin/rm -fr $HOME/.cache install-details install-p4dev-dumpdir sudo apt autoremove sudo apt clean -# Zero out unused disk blocks. Results in significantly smaller VM -# image files. - -echo "Writing zeros to unused disk blocks (be patient) ..." -FNAME="/bigemptyfile" -sudo dd if=/dev/zero | sudo dd of=${FNAME} bs=4096k -sudo /bin/rm -f ${FNAME} +VIRT=`systemd-detect-virt` +if [ ${VIRT} == "oracle" ] +then + # This is the case if running within VirtualBox. + # Zero out unused disk blocks. Results in significantly smaller VM + # image files. + + echo "Writing zeros to unused disk blocks (be patient) ..." + FNAME="/bigemptyfile" + sudo dd if=/dev/zero | sudo dd of=${FNAME} bs=4096k + sudo /bin/rm -f ${FNAME} +elif [ ${VIRT} == "apple" ] +then + # This is the case if running within UTM on an Apple Silicon Mac + # using Apple Virtualization. + sudo fstrim -av +else + echo "Unknown output from command systemd-detect-virt: $VIRT" +fi echo "Disk usage before running this script:" echo "$DF1_BEFORE"