From 8471880fdcb6073a22d315bf64e4d1cd81385a25 Mon Sep 17 00:00:00 2001 From: Viktor Ashirov Date: Thu, 31 Aug 2017 15:12:02 +0200 Subject: [PATCH] Issue 48989 - Improve test execution time Bug Description: Currently test runs around 10-15 minutes. Fix Description: Change bytessent value using gdb instead of running ldclt. This change requires debuginfo packages to be installed on a system under test. https://pagure.io/389-ds-base/issue/48989 Reviewed by: ??? --- dirsrvtests/tests/tickets/issue48989_test.py | 31 +++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/dirsrvtests/tests/tickets/issue48989_test.py b/dirsrvtests/tests/tickets/issue48989_test.py index b4e7a9592..6271d9923 100644 --- a/dirsrvtests/tests/tickets/issue48989_test.py +++ b/dirsrvtests/tests/tickets/issue48989_test.py @@ -8,6 +8,8 @@ from lib389._constants import * from lib389.properties import * from lib389.tasks import * from lib389.utils import * +from lib389.paths import Paths +from lib389 import pid_from_file DEBUGGING = False @@ -17,16 +19,31 @@ else: logging.getLogger(__name__).setLevel(logging.INFO) log = logging.getLogger(__name__) - +@pytest.mark.bz1377452 +@pytest.mark.ds48989 def test_bytessent_overflow(topology_st): + """Test bytessent counter overflow + :id: de3b59be-8e4c-11e7-a1a0-28d244694824 + + :setup: Standalone instance + + :steps: + 1. Modify bytessent counter to the value close to 2^32 using gdb. + 2. Run search until the value of bytessent is bigger than 2^32 or resets to 0. + + :expectedresults: + 1. Bytessent counter value should be sucessfully set to custom value. + 2. Bytessent counter value should be bigger than 2^32. """ - Issue 48989 - Add 10k entries and run search until the value of bytessent is - bigger than 2^32 or resets to 0 - """ - # Create users - topology_st.standalone.ldclt.create_users('ou=People,%s' % - DEFAULT_SUFFIX, min=0, max=10000) + # Get ns-slapd PID + ds_paths = Paths(serverid=topology_st.standalone.serverid, + instance=topology_st.standalone) + pid = pid_from_file(ds_paths.pid_file) + + # Modify value in memory + os.popen("gdb -q -ex 'set confirm off' -ex 'call slapi_counter_set_value(num_bytes_sent, 4294967280)' -p {} -ex 'quit'".format(pid)) + bytessent = int(topology_st.standalone.search_s( 'cn=monitor', ldap.SCOPE_BASE, attrlist=['bytessent'])[0].getValue('bytessent')) bytessent_old = bytessent -- 2.13.5