def METHOD_NAME(s3ql_cmd_argv, reg_output):
    with tempfile.NamedTemporaryFile('wt') as fh:
        print(
            '[entry1]',
            'storage-url: s3://',
            'backend-options: invalid-key',
            '',
            '[entry2]',
            'storage-url: s3://foo',
            'backend-options: no-ssl',
            file=fh,
            sep='\n',
        )
        fh.flush()
        reg_output(r"ERROR: Invalid storage URL", count=1)
        proc = subprocess.Popen(
            s3ql_cmd_argv('fsck.s3ql')
            + ['--quiet', '--authfile', fh.name, '--log', 'none', 's3://foo'],
            stdin=subprocess.PIPE,
            universal_newlines=True,
        )
        proc.stdin.close()
        assert proc.wait() == 2