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.shThe setup script clones required repositories and generates the Makefile file.
Configure the application:
make menuconfigBuild 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.ukfile that uses the source code files for the build. -
Fill the
libs.txtwith the depending Unikraft libraries. Add one library per-line, without thelib-prefix for the repository name. That is, for thelib-libcxxrepository, addlibcxx; for thelib-muslrepository addmusl; for thelib-opensslrepository 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.shscript. Be sure to provide the proper path to the script; depending on your app directory, this may be something like../../../scripts/setup.shor../../scripts/setup.shor../scripts/setup.sh.The
scripts/setup.shscript will create theworkdir/directory with all the repository clones (theunikraftrepository and required library repositories). It will also create theMakefilefile used for configuring and building the application. -
Configure the application with
make menuconfig. -
Build the application with
make prepareandmake -j $(nproc). -
Run the application with the corresponding run command.