-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathci_tests.sh
More file actions
executable file
·45 lines (39 loc) · 1.46 KB
/
ci_tests.sh
File metadata and controls
executable file
·45 lines (39 loc) · 1.46 KB
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
#!/bin/bash
# author Shanaka Prageeth
# details about the script
DEBIAN_FRONTEND=noninteractive
PROGRAM_NAME="$(basename $0)"
BASEDIR=$(dirname $(realpath "$0"))
# Function to check if the script is run as root
check_root() {
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
exit 1
fi
}
check_image_name() {
if [ -z "$1" ]; then
echo "Usage: $PROGRAM_NAME <IMAGE_NAME>"
exit 1
fi
}
check_root
check_image_name "$1"
IMAGE_NAME="$1"
set -e
echo "Test 1: Huge page allocation"
docker run --rm --privileged --cap-add=ALL \
-v /sys/bus/pci/devices:/sys/bus/pci/devices \
-v /sys/kernel/mm/hugepages:/sys/kernel/mm/hugepages \
-v /sys/devices/system/node:/sys/devices/system/node \
-v /dev:/dev \
-v /home/$USER:/home/$USER \
--name docker-dpdk $IMAGE_NAME bash -c "/root/dpdk/usertools/dpdk-hugepages.py -p 2048K --setup 2M --node 0 && cat /proc/meminfo | grep HugePages"
echo "Test 2: DPDK hello-world"
docker run --rm --privileged --cap-add=ALL \
-v /sys/bus/pci/devices:/sys/bus/pci/devices \
-v /sys/kernel/mm/hugepages:/sys/kernel/mm/hugepages \
-v /sys/devices/system/node:/sys/devices/system/node \
-v /dev:/dev \
-v /home/$USER:/home/$USER \
--name docker-dpdk $IMAGE_NAME bash -c "/root/dpdk/usertools/dpdk-hugepages.py -p 2048K --setup 2M --node 0 && /root/dpdk/build/examples/dpdk-helloworld -l 0-1 -n 1"