| 269 | cfg_dict[key] = value |
| 270 | |
| 271 | def run_tests(self): |
| 272 | log.info("S3 Tests Java: Running tests...") |
| 273 | testdir = teuthology.get_testdir(self.ctx) |
| 274 | for client in self.all_clients: |
| 275 | self.ctx.cluster.only(client).run( |
| 276 | args=['cp', |
| 277 | '{tdir}/archive/s3-tests-java.{client}.conf'.format( |
| 278 | tdir=testdir, client=client), |
| 279 | '{tdir}/s3-tests-java/config.properties'.format( |
| 280 | tdir=testdir) |
| 281 | ], |
| 282 | stdout=BytesIO() |
| 283 | ) |
| 284 | args = ['cd', |
| 285 | '{tdir}/s3-tests-java'.format(tdir=testdir), |
| 286 | run.Raw('&&'), |
| 287 | run.Raw('JAVA_HOME=$(ls -d /usr/lib/jvm/* | grep -E java-8\|java-1\.8 | head -n 1)'), |
| 288 | '/opt/gradle/gradle/bin/gradle', 'clean', 'test', |
| 289 | '--rerun-tasks', '--no-build-cache', |
| 290 | ] |
| 291 | extra_args = [] |
| 292 | suppress_groups = False |
| 293 | self.log_fwd = False |
| 294 | self.log_name = '' |
| 295 | if client in self.config and self.config[client] is not None: |
| 296 | if 'extra-args' in self.config[client]: |
| 297 | extra_args.extend(self.config[client]['extra-args']) |
| 298 | suppress_groups = True |
| 299 | if 'log-level' in self.config[client] and self.config[client]['log-level'] == 'debug': |
| 300 | extra_args += ['--debug'] |
| 301 | if 'log-fwd' in self.config[client]: |
| 302 | self.log_fwd = True |
| 303 | self.log_name = '{tdir}/s3tests_log.txt'.format( |
| 304 | tdir=testdir) |
| 305 | if self.config[client]['log-fwd'] is not None: |
| 306 | self.log_name = self.config[client]['log-fwd'] |
| 307 | extra_args += [run.Raw('>>'), |
| 308 | self.log_name] |
| 309 | |
| 310 | if not suppress_groups: |
| 311 | test_groups = ['AWS4Test', 'BucketTest', 'ObjectTest'] |
| 312 | else: |
| 313 | test_groups = ['All'] |
| 314 | |
| 315 | for gr in test_groups: |
| 316 | for i in range(2): |
| 317 | self.ctx.cluster.only(client).run( |
| 318 | args=['radosgw-admin', 'gc', |
| 319 | 'process', '--include-all'], |
| 320 | stdout=BytesIO() |
| 321 | ) |
| 322 | |
| 323 | if gr != 'All': |
| 324 | self.ctx.cluster.only(client).run( |
| 325 | args=args + ['--tests'] + [gr] + extra_args, |
| 326 | stdout=BytesIO() |
| 327 | ) |
| 328 | else: |