Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VMware: refactoring of the vmware test-suite #54882

Open
wants to merge 11 commits into
base: devel
from

Conversation

Projects
None yet
5 participants
@goneri
Copy link
Contributor

goneri commented Apr 4, 2019

SUMMARY

All the roles now depend on a generic vmware role. We use it to share:

  • teardown and setup playbooks
  • and the default variables.

Remove the strong dependency on vcsim:

  • When the test does not work with vcsim, we isolate it in an Ansible block.
  • use the vcenter_hostname, vcenter_username and vcenter_password,
    this instead of the vcsim variables
  • Use condition to enable some previouly disabled tests. These tests
    were broken on vcsim, but they work fine on a real VMware environment
Dependencies

You will need the following PR to be able to run the tests against a real VSphere environment:

hub am -3 #54879
hub am -3 #54872
hub am -3 #54870
hub am -3 #54864 -- enable vcenter
hub am -3 #55175
hub am -3 #55185
hub am -3 #55237
hub am -3 #55176 -- not technically a dep

Requirements
  • 2 ESXi, 3 to test DRS
    • 4GB
    • they should have a free NIC that we can use for some tests
  • another bigger ESXi (16GB) with VSCA on it
  • a NFS server for the datastore
    • a isos/ directory with an ISO image (Fedora 29 for now)
    • a VMDK of a Linux system with the VMWare tool (not used yet)
Current situation
  • Most of the test roles work fine with a real lab. Remains:
    • Some of the vmware_guest_* tests depend on a VM with VMware-tools
    • vmware_host_active_directory depends on .... Active Directory
    • vmware_vswich depends on a second NIC
  • The VCSim integration is broken, WIP
  • The tests depends on a couple of resources that are maintain manually for now
    • Inventory files with the list of ESXi
    • A configuration file, with the description of the platform (NFS server location) and the name of the resources.
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

vmware

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Apr 4, 2019

@goneri This PR was evaluated as a potentially problematic PR for the following reasons:

  • More than 50 changed files.

Such PR can only be merged by human. Contact a Core team member to review this PR on IRC: #ansible-devel on irc.freenode.net

click here for bot help

@Akasurde Akasurde self-assigned this Apr 5, 2019

@Akasurde Akasurde changed the title [wip]refactoring of the vmware test-suite VMware: [wip]refactoring of the vmware test-suite Apr 5, 2019

@Akasurde

This comment has been minimized.

Copy link
Member

Akasurde commented Apr 5, 2019

@@ -0,0 +1,2 @@
dependencies:
- prepare_vmware_tests

This comment has been minimized.

Copy link
@Akasurde

Akasurde Apr 5, 2019

Member

How about renaming this to setup_vmware to match other setup_

This comment has been minimized.

Copy link
@goneri

goneri Apr 5, 2019

Author Contributor

Well, both exist. Do you know the difference between the prepare_tests and the setup?


- name: get a list of distributed vswitch from vcsim after adding
uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DVS' }}"

This comment has been minimized.

Copy link
@Akasurde

Akasurde Apr 5, 2019

Member
Suggested change
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DVS' }}"
url: http://{{ vcsim }}:5000/govc_find?filter=DVS

This comment has been minimized.

Copy link
@goneri

goneri Apr 5, 2019

Author Contributor

Good point. I applied your suggestion on my local branch. I will push it later.

@goneri goneri force-pushed the goneri:vmware_refact branch 2 times, most recently from 12503ef to f0a9f09 Apr 5, 2019

@goneri goneri removed the needs_triage label Apr 10, 2019

@goneri goneri force-pushed the goneri:vmware_refact branch 4 times, most recently from 767c225 to 6881061 Apr 11, 2019

@goneri goneri force-pushed the goneri:vmware_refact branch from 6881061 to e6577eb Apr 15, 2019

@goneri goneri changed the title VMware: [wip]refactoring of the vmware test-suite VMware: refactoring of the vmware test-suite Apr 15, 2019

@goneri goneri force-pushed the goneri:vmware_refact branch from e6577eb to 698e6e6 Apr 16, 2019

@goneri

This comment has been minimized.

Copy link
Contributor Author

goneri commented Apr 16, 2019

@mattclay I would appreciate your opinion on this:

The goal of this PR is to be able to run the vmware test roles on vcsim and/or a real physical lab. To reach this objective, we modify the tests to skip the tasks that cannot work depending on the test environment. e.g:

  • vcsim: we can run the whole test-suite, however some tasks are skipped because they depend on feature not supported by vcsim.
  • real lab with 2 ESXi: we can run most of the tests, a few of them are skipped because they require 3 ESXi or more and/or some other features
  • real lab with 3+ ESXi: we can create HA group of hosts (DRS cluster + HA)
  • real lab with 3+ ESXi and an Active Directory: we can run everything

As a result, can potentially be run, and so I dropped the 'unsupported' alias and I would like to replace it with the shippable/vcenter/group1 alias. @mattclay, is this the correct strategy?

@goneri goneri force-pushed the goneri:vmware_refact branch from 698e6e6 to 2bb13b2 Apr 16, 2019

Show resolved Hide resolved pull-dep.sh Outdated
@mattclay

This comment has been minimized.

Copy link
Member

mattclay commented Apr 16, 2019

@goneri Yes, that sounds like a good approach.

@goneri goneri force-pushed the goneri:vmware_refact branch from 2bb13b2 to bb7121b Apr 16, 2019

port: 443
state: started

- import_role:

This comment has been minimized.

Copy link
@Akasurde

Akasurde Apr 17, 2019

Member

Isn't this added as dependency as vmware_about_facts ?

- when: vcsim is not defined
block:
- import_role:
name: prepare_vmware_tests

This comment has been minimized.

Copy link
@Akasurde

Akasurde Apr 17, 2019

Member

Isn't this added already in dependency?

# Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

- name: Wait for Flask controller to come up online

This comment has been minimized.

Copy link
@Akasurde

Akasurde Apr 17, 2019

Member

Not sure why these are removed ?

This comment has been minimized.

Copy link
@goneri

goneri Apr 17, 2019

Author Contributor

I merged them in a single main.yml file.

- assert:
that:
- host_acceptance_facts_check_mode.facts is defined
- when: False

This comment has been minimized.

Copy link
@Akasurde

Akasurde Apr 17, 2019

Member

This will never run.

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Apr 17, 2019

@goneri this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@alongchamps

This comment has been minimized.

Copy link

alongchamps commented Apr 18, 2019

I'm just noticing this ticket now but want to help out if I can. This would be a great idea especially for some of the things I'm focusing on that tend to be vCenter and ESXi specific such as roles, permissions, and firewall configs.

goneri and others added some commits Apr 19, 2019

Review comments 1
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Review comments 2
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Review comments 3
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Review comments 4
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Review comments 5
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Review comments 6
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Review comments 7
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

@goneri goneri force-pushed the goneri:vmware_refact branch from c1b1df6 to 8cf3903 Apr 23, 2019

@ansibot ansibot added core_review and removed merge_commit labels Apr 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.