| 183 | os.chmod(py_file, st.st_mode | stat.S_IEXEC) |
| 184 | |
| 185 | def _add_aptest(self): |
| 186 | local_dir = os.path.dirname(inspect.getfile(HttpdTestSetup)) |
| 187 | p = subprocess.run([self.env.apxs, '-c', 'mod_aptest.c'], |
| 188 | capture_output=True, |
| 189 | cwd=os.path.join(local_dir, 'mod_aptest')) |
| 190 | rv = p.returncode |
| 191 | if rv != 0: |
| 192 | log.error(f"compiling mod_aptest failed: {p.stderr}") |
| 193 | raise Exception(f"compiling mod_aptest failed: {p.stderr}") |
| 194 | |
| 195 | modules_conf = os.path.join(self.env.server_dir, 'conf/modules.conf') |
| 196 | with open(modules_conf, 'a') as fd: |
| 197 | # load our test module which is not installed |
| 198 | fd.write(f"LoadModule aptest_module \"{local_dir}/mod_aptest/.libs/mod_aptest.so\"\n") |
| 199 | |
| 200 | def _build_clients(self): |
| 201 | clients_dir = os.path.join( |