Skip to content

Commit

Permalink
scripts: robot_test: add startup_pools.robot to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lifang-zhang committed Jan 7, 2024
1 parent 1be512e commit ba69d16
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
30 changes: 21 additions & 9 deletions robot-tests/example/startup_pools.robot
Original file line number Diff line number Diff line change
Expand Up @@ -106,23 +106,41 @@ ${NO_VALUE_PRINT} = SEPARATOR=
# Directory where all confs to be tested are stored
${CONF_DIR} = ${CURDIR}${/}test-startup-pools-confs

${MOUNT_POINT} = /dev/hugepages2M


*** Keywords ***
Set Up Hugepage
[Documentation] Set up huge pages
Run umount ${MOUNT_POINT}
Run rm -fr ${MOUNT_POINT}
Run mkdir ${MOUNT_POINT}
Run mount --types hugetlbfs --options pagesize=2M none ${MOUNT_POINT}
Run echo 4096 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages


*** Test Cases ***
Test Invalid Startup Pool Confs
[Documentation] Test all invalid 'startup_pools' options and verify that
... they fail as expected.
[TAGS] ${CORE_MASK} ${APPLICATION_MODE}
${status} Run Keyword And Return Status Get Environment Variable SKIP_INVALID_CONFS
Skip if ${status} msg=Skipped testing invalid startup pool confs

FOR ${conf} IN @{CONF_OUT}
# Set up huge pages
Run ${EXECDIR}${/}scripts${/}gitlab-ci${/}huge-pages-setup.sh
# In this test, the hello program is re-started for each startup_pools
# setting, huge pages are thus accumulated and used up. To fix this,
# huge pages are cleared and setup before running the hello program.
Set Up Hugepage

# Include the 'startup_pools' conf to em-odp.conf
# sed syntax explained: $ matches the last line, a is the append command
Run sed -i -e '$a@include "${CONF_DIR}/${conf}"' %{EM_CONFIG_FILE}

# Run hello program with given arguments
${output} = Process.Run Process ${APPLICATION}
${output} = Process.Run Process taskset -c ${TASKSET_CORES}
... ${APPLICATION}
... @{CM_ARGS}
... stderr=STDOUT
... shell=True
Expand All @@ -141,9 +159,6 @@ Test Default Startup Pool Conf
... one passed to em_init(), namely, em_conf_t::default_pool_cfg.
[TAGS] ${CORE_MASK} ${APPLICATION_MODE}
# Set up huge pages
Run ${EXECDIR}${/}scripts${/}gitlab-ci${/}huge-pages-setup.sh

# Uncomment option 'startup_pools'
Run sed -i '/^#startup_pools:\\s{/,/^#}/s/^#//g' %{EM_CONFIG_FILE}

Expand All @@ -160,9 +175,6 @@ Test Non-default Startup Pool Conf
... configuration configured via 'startup_pools' in em-odp.conf
[TAGS] ${CORE_MASK} ${APPLICATION_MODE}
# Set up huge pages
Run ${EXECDIR}${/}scripts${/}gitlab-ci${/}huge-pages-setup.sh

# Include valid non-default pool configurations to em-odp.conf
Run sed -i -e '$a@include "${CONF_DIR}/non-default-pools.conf"' %{EM_CONFIG_FILE}

Expand Down
1 change: 1 addition & 0 deletions scripts/robot_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ apps["ordered"]=programs/example/queue/ordered
apps["queue_types_ag"]=programs/example/queue/queue_types_ag
apps["queue_types_local"]=programs/example/queue/queue_types_local
apps["queue_group"]=programs/example/queue_group/queue_group
apps["startup_pools"]=programs/example/hello/hello
apps["timer_hello"]=programs/example/add-ons/timer_hello
apps["timer_test"]=programs/example/add-ons/timer_test

Expand Down

0 comments on commit ba69d16

Please sign in to comment.