Changeset 72ebe64 in mod_gnutls


Ignore:
Timestamp:
Jan 26, 2020, 12:56:53 PM (3 years ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
asyncio, main, master, proxy-ticket
Children:
e2200db
Parents:
f042405
Message:

runtest.py: Support for running Apache with Valgrind

Not used by "make check" yet.

Location:
test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • test/mgstest/services.py

    rf042405 r72ebe64  
    162162    apache2 = os.environ.get('APACHE2', 'apache2')
    163163
    164     def __init__(self, config, env=None, pidfile=None, check=None):
     164    def __init__(self, config, env=None, pidfile=None, check=None,
     165                 valgrind_log=None):
    165166        self.config = Path(config).resolve()
     167        self.forking = True
    166168        base_cmd = [self.apache2, '-f', str(self.config), '-k']
     169        start_cmd = base_cmd + ['start']
     170        stop_cmd = base_cmd + ['stop']
     171        if valgrind_log:
     172            start_cmd = ['valgrind', '-s', '--leak-check=full',
     173                         '--track-origins=yes', '--vgdb=no',
     174                         f'--log-file={valgrind_log}'] \
     175                         + start_cmd + ['-DFOREGROUND']
     176            self.forking = False
    167177        if not check:
    168178            check = self.pidfile_check
    169         super(ApacheService, self).__init__(start=base_cmd + ['start'],
    170                                             stop=base_cmd + ['stop'],
    171                                             forking=True,
     179        super(ApacheService, self).__init__(start=start_cmd,
     180                                            stop=stop_cmd,
     181                                            forking=self.forking,
    172182                                            env=env,
    173183                                            pidfile=pidfile,
  • test/runtest.py

    rf042405 r72ebe64  
    111111        pidaffix = f'-{testname}'
    112112
     113    valgrind_log = None
     114    if args.valgrind:
     115        valgrind_log = os.path.join('logs', f'valgrind-{testname}.log')
     116
    113117    # Define the available services
    114118    apache = ApacheService(config=os.path.join(testdir, 'apache.conf'),
    115                            pidfile=f'apache2{pidaffix}.pid')
     119                           pidfile=f'apache2{pidaffix}.pid',
     120                           valgrind_log=valgrind_log)
    116121    backend = ApacheService(config=os.path.join(testdir, 'backend.conf'),
    117122                            pidfile=f'backend{pidaffix}.pid')
     
    217222                        default=temp_logfile(),
    218223                        help='write HTTP responses to this file')
     224    parser.add_argument('--valgrind', action='store_true',
     225                        help='run primary Apache instance with Valgrind')
    219226
    220227    # enable bash completion if argcomplete is available
Note: See TracChangeset for help on using the changeset viewer.