| kasar | 0e4186c | 2017-08-16 23:40:41 -0700 | [diff] [blame] | 1 | # -*- coding: utf-8 -*- |
| 2 | |
| 3 | ## |
| 4 | # Copyright 2016-2017 VMware Inc. |
| 5 | # This file is part of ETSI OSM |
| 6 | # All Rights Reserved. |
| 7 | # |
| 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 9 | # not use this file except in compliance with the License. You may obtain |
| 10 | # a copy of the License at |
| 11 | # |
| 12 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | # |
| 14 | # Unless required by applicable law or agreed to in writing, software |
| 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 17 | # License for the specific language governing permissions and limitations |
| 18 | # under the License. |
| 19 | # |
| 20 | # For those usages not covered by the Apache License, Version 2.0 please |
| 21 | # contact: osslegalrouting@vmware.com |
| 22 | ## |
| 23 | |
| 24 | import pytest |
| 25 | import json |
| 26 | |
| 27 | |
| 28 | def vmware_add_options(parser): |
| 29 | parser.addoption("--vcd-url", default="", help="VMware vCloud identity url") |
| 30 | parser.addoption("--vcd-username", default="", help="VMware vCloud username") |
| 31 | parser.addoption("--vcd-password", default="", help="VMware vCloud password") |
| 32 | parser.addoption("--vcd-tenant-name", default="", help="VMware vCloud tenant name") |
| kasar | 12aa2cf | 2018-02-02 02:51:07 -0800 | [diff] [blame] | 33 | parser.addoption("--vcd-org", default="", help="VMware vCloud Organization name") |
| kasar | 0e4186c | 2017-08-16 23:40:41 -0700 | [diff] [blame] | 34 | |
| 35 | @pytest.fixture |
| 36 | def vmware(request): |
| 37 | from lib.vmware import vmware |
| 38 | access = {} |
| kasar | f834e20 | 2017-08-24 05:21:43 -0700 | [diff] [blame] | 39 | access['vim-url'] = request.config.getoption("--vcd-url") |
| 40 | access['vim-username'] = request.config.getoption("--vcd-username") |
| 41 | access['vim-password'] = request.config.getoption("--vcd-password") |
| 42 | access['vim-tenant-name'] = request.config.getoption("--vcd-tenant-name") |
| kasar | 12aa2cf | 2018-02-02 02:51:07 -0800 | [diff] [blame] | 43 | access['vcd-org'] = request.config.getoption("--vcd-org") |
| 44 | access['config'] = request.config.getoption("--vim-config") |
| kasar | 0e4186c | 2017-08-16 23:40:41 -0700 | [diff] [blame] | 45 | access['vim-type'] = 'vmware' |
| 46 | access['description'] = 'pytest system test' |
| 47 | |
| 48 | return vmware.Vmware(access) |