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

1) Added new code under linux-tools , this code can be usefull for b… #122

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions linux-tools/autotest-build-tools/FYI/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#==========================================================================================================
##
## FILE: README.txt
##
## DESCRIPTION: This File contains the steps of build and test autotest tests for all Linux Distribution
##
## OPTIONS: ---
## REQUIREMENTS: ---
## BUGS: ---
## NOTES: ---
## AUTHOR: IBM LTC Test Team
## COMPANY: IBM
## VERSION: 1.0
## CREATED: 16-Feb-2017 Abhishek Sharma < [email protected] >
## REVISION: 22-Feb-2017 Abhishek Sharma < [email protected] >
##==========================================================================================================


Supported Linux Destro : Redhat,Ubuntu,suse,CentOS
Supported Arch : Intel X86_64 and ia32
IBM Power (ppc,ppc64,ppc64le,ppcnf)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure it builds for ppcnf?

IBM Z box( s390x)

Below steps are automted in run.py script, for better understanding steps are written down.

1) Git clone the latest autotest and autotest-linux-tools
2) Based on the arguments build the required packages and copy to autotest-linux-tools/linux-tools
3) Run Autotest-client-tests


NOTE : Before running the run.py script please verify modules/build_conf.py script
This is a configuration file to execute run.py
Before executing modify the data based on your requirement
Binary file added linux-tools/autotest-build-tools/FYI/chromedriver
Binary file not shown.
43 changes: 43 additions & 0 deletions linux-tools/autotest-build-tools/FYI/sources.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu CHANGE_ME main restricted
deb-src http://archive.ubuntu.com/ubuntu CHANGE_ME main #restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu CHANGE_ME-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu CHANGE_ME-updates main #restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu CHANGE_ME universe
deb-src http://archive.ubuntu.com/ubuntu CHANGE_ME universe
deb http://archive.ubuntu.com/ubuntu CHANGE_ME-updates universe
deb-src http://archive.ubuntu.com/ubuntu CHANGE_ME-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu CHANGE_ME multiverse
deb-src http://archive.ubuntu.com/ubuntu CHANGE_ME multiverse
deb http://archive.ubuntu.com/ubuntu CHANGE_ME-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu CHANGE_ME-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu CHANGE_ME-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu CHANGE_ME-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu CHANGE_ME-security main restricted
deb-src http://security.ubuntu.com/ubuntu CHANGE_ME-security main restricted
deb http://security.ubuntu.com/ubuntu CHANGE_ME-security universe
deb-src http://security.ubuntu.com/ubuntu CHANGE_ME-security universe
deb http://security.ubuntu.com/ubuntu CHANGE_ME-security multiverse
deb-src http://security.ubuntu.com/ubuntu CHANGE_ME-security multiverse

98 changes: 98 additions & 0 deletions linux-tools/autotest-build-tools/input_file
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
libclass-singleton-perl
libenv-sanctify-perl
liblocale-gettext-perl
libperl6-export-perl
libdigest-hmac-perl
liblatex-encode-perl
liblwp-protocol-https-perl
libacme-constant-perl
libxml-parser-perl
libanyevent-dbd-pg-perl
libasyncns0
perl-doc
libparse-yapp-perl
perl-modules
libxml-parser-perl
libtest-carp-perl
libasound2
libsub-uplevel-perl
claws-mail-perl-filter
libtext-unidecode-perl
bc
libhttp-tiny-perl
librose-uri-perl
bridge-utils
libnet-ssleay-perl
openhpid
libxml-dom-perl
libemail-thread-perl
libavahi
perl-doc-html
libatk
liblwp-mediatypes-perl
augeas-tools
libtext-iconv-perl
nscd
libtie-ixhash-perl
libwww-curl-perl
libnet-http-perl
libbusiness-isbn-perl
perl-doc
libclass-std-storable-perl
libcarp-clan-perl
libio-socket-ip-perl
libcompress-raw-bzip2-perl
libxml-sax-writer-perl
libcompress-raw-zlib-perl
libio-compress-perl
libxml-sax-perl
libconfig-general-perl
libconvert-asn1-perl
libcrypt-ssleay-perl
liblwp-authen-negotiate-perl
libauthen-sasl-perl
libscalar-list-utils-perl
libbit-vector-perl
perl-modules
libnet-ldap-perl
libxml-xql-perl
libbusiness-isbn-data-perl
perl-doc
libdata-dumper-simple-perl
libxml-sax-expatxs-perl
libxml-simple-perl
libdate-calc-perl
libxml-dumper-perl
libdate-manip-perl
libtext-soundex-perl
libdigest-sha-perl
libwww-robotrules-perl
libencode-locale-perl
libpod-simple-perl
libfile-which-perl
libfile-path-tiny-perl
libfile-fu-perl
libfont-afm-perl
libperl4-corelibs-perl
libtemplate-plugin-number-format-perl
libio-socket-ip-perl
libhtml-parser-perl
libhtml-parser-perl
libhtml-tree-perl
libhttp-cookies-perl
libhttp-daemon-ssl-perl
libghc-http-date-dev
libhttp-message-perl
libstring-crc32-perl
liblwp-protocol-https-perl
libtool-bin
arptables
at
autofs
libnetfilter-conntrack3
libmnl0
kpartx
python-slip
libgstreamer0
libdaemon0
libevent
Binary file not shown.
Empty file.
50 changes: 50 additions & 0 deletions linux-tools/autotest-build-tools/modules/build_conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/python

