summaryrefslogtreecommitdiffstats
path: root/ipatests/test_integration/host.py
Commit message (Collapse)AuthorAgeFilesLines
* test_integration: Use python-pytest-multihostPetr Viktorin2014-12-111-228/+10
| | | | | | | | | | | | The core integration testing functionality was split into a separate project. Use this project, and configure it for FreeIPA. The "mh" (multihost) fixture is made available for integration tests. Configuration based on environment variables is moved into a separate module, to ease eventual deprecation. Reviewed-By: Tomas Babej <tbabej@redhat.com>
* test_integration.host: Export the hostname to dict as stringPetr Viktorin2014-04-221-1/+1
| | | | | | Our tests do strict type-checking, using unicode string causes failures. Reviewed-By: Tomas Babej <tbabej@redhat.com>
* ipatests: Allow using FQDN with trailing dot as final hostnameTomas Babej2014-04-171-1/+5
| | | | | | | | | | | | | | | When creating a BaseHost instance, the machine's hostname was reconfigured to have the same shortname prepended the domain name of the domain where it was defined. However, it makes sense in certain use cases to define hosts that have hostnames other than belonging directly in the domain they were defined in. Treat input hostnames with trailing dots as static FQDNs that will not be changed by the name of the domain they were defined in. Reviewed-By: Petr Viktorin <pviktori@redhat.com>
* test_integration.config: Convert some text values to strPetr Viktorin2014-03-051-4/+4
| | | | | | | When loading from file, some strings are loaded as unicode, which would throw off assert_deepequal. Reviewed-By: Tomas Babej <tbabej@redhat.com>
* test_integration.config: Load/store from/to dictsPetr Viktorin2014-03-051-2/+35
| | | | | | Part of the work for: https://fedorahosted.org/freeipa/ticket/3938 Reviewed-By: Tomas Babej <tbabej@redhat.com>
* test_integration.config: Do not store the index in Domain and Host objectsPetr Viktorin2014-03-051-9/+12
| | | | | | | The index is a detail of the environment variable method of configuration, it should only be used there. Reviewed-By: Tomas Babej <tbabej@redhat.com>
* test_integration.config: Do not save the input environmentPetr Viktorin2014-03-051-1/+2
| | | | | | | | | | | | | Using the input environment saved in self._session_env outside of the config loading meant that methods of configuration other than environment variables wouldn't be possible. Restructure the roles/extra_roles to not depend on _session_env. Part of the work for: https://fedorahosted.org/freeipa/ticket/3938 Reviewed-By: Tomas Babej <tbabej@redhat.com>
* test_integration: Log external hostname in Host.ldap_connectPetr Viktorin2013-12-061-1/+1
| | | | This may make debugging easier if the address is set incorrectly.
* test_integration: Support external names for hostsPetr Viktorin2013-12-061-3/+6
| | | | | | | | | | | | The framework had a concept of external hostnames, which the controller uses to contact the test machines, but they were not loaded from configuration. Load external names from configuration. This makes tests pass in setups where internal and external hostnames are different, and the internal hostnames are not initially resolvable from the controller.
* ipatests: Add support for extra roles referenced by a keywordTomas Babej2013-10-311-2/+7
| | | | | | | | | | | | | | | | | | Adds support for host definition by a environment variables of the following form: ROLE_<keyword>_envX, where X is the number of the environment for which host referenced by a role <keyword> should be defined. Adds a required_extra_roles attribute to the IntegrationTest class, which can test developer use to specify the extra roles that this particular test requires. If not all required extra roles are available, the test will be skipped. All extra (and static) roles are accessible to the IntegrationTests via the host_by_role method, which returns a host of given role. Part of: https://fedorahosted.org/freeipa/ticket/3833
* ipatests: Add WinHost classTomas Babej2013-10-241-0/+19
| | | | Part of: https://fedorahosted.org/freeipa/ticket/3834
* ipatests.test_integration.host: Add logging to ldap_connect()Petr Vobornik2013-10-031-2/+4
|
* test_integration: Add OpenSSHTransport, used if paramiko is not availablePetr Viktorin2013-10-031-1/+1
| | | | | | | | | | This adds a transport that uses /usr/bin/ssh calls to communicate with remote hosts. This transport is a bit slower and buffers output more than paramiko, so it is only used if paramiko is not available, or forced with an environment variable. https://fedorahosted.org/freeipa/ticket/3890
* test_integration.host: Move transport-related functionality to a new modulePetr Viktorin2013-10-031-205/+58
| | | | | | | | | | | | | | | This will make it possible to use a different mechanism for cases like - Paramiko is not available - Hosts without SSH servers (e.g. Windows) Add BaseHost, Transport & Command base classes that define the interface and common functionality, and Host, ParamikoTransport & SSHCommand with specific details. The {get,put}_file_contents methods are left on Host for convenience; all other Transport methods must be now accessed through the transport. Part of the work for https://fedorahosted.org/freeipa/ticket/3890
* Allow freeipa-tests to work with older paramiko versionsPetr Viktorin2013-08-131-2/+18
| | | | | | The integration testing framework used Paramiko SFTP files as context managers. This feature is only available in Paramiko 1.10+. Use an explicit context manager so that we don't rely on the feature.
* test_simple_replication: Wait for replication to finish before checkingPetr Viktorin2013-07-251-0/+9
| | | | | | | Add ldap_connect() method to Host to allow executing querying LDAP from tests. Use information in the mapping tree to poll until all replication is finished (or failing) before checking that entries replicated successfully.
* Add install_topo to test tasksPetr Viktorin2013-07-251-1/+7
| | | | | | | This allows a cluster of replicas and clients to be installed in a named topology. Several named topologies are available (star, line, complete, tree, tree2) and new ones can be defined as a simple function.
* Add more test tasksPetr Viktorin2013-07-251-2/+0
| | | | | | | | - install_client - connect_replica - disconnect_replica - prepare_host - kinit_admin
* test_integration: Add log collection to HostPetr Viktorin2013-07-251-0/+14
| | | | This allows collecting logs when a test context is not available.
* Integration test config: Make it possible to specify host IPPetr Viktorin2013-07-151-14/+19
|
* Make BeakerLib logging less verbosePetr Viktorin2013-07-151-5/+5
| | | | | | | | | | | | | Logs from Beaker jobs are normally very brief, with the standard output/error containing detailed information. Make ipa-run-tests with BeakerLib plugin follow this convention. Only include INFO and higher level messages in the Beaker logs. Downgrade several message levels to DEBUG. Log to console using Python logging instead of showing the Beaker logs. Since ipa-run-tests sets up its own logging, Nose's own log handling just causes duplicate messages. Disable it with --nologcapture.
* Host class improvementsPetr Viktorin2013-07-151-7/+28
| | | | | | | | | | - Use the external hostname when connecting to remote hosts - Make it possible to specify working directory for remote commands - Move kinit calls to installation code This allows tests where installation is done later - Log at error level when a remote command fails unexpectedly - Clean up test directory before testing - Break infinite recursion in mkdir_recursive if dir can't be created
* tests: Configure/unconfigure remote hostsPetr Viktorin2013-07-151-0/+14
| | | | | | | | Set up the hostname, /etc/resolv.conf, and /etc/hosts on remote hosts in the test setup. Undo the changes in test teardown. Part of the work for https://fedorahosted.org/freeipa/ticket/3621
* tests: Allow public keys for authentication to the remote machinesPetr Viktorin2013-07-151-2/+14
| | | | Part of the work for https://fedorahosted.org/freeipa/ticket/3621
* Introduce a class for remote commandsPetr Viktorin2013-07-151-44/+130
| | | | | | | | | | | | Introduce a class inspired by subprocess.Popen that handles running a command on a remote machine and handling its output. To separate stdout & stderr streams of a remote command, they need to be read in parallel, so that one of them doesn't stall the runner when its buffer fills up. Accomplish this by using a thread for each stream. Part of the work for: https://fedorahosted.org/freeipa/ticket/3621
* Add a framework for integration testingPetr Viktorin2013-07-151-0/+183
Add methods to run commands and copy files to Host objects. Adds a base class for integration tests which can currently install and uninstall IPA in a "star" topology with per-test specified number of hosts. A simple test for user replication between two masters is provided. Log files from the remote hosts can be marked for collection, but the actual collection is left to a Nose plugin. Part of the work for: https://fedorahosted.org/freeipa/ticket/3621