Skip to content

Instantly share code, notes, and snippets.

View omaciel's full-sized avatar
🎯
Learning

Og Maciel omaciel

🎯
Learning
View GitHub Profile
@omaciel
omaciel / gist:7811339
Last active August 16, 2018 13:07
Proposed Git and Development workflow for Robottelo

How To Contribute

Every open source project lives from the generous help by contributors that sacrifice their time and Robottelo is no different.

To make participation as pleasant as possible, this project adheres to the Code of Conduct by the Python Software Foundation.

Here are a few hints and rules to get you started:

  • Add yourself to the AUTHORS.rst file in an alphabetical fashion.
@omaciel
omaciel / .emacs
Last active February 19, 2016 15:36
Emacs configuration for Python development. Simply drop this file inside your $HOME/.emacs.d directory and enjoy it!
;;; package --- Emacs configuration for Python developement
;;; Commentary:
;;; Code:
;; Disable a couple of menus and startup message
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(setq inhibit-startup-message t)
@omaciel
omaciel / README.rst
Last active January 2, 2016 03:59
An example of using a python MetaClass for Data Driven testing

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
@omaciel
omaciel / gist:8676791
Created January 28, 2014 21:21
Configuring Katello
subscription-manager register --force --username=xxxxxx@redhat.com --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"
@omaciel
omaciel / generate_data_test.py
Last active August 29, 2015 13:56
Using SingleDispatcher to overload a random data generator.
# -*- 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"
@omaciel
omaciel / phantom_test.py
Last active August 29, 2015 13:56
Using PhantomJS for quick UI testing using Selenium's WebDriver. There seems to be an exception that is not bubbling up using https... no issues using http. Here's how to resolve it.
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'
import errno
import os
import socket
import sys
import time
from boto import ec2
# -----------------------------------------------------------------------------
# AMI definitions
@omaciel
omaciel / gist:10059276
Created April 7, 2014 21:20
One-Box Setup Satellite 6 to use libvirt for provisioning
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
@omaciel
omaciel / sprint_report.py
Last active August 29, 2015 13:58
Reports on results for an automation milestone (sprint) for Robottelo
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)
@omaciel
omaciel / gist:11319054
Last active June 8, 2016 17:59
Configure Foreman Smart Proxy with all features baked in
# 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