Skip to content

Commit fc3fbff

Browse files
committed
Use e1000 instead of virtio in CI.
Also, autoformat bash scripts.
1 parent 4c64893 commit fc3fbff

2 files changed

Lines changed: 59 additions & 62 deletions

File tree

run_test.sh

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ trap cleanup EXIT
2222

2323
cp -rv $1 $TEMPDIR
2424

25-
cat > $TEMPDIR/storage/registered.json << EOF
25+
cat >$TEMPDIR/storage/registered.json <<EOF
2626
[
2727
{
2828
"mac": [82, 84, 0, 18, 52, 86],
@@ -38,34 +38,33 @@ cat > $TEMPDIR/storage/registered.json << EOF
3838
EOF
3939

4040
if ! ip link show br-pixie; then
41-
ip link add br-pixie type bridge
42-
ip link set dev br-pixie up
43-
ip addr add 10.0.0.1/8 brd 10.255.255.255 dev br-pixie
41+
ip link add br-pixie type bridge
42+
ip link set dev br-pixie up
43+
ip addr add 10.0.0.1/8 brd 10.255.255.255 dev br-pixie
4444
fi
4545

4646
RUST_BACKTRACE=short RUST_LOG=debug RUST_LOG_STYLE=always LLVM_PROFILE_FILE=prof-out/pixie-server-%m-%p.profraw ./pixie-server/target/debug/pixie-server -s $TEMPDIR/storage &
4747

4848
run_qemu() {
49-
OVMF=/usr/share/OVMF/OVMF_CODE_4M.fd
50-
if ! [ -e $OVMF ]
51-
then
52-
OVMF=/usr/share/edk2/x64/OVMF_CODE.4m.fd
53-
fi
54-
FILE=prof-out/pixie-uefi-$RANDOM.profraw
55-
truncate -s 500M $FILE
56-
qemu-system-x86_64 \
57-
-nographic \
58-
-chardev stdio,id=char0,logfile=$1,signal=off \
59-
-serial chardev:char0 \
60-
-monitor none \
61-
-enable-kvm \
62-
-cpu host -smp cores=2 \
63-
-m 1G \
64-
-drive if=pflash,format=raw,file=$OVMF \
65-
-drive file=$TEMPDIR/disk.img,if=none,id=nvm,format=raw \
66-
-drive file=$FILE,format=raw \
67-
-device nvme,serial=deadbeef,drive=nvm \
68-
-nic bridge,mac=52:54:00:12:34:56,br=br-pixie,model=virtio-net-pci
49+
OVMF=/usr/share/OVMF/OVMF_CODE_4M.fd
50+
if ! [ -e $OVMF ]; then
51+
OVMF=/usr/share/edk2/x64/OVMF_CODE.4m.fd
52+
fi
53+
FILE=prof-out/pixie-uefi-$RANDOM.profraw
54+
truncate -s 500M $FILE
55+
qemu-system-x86_64 \
56+
-nographic \
57+
-chardev stdio,id=char0,logfile=$1,signal=off \
58+
-serial chardev:char0 \
59+
-monitor none \
60+
-enable-kvm \
61+
-cpu host -smp cores=2 \
62+
-m 1G \
63+
-drive if=pflash,format=raw,file=$OVMF \
64+
-drive file=$TEMPDIR/disk.img,if=none,id=nvm,format=raw \
65+
-drive file=$FILE,format=raw \
66+
-device nvme,serial=deadbeef,drive=nvm \
67+
-nic bridge,mac=52:54:00:12:34:56,br=br-pixie,model=e1000
6968
}
7069

7170
truncate -s 8G $TEMPDIR/disk.img
@@ -75,9 +74,9 @@ mkswap ${DEV}p1
7574
mkfs.ntfs -f ${DEV}p2
7675
mkfs.ext4 ${DEV}p3
7776
for PART in ${DEV}p{2..3}; do
78-
mount $PART $TEMPDIR/mnt
79-
cp ./pixie-server/target/debug/pixie-server $TEMPDIR/mnt
80-
umount $TEMPDIR/mnt
77+
mount $PART $TEMPDIR/mnt
78+
cp ./pixie-server/target/debug/pixie-server $TEMPDIR/mnt
79+
umount $TEMPDIR/mnt
8180
done
8281
losetup -d $DEV
8382

@@ -95,12 +94,12 @@ run_qemu $TEMPDIR/flash-1.log
9594
DEV=$(losetup --partscan --show --find --read-only $TEMPDIR/disk.img)
9695
fsck -n ${DEV}p*
9796
for PART in ${DEV}p{2..3}; do
98-
mount -o ro $PART $TEMPDIR/mnt
99-
if [ "$(md5sum $TEMPDIR/mnt/pixie-server | cut -f 1 -d ' ')" != "$(md5sum ./pixie-server/target/debug/pixie-server | cut -f 1 -d ' ')" ]; then
100-
echo "pixie-server does not contain the expected content"
101-
exit 1
102-
fi
103-
umount $TEMPDIR/mnt
97+
mount -o ro $PART $TEMPDIR/mnt
98+
if [ "$(md5sum $TEMPDIR/mnt/pixie-server | cut -f 1 -d ' ')" != "$(md5sum ./pixie-server/target/debug/pixie-server | cut -f 1 -d ' ')" ]; then
99+
echo "pixie-server does not contain the expected content"
100+
exit 1
101+
fi
102+
umount $TEMPDIR/mnt
104103
done
105104
losetup -d $DEV
106105

@@ -112,17 +111,16 @@ run_qemu $TEMPDIR/flash-2.log
112111
DEV=$(losetup --partscan --show --find --read-only $TEMPDIR/disk.img)
113112
fsck -n ${DEV}p*
114113
for PART in ${DEV}p{2..3}; do
115-
mount -o ro $PART $TEMPDIR/mnt
116-
if [ "$(md5sum $TEMPDIR/mnt/pixie-server | cut -f 1 -d ' ')" != "$(md5sum ./pixie-server/target/debug/pixie-server | cut -f 1 -d ' ')" ]; then
117-
echo "pixie-server does not contain the expected content"
118-
exit 1
119-
fi
120-
umount $TEMPDIR/mnt
114+
mount -o ro $PART $TEMPDIR/mnt
115+
if [ "$(md5sum $TEMPDIR/mnt/pixie-server | cut -f 1 -d ' ')" != "$(md5sum ./pixie-server/target/debug/pixie-server | cut -f 1 -d ' ')" ]; then
116+
echo "pixie-server does not contain the expected content"
117+
exit 1
118+
fi
119+
umount $TEMPDIR/mnt
121120
done
122121
losetup -d $DEV
123122

124-
if ! grep "Disk scanned; 0 chunks to fetch" $TEMPDIR/flash-2.log &>/dev/null
125-
then
123+
if ! grep "Disk scanned; 0 chunks to fetch" $TEMPDIR/flash-2.log &>/dev/null; then
126124
echo "Data was re-fetched"
127125
exit 1
128126
fi

test.sh

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,26 @@ cp -r pixie-web/dist/* "${STORAGE_DIR}/admin/"
3939
trap '' SIGTERM
4040
sudo ./run_test.sh ${SELFDIR}/storage
4141

42-
TEST_OBJECTS=$( \
43-
for file in \
44-
$( \
45-
RUSTFLAGS="-C instrument-coverage" \
46-
cargo +nightly test --manifest-path pixie-shared/Cargo.toml --no-fail-fast --all-features --no-run --message-format=json \
47-
| jq -r "select(.profile.test == true) | .filenames[]" \
48-
| grep -v dSYM - \
49-
); \
50-
do \
51-
printf "%s %s " -object $file; \
52-
done \
53-
)
42+
TEST_OBJECTS=$(
43+
for file in \
44+
$(
45+
RUSTFLAGS="-C instrument-coverage" \
46+
cargo +nightly test --manifest-path pixie-shared/Cargo.toml --no-fail-fast --all-features --no-run --message-format=json |
47+
jq -r "select(.profile.test == true) | .filenames[]" |
48+
grep -v dSYM -
49+
); do
50+
printf "%s %s " -object $file
51+
done
52+
)
5453

5554
"$LLVM_PROFDATA" merge -sparse prof-out/*.profraw -o prof-out/pixie.profdata
5655
"$LLVM_COV" show \
57-
-instr-profile=prof-out/pixie.profdata \
58-
-object pixie-server/target/debug/pixie-server \
59-
-object pixie-uefi/target/x86_64-unknown-uefi/debug/pixie-uefi.efi \
60-
$TEST_OBJECTS \
61-
-Xdemangler=rustfilt \
62-
--ignore-filename-regex='/.cargo' \
63-
--ignore-filename-regex='/.rustup' \
64-
--format html \
65-
-o prof-out/html
56+
-instr-profile=prof-out/pixie.profdata \
57+
-object pixie-server/target/debug/pixie-server \
58+
-object pixie-uefi/target/x86_64-unknown-uefi/debug/pixie-uefi.efi \
59+
$TEST_OBJECTS \
60+
-Xdemangler=rustfilt \
61+
--ignore-filename-regex='/.cargo' \
62+
--ignore-filename-regex='/.rustup' \
63+
--format html \
64+
-o prof-out/html

0 commit comments

Comments
 (0)