Skip to content

Commit 05bb22f

Browse files
authored
Merge pull request #3 from opensciencegrid/master
My fork up to date
2 parents e39fed9 + 7de54d4 commit 05bb22f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+154
-543
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# ------------------------------------------------------------------------------
77

88
PACKAGE := osg-test
9-
VERSION := 1.11.2
9+
VERSION := 2.0.0
1010

1111

1212
# ------------------------------------------------------------------------------

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ All steps are performed as `root`:
3939
[root@client ~ ] $ git clone https://github.com/brianhlin/osg-test.git
4040
[root@client ~ ] $ cd osg-test
4141

42-
2. Bootstrap the test system using the `osg-testing` yum repository. The `osg release` is required as the first argument and takes the form of '<major version>.<minor version>' e.g. `3.2`. To get `osg-test` from the `osg-development` Yum repository, replace the second argument with `development`; to get `osg-test` from the production repository, omit the second argument. This step makes sure that both the EPEL and OSG repositories are available, then installs and verifies the `osg-test` package itself.
42+
2. Bootstrap the test system using the `osg-testing` yum repository. The `osg release` is required as the first argument and takes the form of `<major version>.<minor version>` e.g. `3.2`. To get `osg-test` from the `osg-development` Yum repository, replace the second argument with `development`; to get `osg-test` from the production repository, omit the second argument. This step makes sure that both the EPEL and OSG repositories are available, then installs and verifies the `osg-test` package itself.
4343

4444
[root@client ~] $ ./bootstrap-osg-test <osg release> testing
4545

46-
3. Run the tests (see below for options). Be sure to direct the stdout/stderr to a file to get all the information from the test run (the dump-file option only outputs some of the output to a file):
46+
3. Run the tests (see below for options). Be sure to direct the stdout/stderr to a file to get all the information from the test run (the dump-file option only outputs some of the output to a file):
4747

4848
[root@client ~] $ osg-test -vadi <PACKAGE> -r osg-testing > <output file> 2>&1
4949

50-
`osg-test` Usage
51-
----------------
50+
osg-test Script Usage
51+
---------------------
5252

5353
Fundamentally, the `osg-test` script runs tests and reports on their results. However, the script can also perform many of the housekeeping tasks associated with setting up and tearing down the test environment, including adding (and later removing) a test user and its X.509 certificate, installing (and later removing) one or more RPMs, and so on. The following options are available:
5454

bootstrap-osg-test

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
#!/bin/bash
22

3-
# The way in which we download and/or install the YUM repository RPMs is unsafe,
4-
# because it assumes specific versions at specific URLs. Ideally, we would have
5-
# a way to discover the latest versions and grab them.
6-
73
on_error_die()
84
{
95
if [ $? -ne 0 ]; then
@@ -45,13 +41,11 @@ esac
4541
release=`cat /etc/redhat-release`
4642
case $release in
4743
*6.* )
48-
rpm_name='epel-release-6-8.noarch.rpm'
49-
rpm_path='http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm'
44+
rpm_name='epel-release-latest-6.noarch.rpm'
5045
osg_name="osg-$version-el6-release-latest.rpm"
5146
;;
5247
*7.* )
53-
rpm_name='epel-release-7-5.noarch.rpm'
54-
rpm_path='https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm'
48+
rpm_name='epel-release-latest-7.noarch.rpm'
5549
osg_name="osg-$version-el7-release-latest.rpm"
5650
;;
5751
* )
@@ -60,6 +54,7 @@ case $release in
6054
;;
6155
esac
6256

57+
rpm_path="https://dl.fedoraproject.org/pub/epel/$rpm_name"
6358
epel_rpm=`rpm -q epel-release 2>/dev/null`
6459
if [ $? -eq 1 ]; then
6560
echo -n "Downloading $rpm_name... "
@@ -84,7 +79,7 @@ on_error_die "Could not enable epel"
8479
osg_rpm=`rpm -q osg-release 2>/dev/null`
8580
if [ $? -eq 1 ]; then
8681
echo -n "Downloading $osg_name... "
87-
curl --fail --location --output $osg_name --retry 10 --silent http://repo.grid.iu.edu/osg/$version/$osg_name
82+
curl --fail --location --output $osg_name --retry 10 --silent https://repo.grid.iu.edu/osg/$version/$osg_name
8883
on_error_die "Could not download $osg_name"
8984
echo -n 'Installing osg-release... '
9085
rpm --install --nosignature $osg_name
@@ -97,12 +92,12 @@ echo -n 'Updating osg-release... '
9792
yum -y --quiet update osg-release
9893
on_error_die 'Could not update osg-release'
9994

