satelliteqe / automation-tools Goto Github PK
View Code? Open in Web Editor NEWA set of tools to help to automate testing Foreman with Robottelo (https://github.com/SatelliteQE/robottelo)
License: GNU General Public License v3.0
A set of tools to help to automate testing Foreman with Robottelo (https://github.com/SatelliteQE/robottelo)
License: GNU General Public License v3.0
Look at job number 210 downstream
Ability to test Sat6 and all relevant components through proxy (via both auth'd and non-auth'd methods)
providing automation with ability to use optional proxy url/port/user/passwd data
pass this data to whichever service requires it (and in the capsule's case, we might for now have to tweak config files) and 3)
be able to pass those values to/from the job itself.
https://bugzilla.redhat.com/show_bug.cgi?id=1128296
https://bugzilla.redhat.com/show_bug.cgi?id=1033011
https://bugzilla.redhat.com/show_bug.cgi?id=1136593
https://bugzilla.redhat.com/show_bug.cgi?id=1136595
https://bugzilla.redhat.com/show_bug.cgi?id=1127397
https://bugzilla.redhat.com/show_bug.cgi?id=1114083
https://bugzilla.redhat.com/show_bug.cgi?id=1155651
(there may be more, simply do a query for "proxy" in Sat6 bugs if you're so inclined)
I am not sure how much I want to focus on katello-disconnected yet since it may get replaced. focus on others first.
ehelms will apparently be working on bz 1114083 soon
Need to update docs now that we have a single point of entry for installing Satellite or Katello via product_install
.
Assign it to @tkolhar
Add the option to enable or disable GPG checking for ISO installation. Also add the option to related jobs on robottelo-ci.
When installing from github if Fabric is not already installed then the installation fail with:
File "/var/folders/wb/p6f5wntj2mgbmz2g59cpm32m0000gn/T/pip-bbDD6S-build/setup.py", line 4, in <module>
import automation_tools
File "automation_tools/__init__.py", line 15, in <module>
from fabric.api import cd, env, execute, local, put, run
ImportError: No module named fabric.api
apparently this got fixed in Snap 7
Docker package is only available on epel repo for RHEL 6. The setup default capsule should install/enable epel repository before installing docker-io
package.
Upgrade of Satellite in following platforms:
Preferably, add it right before calling setup_default_capsule
to take advantage of the call to katello-installer
call which should restart the stack. Depends on #160
Per #89 (comment) , modify any direct references to 'yum -y update' to point to our function.
May want to also expand the function to allow params (package names) and modify everything else as well, but for now there's one reference that I've found, in manage_repos()
As per Bugzilla #1150197, the new feature to support ABRT
does not work on **RHEL 6.6* or earlier, but it does work on RHEL 7.x. Until RHEL 6.7 is shipped, we should not attempt to install packages and enable ABRT unless the server is running RHEL 7.x.
Satellite 6.0.7, 6.0.8 and 6.1.0 have been released, more releases will land in the future, and nightly builds are available too. Each version acts a little bit differently, and NailGun currently makes use of that versioning information when determining how to talk to the server. In addition, other parts of Satellite QE's software suite may make use of versioning information in the future. automation-tools should be updated to somehow make use of this versioning information. At the very least, version numbers should be passed to NailGun.
Complement to #186
In preparation for being able to automate capsule installation/configuration, there are bits that need to be done on the satellite side of the house. There may or may not be some of this in automation-tools already; if there are, we'll simply need to be able to tweak params.
REQUIREMENTS
Steps
Proposed automation-tools namespace [and possible parameters/inputs]
[dell-pe2950-01.lab.eng.rdu.redhat.com] out: Installation complete.
[dell-pe2950-01.lab.eng.rdu.redhat.com] out: Visit https://${FQDN} to create the Red Hat Satellite administrator account.
[dell-pe2950-01.lab.eng.rdu.redhat.com] out:
[dell-pe2950-01.lab.eng.rdu.redhat.com] run: yum -y update
[dell-pe2950-01.lab.eng.rdu.redhat.com] out: Loaded plugins: product-id, rhnplugin, security
[dell-pe2950-01.lab.eng.rdu.redhat.com] out: This system is receiving updates from RHN Classic or RHN Satellite.
[dell-pe2950-01.lab.eng.rdu.redhat.com] out: Setting up Update Process
[dell-pe2950-01.lab.eng.rdu.redhat.com] out: No Packages marked for Update
[dell-pe2950-01.lab.eng.rdu.redhat.com] out:
Traceback (most recent call last):
File "/home/jenkins/shiningpanda/jobs/35403905/virtualenvs/d41d8cd9/lib/python2.7/site-packages/fabric/main.py", line 743, in main
_args, *_kwargs
File "/home/jenkins/shiningpanda/jobs/35403905/virtualenvs/d41d8cd9/lib/python2.7/site-packages/fabric/tasks.py", line 384, in execute
multiprocessing
File "/home/jenkins/shiningpanda/jobs/35403905/virtualenvs/d41d8cd9/lib/python2.7/site-packages/fabric/tasks.py", line 274, in _execute
return task.run(_args, *_kwargs)
File "/home/jenkins/shiningpanda/jobs/35403905/virtualenvs/d41d8cd9/lib/python2.7/site-packages/fabric/tasks.py", line 174, in run
return self.wrapped(_args, *_kwargs)
File "/home/jenkins/workspace/satellite5-installer/automation_tools/init.py", line 1011, in product_install
)[host])
TypeError: 'NoneType' object is not iterable
I have installed automation-tools on RHEL 6 and when I have run:
# RHN_USERNAME=<user> RHN_PASSWORD=<pass> RHN_POOLID=<pool> fab -H root@$( hostname ) product_install:satellite6-upstream
it failed with:
[...]
[<fqdn>] Executing task 'katello_installer'
[<fqdn>] run: katello-installer -d -v --foreman-admin-password="changeme"
[<fqdn>] out: /bin/bash: katello-installer: command not found
[<fqdn>] out:
Fatal error: run() received nonzero return code 127 while executing!
Requested: katello-installer -d -v --foreman-admin-password="changeme"
Executed: /bin/bash -l -c "katello-installer -d -v --foreman-admin-password=\"changeme\" "
Aborting.
Disconnecting from <fqdn>... done.
Maybe I'm missing something. I wanted to follow docs http://automation-tools.readthedocs.org/en/latest/index.html#satellite-installation
we need to be able to dispose of unnecessary guests once we are done with them -- certainly via the tool, and possibly via some image nanny/bot.
If you don't configure a server with a valid fqdn
, then setup_default_capsule
will fail with the following stack trace:
Executing task 'setup_default_capsule'
Traceback (most recent call last):
File "/home/jenkins/shiningpanda/jobs/90156090/virtualenvs/d41d8cd9/lib/python2.7/site-packages/fabric/main.py", line 743, in main
*args, **kwargs
File "/home/jenkins/shiningpanda/jobs/90156090/virtualenvs/d41d8cd9/lib/python2.7/site-packages/fabric/tasks.py", line 384, in execute
multiprocessing
File "/home/jenkins/shiningpanda/jobs/90156090/virtualenvs/d41d8cd9/lib/python2.7/site-packages/fabric/tasks.py", line 274, in _execute
return task.run(*args, **kwargs)
File "/home/jenkins/shiningpanda/jobs/90156090/virtualenvs/d41d8cd9/lib/python2.7/site-packages/fabric/tasks.py", line 174, in run
return self.wrapped(*args, **kwargs)
File "/home/jenkins/workspace/satellite6-installer/automation_tools/__init__.py", line 968, in product_install
execute(setup_default_capsule, host=host)
File "/home/jenkins/shiningpanda/jobs/90156090/virtualenvs/d41d8cd9/lib/python2.7/site-packages/fabric/tasks.py", line 384, in execute
multiprocessing
File "/home/jenkins/shiningpanda/jobs/90156090/virtualenvs/d41d8cd9/lib/python2.7/site-packages/fabric/tasks.py", line 274, in _execute
return task.run(*args, **kwargs)
File "/home/jenkins/shiningpanda/jobs/90156090/virtualenvs/d41d8cd9/lib/python2.7/site-packages/fabric/tasks.py", line 174, in run
return self.wrapped(*args, **kwargs)
File "/home/jenkins/workspace/satellite6-installer/automation_tools/__init__.py", line 302, in setup_default_capsule
domain = hostname.split('.', 1)[1]
IndexError: list index out of range
Allow additional options to be passed to the katello-installer when doing a product install or any install task
If automation-tools is being run as a library then it should not call sys.exit
.
One option is to check if Fabric will return a non-zero return code if a task returns a non-zero integer. This way won't be needed to call sys.exit
.
Yesterday I noticed that when I chose the non-authorized
proxy configuration, even though the installation completed and I was able to use the system, whenever my Satellite
system attempted to reach the CDN
(after importing a manifest and trying to enable a Red Hat repository from the web ui), it would fail to reach it. I'm not sure if the squid
server is at fault or not, but for what is worth, only the port
and url
flags were passed to the installer and not the username
and password
.
We have a total of 4 places in the code where we handle turning SELinux ON/OFF. We should create a specific task for this and update the code to use it, as it would simplify editing this feature's default behavior.
Add tasks to collect packages versions and foreman-debug information.
Provide an ability to do a system-wide package update at any point in the process. I presume this would be little more than a "yum -y update".
This has an added bonus, with a little help, of being able to be used when we have a new compose that we want to install atop an existing (i.e., upgrades).
we will probably need to disable qa on the fabfile as well as minor formatting fixes in two or three other files. Will fix tomorrow.
for rhel6
[10.8.29.200] run: katello-installer -d -v --foreman-admin-password="*****" --katello-proxy-url="http://ginger.lab.eng.rdu2.redhat.com" --katello-proxy-port="3128" --katello-proxy-password="r****" --katello-proxy-username="admin"
[10.8.29.200] out: /bin/bash: katello-installer: command not found
[10.8.29.200] out:
Fatal error: run() received nonzero return code 127 while executing!
For rhel7
[10.8.30.35] run: usermod -aG dockerroot apache
[10.8.30.35] out: usermod: user 'apache' does not exist
[10.8.30.35] out:
Fatal error: run() received nonzero return code 6 while executing!
Requested: usermod -aG dockerroot apache
Executed: /bin/bash -l -c "usermod -aG dockerroot apache"
If environment variables are required should be checked if it is set and also if it is not zero length, otherwise should fail.
The capsule setup changed, the setup_default_capsule
must reflect this when installing an upstream build. For more information check [1]
in this use case, if there is a large storage partition on the linux installation, provide ability to specify/store generated images elsewhere on the system. This would be useful if, say, base OS and images are stored on an SSD, but there is an external storage location.
Make sure to run unsubscribe task before destroying a virtual machine in order to release any subscription consumed during the provisioning.
Now that we are/will be supporting various service calls, it would probably be better to isolate the logic on whether to use sysV's 'service' as seen in RHEL6 or systemd's 'sysctl' as seen in RHEL7, into its own function.
Doing this would:
a) help avoid faulty logic and/or duplicitous code every time a new service needs to be executed
b) help assure that there is automation coverage against both RHEL versions rather than inadvertently missing one.
Logic might be something like this pseudocode
def os_service(daemon, state): rhelver = determine_distro() if rhelver = "rhel7": exec(sysctl state daemon) if rhelver = "rhel6": exec(service daemon state)
Thus, subsequent automation could be triggered easily and mostly hassle free, regardless as to distro.
os_service(abrtd, start) os_service(squid, restart)
out: ****-config-system: rebooting at Mon Mar 2 14:29:11 EST 2015
out: Warning: run() received nonzero return code -1 while executing 'tail -f /var/log/***sd'!
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/fabric/main.py", line 743, in main
*args, **kwargs
File "/usr/lib/python2.7/site-packages/fabric/tasks.py", line 384, in execute
multiprocessing
File "/usr/lib/python2.7/site-packages/fabric/tasks.py", line 274, in _execute
return task.run(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/fabric/tasks.py", line 174, in run
return self.wrapped(*args, **kwargs)
File "/automation_tools/__init__.py", line 1393, in errata_upgrade
sock.connect((env['host'], 22))
File "/usr/lib64/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 111] Connection refused
Let's say we want to test an upgrade after installing a product (say, GA compose). The cycle might be something like
If we get issues #71 resolved, it seems it could work something like
This would help catch dependency issues in rpm or the like, as well.
Assuming we implement #133 then I would like to suggest that we make the value for the SELinux
mode to be an optional argument that can be passed from the command line. If no value is passed then we should default to Enforcing
.
It looks like BASE_URL
for a downstream
build is not being properly set on the repo file:
16:19:34 sharath: one other thing i noticed was, while using downstream the satellite.repo hostname was http://[EDITED]/latest-stable-Satellite-6.0-RHEL-/compose/Satellite/x86_64/os/
16:20:09 sharath: "latest-stable-Satellite-6.0-RHEL-" instead of "latest-stable-Satellite-6.0-RHEL-6"
Note that the OS_VERSION
is missing from the repo file.
The update packages updates the hypervisor rather than the intended vm
Complement to #185
Implement the child-side (capsule) functionality in automation-tools that will allow us to complete a capsule install. There may be some functionality in here that can piggyback off existing automation-tools.
Proposed namespace [and possible parameters]
The OAuth authentication is not enabled by default. To enable it is necessary run the installer with OAuth related options.
A task should be created to handle this scenario and make easy to enable it.
For more information about the OAuth options check Foreman docs [1]
[1] http://theforeman.org/manuals/1.7/index.html#3.2.2InstallerOptions
For more info check SatelliteQE/robottelo#1549
The following code needs to be fixed as I found in the recent irc discussions that we should be either subscribed to 6Server or 7Server and not minor releases.
run(
'subscription-manager register --force --user={0} --password={1} '
'--release="{2}{3}" {4}'
.format(
os.environ['RHN_USERNAME'],
os.environ['RHN_PASSWORD'],
major_version,
minor_version,
'--autosubscribe' if autosubscribe else ''
)
Please automate the upgrade process.
Consider Upgrading:
-> Satellite Upgrade
-> Capsule Upgrade
-> Client Upgrade
Thanks.
Ensure compatibility with Python 2.6 to make automation-tools prepared to be converted to a library package.
The repository's headline points to omaciel/robottelo. It should point to SatelliteQE/robottelo.
setup_vm_provisioning
first checks for a nested virtualization support on the machine by checking the output of /sys/module/kvm_intel/parameters/nested file.
If not supported, it tries to enable it and prompts user to reboot the host.
After that, it is supposed to proceed in code and start checking for virtualization support. This stage cannot be reached in case no virtualization support exists on the host thus I believe these checks should be swapped.
I want to start adding tasks that will allow us to handle Beaker
tasks such as reserving systems, etc. So for starters, given a Beaker
job ID
I would like to get the FQDN
for the system and its status
(i.e. Reserved
, Running
, Failed
, etc
We need further refactor to make the product_install task install Satellite 5
Currently we used iso_install task as a teplate for sat5_iso_install task, so it has to mimics what it returns to product_install task.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.