Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create test script for all binary applications #7

Open
razvand opened this issue Apr 16, 2023 · 2 comments
Open

Create test script for all binary applications #7

razvand opened this issue Apr 16, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@razvand
Copy link
Collaborator

razvand commented Apr 16, 2023

Create a script that walks through all applications in the static-pie-apps repository and the dynamic-apps repository and uses them as tests for Unikraft using the app-elfloader. It summarizes which applications work, which applications don't work, and their issues.

Hackathon points: 100

@T-001v2r3
Copy link

This is a very incomplete version, of the tester, still WIP. This is a collab with @et92
`#!/bin/bash

Set the path to the Unikraft build directory

export UNIKRAFT_BUILD_DIR=../../unikraft

Set the path to the app-elfloader

export APP_LOADER_PATH=../run-app-elfloader/

Define function to run and test an application

run_app() {
app_path=$1
app_name=$2
test_arg=$3

# Run the app-elfloader with the application and test argument
$APP_LOADER_PATH $app_path $test_arg
sleep 1
# Check the exit code of the app-elfloader
if [ $? -eq 0 ]; then
    echo "$app_name ($test_arg): SUCCESS"
else
    echo "$app_name ($test_arg): FAILED"
fi

}

echo "Testing applications in static-pie-apps repository..."
for app in $(ls ../static-pie-apps); do
app_path=../static-pie-apps/$app/$app
app_name=$(basename $app_path)
echo "$app_name"

# Run the application with a unique test argument
if [ "$app_name" = "bc" ]; then
    run_app $app_path $app_name "5+1"
elif [ "$app_name" = "anotherapp" ]; then
    run_app $app_path $app_name "--test-2"
else
    run_app $app_path $app_name "--default-test"
fi

done

echo "Testing applications in dynamic-apps repository..."
for app in $(ls ../dynamic-apps); do
app_path=../dynamic-apps/$app
app_name=$(basename $app_path)
echo "$app_name"

# Run the application with a unique test argument
if [ "$app_name" = "myapp" ]; then
    run_app $app_path $app_name "--test-1"
elif [ "$app_name" = "anotherapp" ]; then
    run_app $app_path $app_name "--test-2"
else
    run_app $app_path $app_name "--default-test"
fi

done
`

@razvand
Copy link
Collaborator Author

razvand commented May 14, 2023

Hi, @galves46, @et92, please create a PR with the test script.

@StefanJum StefanJum moved this to Todo in Hackathons Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Status: Todo
Development

No branches or pull requests

2 participants