Assuming you have a RHEL box:
# Subscribe box to get content
subscription-manager register --force --username=$USERNAME --password=$PASSWORD --autosubscribe | |
yum repolist | |
yum-config-manager --disable rhui* | |
yum-config-manager --disable rhel-ha* | |
yum-config-manager --disable rhel-rs* | |
yum-config-manager --disable rhel-lb* | |
yum-config-manager --disable rhel-6-server-cf-tools-1-rpms | |
yum-config-manager --disable *ose* | |
yum-config-manager --disable *realtime* | |
yum-config-manager --disable *rhs* |
# Figure out what OS version we're running | |
if uname -r | grep -q el6; then export OS_VERSION=6; else export OS_VERSION=7; fi | |
# Install libvirt | |
yum install -y libvirt | |
if [ $OS_VERSION -eq 6 ] | |
then | |
service libvirtd start | |
chkconfig libvirtd on |
from collections import defaultdict | |
from functools import partial | |
import sys | |
try: | |
from github import Github | |
except ImportError: | |
print "Install PyGithub: sudo pip install PyGithub" | |
sys.exit(-1) |
puppet module install -i /tmp domcleal/katellovirt | |
puppet apply -v -e 'include katellovirt' --modulepath /tmp | |
export FORWARDERS=$(for i in $(cat /etc/resolv.conf |grep nameserver|awk '{print $2}'); do echo --capsule-dns-forwarders $i;done) | |
export OAUTH_SECRET=$(grep oauth_consumer_secret /etc/foreman/settings.yaml | cut -d ' ' -f 2) | |
echo FORWARDERS: $FORWARDERS | |
echo OAUTH_SECRET: $OAUTH_SECRET | |
katello-installer --capsule-parent-fqdn $(hostname) --capsule-dns true $FORWARDERS --capsule-dns-interface virbr1 --capsule-dns-zone katellolabs.org --capsule-dhcp true --capsule-dhcp-interface virbr1 --capsule-tftp true --capsule-tftp-servername $(hostname) --capsule-puppet true --capsule-puppetca true --capsule-register-in-foreman true --capsule-foreman-oauth-secret $OAUTH_SECRET --capsule-pulp true --capsule-pulp-oauth-secret $OAUTH_SECRET |
import errno | |
import os | |
import socket | |
import sys | |
import time | |
from boto import ec2 | |
# ----------------------------------------------------------------------------- | |
# AMI definitions |
In [1]: from selenium import webdriver | |
In [2]: service_args = ['--ignore-ssl-errors=true'] | |
In [3]: driver = webdriver.PhantomJS(service_args=service_args) | |
In [4]: driver.get("https://aaa.bbb.ccc") | |
In [5]: driver.title | |
Out[5]: u'Login' |
# -*- coding: utf-8 -*- | |
import sys | |
from robottelo.common.helpers import generate_string | |
try: | |
from singledispatch import singledispatch | |
except ImportError: | |
print "Please install the singledispatcher module" |
subscription-manager register --force [email protected] --password=xxxxxx --autosubscribe | |
yum repolist | |
rm -rf /etc/yum.repos.d/beaker-* | |
rm -rf /etc/yum.repos.d/epel* | |
rpm -e epel-release-6-8.noarch | |
rm -rf /var/cache/yum* | |
yum clean all | |
yum-config-manager --disable "*" | |
yum-config-manager --enable "rhel-6-server-rpms" | |
yum-config-manager --enable "rhel-6-server-optional-rpms" |
An example of using python metaclasses to perform data driven tests.
nosetests test_metaclass.py test_baz_exists (tests.cli.test_foo.TestMetaClass) ... ok test_greater_than_zero_1 (tests.cli.test_foo.TestMetaClass) ... ok test_greater_than_zero_2 (tests.cli.test_foo.TestMetaClass) ... ok test_greater_than_zero_3 (tests.cli.test_foo.TestMetaClass) ... ok test_greater_than_zero_4 (tests.cli.test_foo.TestMetaClass) ... ok