tests: remove shm handling 60/31660/6
authorKlement Sekera <ksekera@cisco.com>
Tue, 16 Mar 2021 11:52:29 +0000 (12:52 +0100)
committerOle Tr�an <otroan@employees.org>
Wed, 17 Mar 2021 11:40:16 +0000 (11:40 +0000)
Not used anymore with socket transport.

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I7061048dee21ce02637e34f73fb9984bd241f7df

test/Makefile
test/run_tests.py
test/sys_req/dev_shm_size.sh [deleted file]

index 084fc84..5fe86d9 100644 (file)
@@ -193,7 +193,6 @@ PARALLEL_ILLEGAL=1
 endif
 
 sanity: test-dep verify-no-running-vpp
-       @sys_req/dev_shm_size.sh
        @bash -c "test $(PARALLEL_ILLEGAL) -eq 0 ||\
            (echo \"*******************************************************************\" &&\
                 echo \"* Sanity check failed, TEST_JOBS is not 1 or 'auto' and DEBUG, STEP or PROFILE is set\" &&\
@@ -258,7 +257,6 @@ shell: test-dep
 
 .PHONY: reset
 reset:
-       @rm -f /dev/shm/vpp-unittest-*
        @rm -rf /tmp/vpp-unittest-*
        @rm -f /tmp/api_post_mortem.*
        @rm -rf $(FAILED_DIR)
index 1a29d14..59c9d83 100644 (file)
@@ -28,12 +28,9 @@ from util import check_core_path, get_core_path, is_core_present
 
 # timeout which controls how long the child has to finish after seeing
 # a core dump in test temporary directory. If this is exceeded, parent assumes
-# that child process is stuck (e.g. waiting for shm mutex, which will never
-# get unlocked) and kill the child
+# that child process is stuck (e.g. waiting for event from vpp) and kill
+# the child
 core_timeout = 3
-min_req_shm = 536870912  # min 512MB shm required
-# 128MB per extra process
-shm_per_process = 134217728
 
 
 class StreamQueue(Queue):
@@ -796,10 +793,8 @@ if __name__ == '__main__':
         num_cpus = len(os.sched_getaffinity(0))
     except AttributeError:
         num_cpus = multiprocessing.cpu_count()
-    shm_free = psutil.disk_usage('/dev/shm').free
 
-    print('OS reports %s available cpu(s). Free shm: %s' % (
-        num_cpus, "{:,}MB".format(shm_free / (1024 * 1024))))
+    print("OS reports %s available cpu(s)." % num_cpus)
 
     test_jobs = os.getenv("TEST_JOBS", "1").lower()  # default = 1 process
     if test_jobs == 'auto':
@@ -807,15 +802,7 @@ if __name__ == '__main__':
             concurrent_tests = 1
             print('Interactive mode required, running on one core')
         else:
-            shm_max_processes = 1
-            if shm_free < min_req_shm:
-                raise Exception('Not enough free space in /dev/shm. Required '
-                                'free space is at least %sM.'
-                                % (min_req_shm >> 20))
-            else:
-                extra_shm = shm_free - min_req_shm
-                shm_max_processes += extra_shm // shm_per_process
-            concurrent_tests = min(cpu_count(), shm_max_processes)
+            concurrent_tests = num_cpus
             print('Found enough resources to run tests with %s cores'
                   % concurrent_tests)
     elif test_jobs.isdigit():
diff --git a/test/sys_req/dev_shm_size.sh b/test/sys_req/dev_shm_size.sh
deleted file mode 100755 (executable)
index e1a1f2d..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-# this script verifies that /dev/shm is big enough for test purposes
-# 512MB seems to be enough with room to spare at the time of writing this test
-# (motivation for this check is the default docker /dev/shm size of 64M, which
-# was occasionally overrun when running the tests)
-req_min_size_megabytes=512
-
-cur_size=`df -BM --output=size /dev/shm | awk ' NR==2 { print $1 } ' | cut -f 1 -d 'M'`
-
-if test "$V" = "2"
-then
-       echo -n "Checking /dev/shm size..."
-fi
-
-if test "$cur_size" -lt "$req_min_size_megabytes"
-then
-       echo "/dev/shm size ${cur_size}M is too small, attempting to enlarge to ${req_min_size_megabytes}M."
-       sudo mount -o remount /dev/shm -o size=512M
-       cur_size=`df -BM --output=size /dev/shm | awk ' NR==2 { print $1 } ' | cut -f 1 -d 'M'`
-       if test "$cur_size" -lt "$req_min_size_megabytes"
-       then
-               echo "Couldn't enlarge /dev/shm. Please enlarge it manually so that it's at least ${req_min_size_megabytes}M big."
-               exit 1
-       fi
-       echo "/dev/shm successfully enlarged."
-elif test "$V" = "2"
-then
-       echo "OK (current size: ${cur_size}M, required size: ${req_min_size_megabytes}M)"
-fi