Changeset e2200db in mod_gnutls for test/mgstest


Ignore:
Timestamp:
Jan 26, 2020, 1:23:49 PM (13 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
asyncio, master, proxy-ticket
Children:
264ab17
Parents:
72ebe64
Message:

Test suite: Always run Apache with "-DFOREGROUND"

This simplifies process management a lot.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/mgstest/services.py

    r72ebe64 re2200db  
    121121
    122122    def wait_ready(self, timeout=None):
    123         """Wait for the started service to be ready. The function passed to
    124         the constructor as "check" is called to determine whether it is."""
     123        """Wait for the started service to be ready.
     124
     125        The function passed to the constructor as "check" is called to
     126        determine whether it is. Waiting also ends if self.process
     127        terminates.
     128
     129        Returns: None if the service is ready, or the return code if
     130        the process has terminated.
     131
     132        Raises a TimeoutError if the given timeout has been exceeded.
     133
     134        """
    125135        if not self.check:
    126             return
     136            return None
    127137
    128138        slept = 0
    129139        while not timeout or slept < timeout:
     140            if self.process and self.process.poll():
     141                return self.process.returncode
    130142            if self.check():
    131                 return
     143                return None
    132144            else:
    133145                sleep(self._step)
     
    165177                 valgrind_log=None):
    166178        self.config = Path(config).resolve()
    167         self.forking = True
    168179        base_cmd = [self.apache2, '-f', str(self.config), '-k']
    169         start_cmd = base_cmd + ['start']
    170         stop_cmd = base_cmd + ['stop']
     180        start_cmd = base_cmd + ['start', '-DFOREGROUND']
    171181        if valgrind_log:
    172182            start_cmd = ['valgrind', '-s', '--leak-check=full',
    173183                         '--track-origins=yes', '--vgdb=no',
    174184                         f'--log-file={valgrind_log}'] \
    175                          + start_cmd + ['-DFOREGROUND']
    176             self.forking = False
     185                         + start_cmd
    177186        if not check:
    178187            check = self.pidfile_check
    179188        super(ApacheService, self).__init__(start=start_cmd,
    180                                             stop=stop_cmd,
    181                                             forking=self.forking,
     189                                            stop=base_cmd + ['stop'],
     190                                            forking=False,
    182191                                            env=env,
    183192                                            pidfile=pidfile,
Note: See TracChangeset for help on using the changeset viewer.