Add tests of various applications and libraries running on top of Unikraft.
Enter the application directory and then run the scripts/setup.sh
script.
For example, for C helloworld, run the commands:
cd lang/c/helloworld/
../../../scripts/setup.sh
The setup script clones required repositories and generates the Makefile
file.
Configure the application:
make menuconfig
Build the application:
make prepare
make -j $(nproc)
Run the application using the corresponding command, depending on your hypervisor and VMM (i.e. qemu-system-x86_64
, firecracker
).
New application tests will get their own directories, similar to the helloworld C or helloworld C++ applications.
Steps to be done are:
-
Create the new application directory.
-
Inside the new application directory, add source code files and the
Makefile.uk
file that uses the source code files for the build. -
Fill the
libs.txt
with the depending Unikraft libraries. Add one library per-line, without thelib-
prefix for the repository name. That is, for thelib-libcxx
repository, addlibcxx
; for thelib-musl
repository addmusl
; for thelib-openssl
repository addopenssl
.
This is it, you can now commit your changes to the app-testing
repository.
Now, to test it, follow the steps also mentioned above:
-
Inside the app directory, run the
scripts/setup.sh
script. Be sure to provide the proper path to the script; depending on your app directory, this may be something like../../../scripts/setup.sh
or../../scripts/setup.sh
or../scripts/setup.sh
.The
scripts/setup.sh
script will create theworkdir/
directory with all the repository clones (theunikraft
repository and required library repositories). It will also create theMakefile
file used for configuring and building the application. -
Configure the application with
make menuconfig
. -
Build the application with
make prepare
andmake -j $(nproc)
. -
Run the application with the corresponding run command.