100-
echo -n "Install yum-priorities... "
101-
yum -y --quiet install yum-priorities
102-
on_error_die "Could not install yum-priorities"
103-
echo -n 'Verify yum-priorities... '
104-
rpm --verify yum-priorities || rpm --verify yum-plugin-priorities
105-
on_error_die "Could not verify yum-priorities or yum-plugin-priorities"
95+
echo -n "Install yum-plugin-priorities... "
96+
yum -y --quiet install yum-plugin-priorities
97+
on_error_die "Could not install yum-plugin-priorities"
98+
echo -n 'Verify yum-plugin-priorities... '
99+
rpm --verify yum-plugin-priorities
100+
on_error_die "Could not verify yum-plugin-priorities"
106101

107102
# Always erase and install, to get latest
108103
rpm -e osg-test >/dev/null 2>&1

files/test_sequence

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
test_03_haveged
12
test_04_java
23
test_05_mysqld
34
test_06_fetch_crl
45
test_07_munge
56
test_09_jobs
67
test_10_condor
78
test_11_condor_cron
8-
test_12_gatekeeper
99
test_13_gridftp
1010
test_14_lcmaps
1111
test_15_xrootd
@@ -37,10 +37,10 @@ test_49_jobs
3737
test_50_voms
3838
test_51_edgmkgridmap
3939
test_52_bestman
40-
test_58_gfal2util
4140
test_53_gums
4241
test_54_gratia
4342
test_55_condorce
43+
test_58_gfal2util
4444
test_59_gsiopenssh
4545
test_74_slurm
4646
test_75_gums
@@ -54,7 +54,6 @@ test_83_rsv
5454
test_84_xrootd
5555
test_85_lcmaps
5656
test_86_gridftp
57-
test_87_gatekeeper
5857
test_88_condor_cron
5958
test_89_condor
6059
test_90_bestman
@@ -64,3 +63,5 @@ test_94_munge
6463
test_95_mysqld
6564
test_96_proxy
6665
test_97_java
66+
test_98_haveged
67+

osgtest/library/condor.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,6 @@
22

33
import osgtest.library.core as core
44

5-
def lockfile_path():
6-
"""The path to the condor lockfile (EL5 and EL6 only)
7-
Returns None on EL7.
8-
9-
"""
10-
if core.el_release() >= 7:
11-
return None
12-
13-
condor_lockfile = '/var/lock/subsys/condor_master'
14-
# The name of the lockfile changed in 7.8.8
15-
if core.rpm_is_installed('condor'):
16-
condor_version = core.get_package_envra('condor')[2]
17-
condor_version_split = condor_version.split('.')
18-
if condor_version_split >= ['7', '8', '8']:
19-
condor_lockfile = '/var/lock/subsys/condor'
20-
return condor_lockfile
21-
225
def wait_for_daemon(collector_log_path, stat, daemon, timeout):
236
"""Wait until the requested 'daemon' is available and accepting commands by
247
monitoring the specified CollectorLog from the position specified by 'stat'

osgtest/library/core.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def missing_rpm(*packages):
311311
312312
If any package is missing, list all missing packages in a skip() message.
313313
"""
314-
if isinstance(packages[0], list) or isinstance(packages[0], tuple):
314+
if isinstance(packages[0], (list, tuple)):
315315
packages = packages[0]
316316

317317
missing = []
@@ -346,7 +346,7 @@ def skip_ok_unless_installed(*packages_or_dependencies, **kwargs):
346346
raise TypeError("skip_ok_unless_installed() got unexpected keyword argument(s) '%s'" %
347347
("', '".join(kwargs.keys())))
348348

349-
if isinstance(packages_or_dependencies[0], list) or isinstance(packages_or_dependencies[0], tuple):
349+
if isinstance(packages_or_dependencies[0], (list, tuple)):
350350
packages_or_dependencies = packages_or_dependencies[0]
351351