#########################################################
#
# THIS IS BUILD CONF FILE , MODIFY BASED ON YOUR NEED
#
#########################################################

class generic_conf:
build_type = "UBUNTU" # Give CUSTOM/UBUNTU/CENTOS/RHEL for respective build
basedir = "/var/tmp/ubuntu_build" # Change this baseed on your requirement
logdir = "%s/logs" %basedir
logfile = "%s/final_report.logs" %logdir
package_list_file = "/home/ubuntu/autotest-build-tools/input_file" # This file will contain the package name to be build
binary_src_dir = "%s/autotest-binaries" %basedir # All the compile binaries will be copied in this location, you can change based on your requirement
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to include the build_src_distribution in the DIR structure as we can easily differentiate the builds based on versions.

sms_notofication = "n" # 'n' for no, this feature is only available for INDIA
mobile_number = "" # Only applicable for india number
python_modules = [ 'pyvirtualdisplay','selenium',]



class ubuntu_conf:
build_src_distribution = ['xenial'] # for rhel or suse mentioned the distribution name or distribution version rhel7.4 for building
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a single run tests can be built for only one release , so make this var as a single one instead of list

#build_src_distribution = ['zesty'] # for rhel or suse mentioned the distribution name or distribution version rhel7.4 for building
supported_release = [ 'precise','trusty','xenial','yakkety','zesty' ]
prerequisite_packages = ['packaging-dev','python-pip'] # If you want to add more packages to be part of your prerequisite add like ['pkg1','pkg2']
repo_file = "/etc/apt/sources.list" # Default repo file for ubuntu
template_repo_file = "FYI/sources.list" # Update your src repo entries in case default data is not enough to build the packages
chroot_path = "/var/cache/pbuilder"
pbuilder_script_file = "/usr/lib/pbuilder/pbuilder-buildpackage" # Do not change the file or else build is fail for all packages
pbuilder_build_path = "/var/cache/pbuilder/build/*/build/*"



class rhel_conf:
build_src_distribution = [] # for rhel or suse mentioned the distribution name or distribution version rhel7.4 for building
supported_release = [ '7.1','7.2','7.3' ]

class suse_conf:
build_src_distribution = [] # for rhel or suse mentioned the distribution name or distribution version rhel7.4 for building
supported_release = [ ]


class custom_conf:
#build_tag = [ 'ALL' ] # for specific build tag mentioned like mcp8_1-ppc64le
build_tag = [ '','' ] # for specific build tag mentioned like mcp8_1-ppc64le
input_file = "" # This file will contain the packges to be build for autotest
build_supporting_tags = ['','','','ALL']
sleep_tag = "3600" # After instance will sleep for these many sec, you can modify based on your requirement
num_of_build_per_cycle = "14"
Empty file.
65 changes: 65 additions & 0 deletions linux-tools/autotest-build-tools/modules/custom_module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/usr/bin/python
import os,sys,logging,time


# Import custom modules
from build_conf import *
from generic_module import *

####################################################
# Capture all variables based on build conf file
####################################################
SLEEP_TAG = custom_conf.sleep_tag
BUILD_NUMS = custom_conf.num_of_build_per_cycle
BASEDIR = generic_conf.basedir
LOGDIR = generic_conf.logdir
return_code = os.system("ls -ld %s >/dev/null 2>&1" %LOGDIR)
if return_code != 0:
create_status = os.system("mkdir -p %s >/dev/null 2>&1 " %LOGDIR)
if create_status != 0:
print col.red + "\nERROR: Failed while creating directory %s\n" %LOGDIR + col.norm
sys.exit(0)


LOGFILE = generic_conf.logfile
logging.basicConfig(filename=LOGFILE,format='%(asctime)s - [ %(levelname)s ] - %(message)s',level=logging.DEBUG)

try:
LOCAL_BUILD_TAG = custom_conf.build_tag
except:
display_message_fn("Seems like build_tag is commented or deleted in conf file","ERROR")
footer_fn(BASEDIR,LOGDIR,LOGFILE)
sys.exit(0)

try:
BUILD_SUPPORTED_TAG = custom_conf.build_supporting_tags
except:
display_message_fn("Seems like build_supporting_tags is commented or deleted in conf file","ERROR")
footer_fn(BASEDIR,LOGDIR,LOGFILE)
sys.exit(0)






####################################################
# Function to verify given input is valid or not
####################################################
def varify_build_fn():
for input_tags in LOCAL_BUILD_TAG:
if input_tags in BUILD_SUPPORTED_TAG:
continue
else:
display_message_fn("Given input tag \"%s\" is not supported right now" %input_tags,"ERROR")
footer_fn(BASEDIR,LOGDIR,LOGFILE)
sys.exit(0)



##########################################################
# Funtion to setup required environment
##########################################################

varify_build_fn()
footer_fn(BASEDIR,LOGDIR,LOGFILE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where can this be used?

Loading