-
Notifications
You must be signed in to change notification settings - Fork 13
/
tests.sh
executable file
·64 lines (50 loc) · 2.23 KB
/
tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
OS_NAME=$1
OS_VERSION=$2
export DEBIAN_FRONTEND="noninteractive"
apt-get -qq update || exit 1
apt-get install -y --no-install-recommends binutils bsdmainutils ca-certificates cmake curl gcc git libc-dev make nasm qemu-system-x86 lld rpm || exit 1
echo "deb [trusted=yes] http://dl.bintray.com/hermitcore/ubuntu bionic main" >> /etc/apt/sources.list
apt-get -qq update || exit 1
apt-get install -y --allow-unauthenticated binutils-hermit gcc-hermit-rs libomp-hermit-rs newlib-hermit-rs pte-hermit-rs || exit 1
export PATH=/opt/hermit/bin:$PATH
export PATH="$HOME/.cargo/bin:$PATH"
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
cargo --version # dump version of the Rust toolchain
cargo install cargo-xbuild
rustup component add rust-src
rustup component add llvm-tools-preview
mkdir build
cd build
cmake ..
make -j1 package || exit 1
cd ..
mkdir -p tmp
dpkg-deb -R build/libhermit-rs-0.3.15-all.deb tmp || exit 1
rm -rf build/*.deb build/_CPack_Packages
cd loader
make
cd -
TDIR=/work/build/local_prefix/opt/hermit/x86_64-hermit/extra
FILES="$TDIR/tests/hello $TDIR/tests/hellof $TDIR/tests/hello++ $TDIR/tests/thr_hello"
for f in $FILES; do echo "check $f..."; qemu-system-x86_64 -display none -smp 1 -m 1G -serial stdio -kernel /work/loader/target/x86_64-unknown-hermit-loader/debug/rusty-loader -initrd $f -cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr || exit 1; done
for f in $FILES; do echo "check $f..."; qemu-system-x86_64 -display none -smp 2 -m 1G -serial stdio -kernel /work/loader/target/x86_64-unknown-hermit-loader/debug/rusty-loader -initrd $f -cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr || exit 1; done
# test echo server at port 8000
#HERMIT_ISLE=qemu HERMIT_CPUS=1 HERMIT_KVM=0 HERMIT_VERBOSE=1 HERMIT_APP_PORT=8000 $PROXY $TDIR/tests/server &
#sleep 10
#curl http://127.0.0.1:8000/help
#sleep 1
#curl http://127.0.0.1:8000/hello
#sleep 1
# kill server
#kill $!
# test connection via netio
#wget http://web.ars.de/wp-content/uploads/2017/04/netio132.zip
#unzip netio132.zip
#HERMIT_ISLE=qemu HERMIT_CPUS=2 HERMIT_KVM=0 HERMIT_VERBOSE=1 HERMIT_APP_PORT=18767 $PROXY $TDIR/benchmarks/netio &
#sleep 1
#chmod a+rx bin/linux-x86_64
#bin/linux-x86_64 -t -b 4k localhost
#sleep 1
# kill server
#kill $!