352352
missing = []
@@ -383,8 +383,8 @@ def skip_ok_unless_one_installed(*packages):
383383
Raise osgunittest.SkipOkException if at least one of the packages are installed
384384
otherwise return None.
385385
"""
386-
if isinstance(packages[0], list) or isinstance(packages[0], tuple):
387-
packages = packages[0]
386+
if isinstance(packages[0], (list, tuple)):
387+
packages = packages[0]
388388
installed = []
389389
for package in packages:
390390
if rpm_is_installed(package):
@@ -406,14 +406,7 @@ def get_package_envra(package_name):
406406
raise OSError(status, stdout)
407407

408408
envra = stdout.strip().split(' ')
409-
# On EL5 machines, both i386 and x86_64 versions of packages get installed, causing this function to always fail
410-
if (len(envra) == 10 and
411-
envra[0] == envra[5] and
412-
envra[1] == envra[6] and
413-
envra[2] == envra[7] and
414-
envra[3] == envra[8]):
415-
envra = envra[0:5]
416-
elif len(envra) != 5:
409+
if len(envra) != 5:
417410
raise OSError(status, stdout)
418411
(epoch, name, version, release, arch) = envra
419412
# Missing epoch is displayed as '(none)' but treated by rpm as '0'
@@ -506,7 +499,7 @@ def __run_command(command, use_test_user, a_input, a_stdout, a_stderr, log_outpu
506499
if shell:
507500
if not isinstance(command, str):
508501
command = ' '.join(command)
509-
elif not (isinstance(command, list) or isinstance(command, tuple)):
502+
elif not isinstance(command, (list, tuple)):
510503
try:
511504
repr(command)
512505
except TypeError:
@@ -606,8 +599,8 @@ def wait_for_file(filename, timeout):
606599

607600
def el_release():
608601
"""Return the major version of the Enterprise Linux release the system is
609-
running. SL/RHEL/CentOS 5.x will return 5; SL/RHEL/CentOS 6.x will return
610-
6.
602+
running. SL/RHEL/CentOS 6.x will return 6; SL/RHEL/CentOS 7.x will return
603+
7.
611604
612605
"""
613606
global _el_release

osgtest/library/files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def write(path, contents, owner=None, backup=True, chown=(0,0), chmod=0600):
104104
temp_fd, temp_path = tempfile.mkstemp(prefix=os.path.basename(path) + '.', suffix='.osgtest-new',
105105
dir=os.path.dirname(path))
106106
temp_file = os.fdopen(temp_fd, 'w')
107-
if isinstance(contents, list) or isinstance(contents, tuple):
107+
if isinstance(contents, (list, tuple)):
108108
temp_file.writelines(contents)
109109
else:
110110
temp_file.write(contents)

osgtest/library/tomcat.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,12 @@
22

33
import osgtest.library.core as core
44

5-
def majorver():
6-
"Tomcat major version"
7-
if core.el_release() == 7:
8-
return 7
9-
if core.el_release() == 6:
10-
return 6
11-
else:
12-
return 5
13-
145
def pkgname():
156
"Name of the Tomcat package"
16-
if majorver() <= 6:
17-
return "tomcat" + str(majorver())
18-
return "tomcat"
7+
if core.el_release() == 6:
8+
return "tomcat6"
9+
else:
10+
return "tomcat"
1911

2012
def datadir():
2113
"Path of data directory of Tomcat"
@@ -39,7 +31,7 @@ def contextfile():
3931

4032
def catalinafile():
4133
"Path of Catalina log file that contains the startup sentinel"
42-
if majorver() <= 6:
34+
if pkgname() == "tomcat6":
4335
return os.path.join(logdir(), 'catalina.out')
4436
else:
4537
return os.path.join(logdir(), 'catalina.log')
@@ -50,8 +42,5 @@ def pidfile():
5042

5143
def serverlibdir():
5244
"Path of the server libraries dir of Tomcat"
53-
if majorver() >= 6:
54-
return os.path.join(datadir(), "lib")
55-
else:
56-
return os.path.join(datadir(), "server/lib")
45+
return os.path.join(datadir(), "lib")
5746

osgtest/library/voms.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ def is_installed():
148148
if not core.dependency_is_installed(dep):
149149
return False
150150

151+
# TODO: drop this check when 3.3 is completely EOL
151152
if core.el_release() >= 7:
152153
epoch, _, version, release, _ = core.get_package_envra('voms-server')
153154
if core.version_compare((epoch, version, release), '2.0.12-3.2') < 0:

osgtest/library/yum.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ def clean(*repos):
1515
if not repos: # clean all repos if none specified
1616
repos = ['*']
1717

18-
for subcmd in ('all', 'expire-cache'):
19-
cmd = ['yum'] + ['--enablerepo=' + x for x in repos] + ['clean', subcmd]
20-
core.system(cmd)
18+
core.system(['yum'] + ['--enablerepo=' + x for x in repos] + ['clean', 'all'])
2119

2220

2321
def retry_command(command, timeout_seconds=3600):

0 commit comments

Comments
 (0)