| # Copyright (c) 2022 Intel Corporation |
| # SPDX-License-Identifier: Apache-2.0 |
| from opensearchpy import OpenSearch |
| from opensearchpy.helpers import bulk |
| host = "dashboards.staging.zephyrproject.io" |
| if args.user and args.password: |
| auth = (args.user, args.password) |
| auth = (os.environ['OPENSEARCH_USER'], os.environ['OPENSEARCH_PASS']) |
| hosts = [{'host': host, 'port': port}], |
| ssl_assert_hostname = False, |
| for t in data['testsuites']: |
| t['environment'] = data['environment'] |
| parser = argparse.ArgumentParser(allow_abbrev=False) |
| parser.add_argument('-u', '--user', help='username') |
| parser.add_argument('-p', '--password', help='password') |
| parser.add_argument('-i', '--index', help='index to push to.', required=True) |
| parser.add_argument('files', metavar='FILE', nargs='+', help='file with test data.') |
| args = parser.parse_args() |
| if __name__ == '__main__': |