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

Prepare new version 1.10.0 #4

Merged
merged 16 commits into from
Mar 22, 2023
Merged
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
35 changes: 14 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
build/RPMS/noarch/ginfo-*.el7.noarch.rpm

# Use a matrix for AlmaLinux versions
build:
build-almalinux:
strategy:
matrix:
almalinux-version: [8, 9]
Expand All @@ -54,8 +54,9 @@ jobs:
with:
name: rpms${{ matrix.almalinux-version }}
path: |
build/RPMS/noarch/bdii-config-site-*.el${{ matrix.almalinux-version }}.noarch.rpm
build/RPMS/noarch/ginfo-*.el${{ matrix.almalinux-version }}.noarch.rpm

# XXX: python3 comes from EPEL
install-centos7:
name: Install CentOS 7 RPMs
needs: build-centos7
Expand All @@ -67,30 +68,22 @@ jobs:
name: rpms7
- name: Install generated RPMs
run: |
yum install -y epel-release
yum localinstall -y ginfo-*.el7.noarch.rpm

almalinux8-install:
name: Install AlmaLinux 8 RPMs
needs: build
runs-on: ubuntu-latest
container: almalinux:8
steps:
- uses: actions/download-artifact@v3
with:
name: rpms8
- name: Install generated RPMs
run: |
yum localinstall -y ginfo-*.el8.noarch.rpm

almalinux9-install:
name: Install AlmaLinux 9 RPMs
needs: build
# Use a matrix for AlmaLinux versions
install-almalinux:
strategy:
matrix:
almalinux-version: [8, 9]
name: Install AlmaLinux ${{ matrix.almalinux-version }} RPMs
needs: build-almalinux
runs-on: ubuntu-latest
container: almalinux:9
container: almalinux:${{ matrix.almalinux-version }}
steps:
- uses: actions/download-artifact@v3
with:
name: rpms9
name: rpms${{ matrix.almalinux-version }}
- name: Install generated RPMs
run: |
yum localinstall -y ginfo-*.el9.noarch.rpm
yum localinstall -y ginfo-*.el${{ matrix.almalinux-version }}.noarch.rpm
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ jobs:
yum install -y epel-release
yum install -y http://repository.egi.eu/sw/production/umd/4/centos7/x86_64/updates/umd-release-4.1.3-1.el7.centos.noarch.rpm
yum install -y python3 bdii-config-site
# to provide killall
yum install -y psmisc
cd tests/
# Start Database
./run-db
# Run the tests
./run-tests.sh
./test-ginfo.py
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ and this project adheres to

## [Unreleased]

## [1.10.0] - 2023-03-20

### Added

- Update source URL information, package additional documentation, build using AlmaLinux. (#3) (Baptiste Grenier)

## [1.9.0] 2014-08-29
### Added
- Beta version for the version 2 of ginfo which allow requests on multiple objects (Ivan Calvet)
14 changes: 12 additions & 2 deletions ginfo.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: ginfo
Version: 1.9.0
Version: 1.10.0
Release: 1%{?dist}
Summary: A versatile tool for discovering Grid services
Group: Applications/Internet
Expand All @@ -14,7 +14,7 @@ BuildRequires: make
Requires: python3-ldap

%description
A versatile tool for discovering Grid services by querying either
A versatile tool for discovering Grid services by querying either
LDAP-based Grid information services or the EMI Registry.

%prep
Expand All @@ -39,19 +39,29 @@ rm -rf %{buildroot}
%license %{_datadir}/licenses/%{name}-%{version}/LICENSE.txt

%changelog
* Mon Mar 20 2023 Baptiste Grenier <baptiste.grenier@egi.eu> - 1.10.0-1
- Update source URL information, package additional documentation, build using AlmaLinux. (#3) (Baptiste Grenier)

* Fri Aug 29 2014 Ivan Calvet <ivan.calvet@cern.ch> - 1.9.0-1
- Beta version for the version 2 of ginfo which allow requests on multiple objects

* Wed Oct 2 2013 Laurence Field <laurence.field@cern.ch> - 1.0.3-1
- Added support for Storage Shares

* Thu May 23 2013 Laurence Field <laurence.field@cern.ch> - 1.0.2-1
- Minor cosmetic improvements

* Thu Apr 25 2013 Laurence Field <laurence.field@cern.ch> - 1.0.1-1
- Refactored version enabling general GLUE 2.0 queries

* Thu Oct 25 2012 Laurence Field <laurence.field@cern.ch> - 0.2.4-1
- Added -b --bind option.

* Wed Aug 29 2012 Laurence Field <laurence.field@cern.ch> - 0.2.3-1
- Improved the EMI output.

* Thu Jul 19 2012 Laurence Field <laurence.field@cern.ch> - 0.2.2-1
- Added a timeout for the queries.

* Fri Jul 13 2012 Laurence Field <laurence.field@cern.ch> - 0.2.1-2
- Initial version
32 changes: 16 additions & 16 deletions tests/test-ginfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@

version_message = "ginfo V1.9.0"

normal_output = "EndpointCapability: capability_a, capability_b, capability_c\nServiceAdminDomainForeignKey: domain_a\nServiceID: service_1\nEndpointImplementationName: implementation_name_a\nEndpointImplementationVersion: 5.0.0\nEndpointInterfaceName: interface_name_a\nEndpointInterfaceVersion: 3.0.0\nEndpointQualityLevel: testing\nServiceType: service_type_a\nEndpointURL: ldap://host:2170/XXX\nPolicyRule: ALL\n"
normal_output = "EndpointCapability: capability_a, capability_b, capability_c\nServiceAdminDomainForeignKey: domain_a\nServiceID: service_1\nEndpointImplementationName: implementation_name_a\nEndpointImplementationVersion: 5.0.0\nEndpointInterfaceName: interface_name_a\nEndpointInterfaceVersion: 3.0.0\nEndpointQualityLevel: testing\nServiceType: service_type_a\nEndpointURL: ldap://host:2170/XXX\nPolicyRule: ALL\n" # noqa: E501

json_output = '{"service_1": {"EndpointImplementationVersion": "5.0.0", "ServiceAdminDomainForeignKey": "domain_a", "EndpointQualityLevel": "testing", "EndpointInterfaceVersion": "3.0.0", "EndpointImplementationName": "implementation_name_a", "PolicyRule": ["ALL"], "EndpointURL": "ldap://host:2170/XXX", "EndpointCapability": ["capability_a", "capability_b", "capability_c"], "ServiceID": "service_1", "EndpointInterfaceName": "interface_name_a", "ServiceType": "service_type_a"}}'
json_output = '{"service_1": {"EndpointImplementationVersion": "5.0.0", "ServiceAdminDomainForeignKey": "domain_a", "EndpointQualityLevel": "testing", "EndpointInterfaceVersion": "3.0.0", "EndpointImplementationName": "implementation_name_a", "PolicyRule": ["ALL"], "EndpointURL": "ldap://host:2170/XXX", "EndpointCapability": ["capability_a", "capability_b", "capability_c"], "ServiceID": "service_1", "EndpointInterfaceName": "interface_name_a", "ServiceType": "service_type_a"}}' # noqa: E501

csv_output = 'EndpointCapability,ServiceAdminDomainForeignKey,ServiceID,EndpointImplementationName,EndpointImplementationVersion,EndpointInterfaceName,EndpointInterfaceVersion,EndpointQualityLevel,ServiceType,EndpointURL,PolicyRule\n"capability_a,capability_b,capability_c",domain_a,service_1,implementation_name_a,5.0.0,interface_name_a,3.0.0,testing,service_type_a,ldap://host:2170/XXX,"ALL"'
csv_output = 'EndpointCapability,ServiceAdminDomainForeignKey,ServiceID,EndpointImplementationName,EndpointImplementationVersion,EndpointInterfaceName,EndpointInterfaceVersion,EndpointQualityLevel,ServiceType,EndpointURL,PolicyRule\n"capability_a,capability_b,capability_c",domain_a,service_1,implementation_name_a,5.0.0,interface_name_a,3.0.0,testing,service_type_a,ldap://host:2170/XXX,"ALL"' # noqa: E501

emi_output = [
"[",
Expand Down Expand Up @@ -269,7 +269,7 @@ def assert_items_equal(self, command, expected_items, error=None):
+ "\n\n!=\n\n"
+ str(expected_items)
)
self.assertItemsEqual(res, expected_items, error)
self.assertEqual(res, expected_items, error)

def assert_items_equal2(self, command, expected_items, error=None):
if command not in result:
Expand All @@ -289,7 +289,7 @@ def assert_items_equal2(self, command, expected_items, error=None):
+ "\n\n!=\n\n"
+ str(expected_items)
)
self.assertItemsEqual(res, expected_items, error)
self.assertEqual(res, expected_items, error)

def assert_time_equal(self, command, expected_time):
start_time = time.time()
Expand Down Expand Up @@ -362,15 +362,15 @@ def test5_filter_attr(self):
for j in list_results[att][2]:
if j and j.find(" ") == -1:
expected_items = [
"Verbose mode enabled\nOutput in csv formating\nThe following host will be used: "
"Verbose mode enabled\nOutput in csv formating\nThe following host will be used: " # noqa: E501
+ host
+ ":"
+ port
+ "\nFilter services by the following "
+ list_results[att][1]
+ ": "
+ j
+ "\nThe following attribute(s) will be displayed: ServiceID"
+ "\nThe following attribute(s) will be displayed: ServiceID" # noqa: E501
]
expected_items.append("ServiceID")
expected_items.extend(list_results[att][2][j])
Expand All @@ -384,7 +384,7 @@ def test6_display_attr(self):
for i in (att, list_results[att][1]):
if i not in ["id", "ServiceID"]:
expected_items = [
"Verbose mode enabled\nOutput in csv formating\nThe following host will be used: "
"Verbose mode enabled\nOutput in csv formating\nThe following host will be used: " # noqa: E501
+ host
+ ":"
+ port
Expand All @@ -408,11 +408,11 @@ def test7_cleaning(self):
("vo", 'PolicyRule\n"INVALID"'),
(
"--clean",
'EndpointCapability,ServiceAdminDomainForeignKey,ServiceID,EndpointImplementationName,EndpointImplementationVersion,EndpointInterfaceName,EndpointInterfaceVersion,EndpointQualityLevel,ServiceType,EndpointURL,PolicyRule\n"capability_a,capability_d",INVALID,service_4,INVALID,INVALID,interface_name_a,INVALID,INVALID,service_type_b,INVALID,"INVALID"',
'EndpointCapability,ServiceAdminDomainForeignKey,ServiceID,EndpointImplementationName,EndpointImplementationVersion,EndpointInterfaceName,EndpointInterfaceVersion,EndpointQualityLevel,ServiceType,EndpointURL,PolicyRule\n"capability_a,capability_d",INVALID,service_4,INVALID,INVALID,interface_name_a,INVALID,INVALID,service_type_b,INVALID,"INVALID"', # noqa: E501
),
(
"--strict",
'EndpointCapability,ServiceAdminDomainForeignKey,ServiceID,EndpointImplementationName,EndpointImplementationVersion,EndpointInterfaceName,EndpointInterfaceVersion,EndpointQualityLevel,ServiceType,EndpointURL,PolicyRule\n"INVALID,INVALID",INVALID,service_4,INVALID,INVALID,INVALID,INVALID,INVALID,INVALID,INVALID,"INVALID"',
'EndpointCapability,ServiceAdminDomainForeignKey,ServiceID,EndpointImplementationName,EndpointImplementationVersion,EndpointInterfaceName,EndpointInterfaceVersion,EndpointQualityLevel,ServiceType,EndpointURL,PolicyRule\n"INVALID,INVALID",INVALID,service_4,INVALID,INVALID,INVALID,INVALID,INVALID,INVALID,INVALID,"INVALID"', # noqa: E501
),
]
for i, j in tests:
Expand All @@ -437,32 +437,32 @@ def test8_various(self):
("--id service_2 -u ldap://host:2170/ZZZ id", "ServiceID"),
(
"--url ldap://host:2170/ZZZ PolicyRule vo EndpointQualityLevel cap",
'PolicyRule,EndpointQualityLevel,EndpointCapability\n"VO:atlas",production,"capability_b,capability_e"',
'PolicyRule,EndpointQualityLevel,EndpointCapability\n"VO:atlas",production,"capability_b,capability_e"', # noqa: E501
),
(
"-d domain_b --impv 5.0.0 -m implementation_name_b -n interface_name_b --cap capability_e --vo VO:atlas -u ldap://host:2170/ZZZ --intv 3.0.1 --ql production --type service_type_a --id service_3 id",
"-d domain_b --impv 5.0.0 -m implementation_name_b -n interface_name_b --cap capability_e --vo VO:atlas -u ldap://host:2170/ZZZ --intv 3.0.1 --ql production --type service_type_a --id service_3 id", # noqa: E501
"ServiceID\nservice_3",
),
("--vo ALL ServiceID", "ServiceID\nservice_1\nservice_2"),
("--cap capability_b --vo ALL id", "ServiceID\nservice_1"),
("--ql testing --type service_type_a vo", 'PolicyRule\n"ALL"'),
(
"--impv 5.0.* id impv",
"ServiceID,EndpointImplementationVersion\nservice_1,5.0.0\nservice_3,5.0.0\nservice_2,5.0.1",
"ServiceID,EndpointImplementationVersion\nservice_1,5.0.0\nservice_3,5.0.0\nservice_2,5.0.1", # noqa: E501
),
(
"-v -i service_1 --clean --timeout 5 id",
"Verbose mode enabled\nOutput in csv formating\nThe following host will be used: localhost:2170\nResults have been cleaned.\nLdap timeout has been set to 5 second(s).\nFilter services by the following ServiceID: service_1\nThe following attribute(s) will be displayed: ServiceID\n\nServiceID\nservice_1",
"Verbose mode enabled\nOutput in csv formating\nThe following host will be used: localhost:2170\nResults have been cleaned.\nLdap timeout has been set to 5 second(s).\nFilter services by the following ServiceID: service_1\nThe following attribute(s) will be displayed: ServiceID\n\nServiceID\nservice_1", # noqa: E501
),
(
"-v --strict --list domain",
"Verbose mode enabled\nThe following host will be used: localhost:2170\nList all the possible values for the following attribute: ServiceAdminDomainForeignKey\nOption --csv is not compatible with --list option.\nResults have been cleaned strictly.\n\ndomain_a\ndomain_b\nINVALID",
"Verbose mode enabled\nThe following host will be used: localhost:2170\nList all the possible values for the following attribute: ServiceAdminDomainForeignKey\nOption --csv is not compatible with --list option.\nResults have been cleaned strictly.\n\ndomain_a\ndomain_b\nINVALID", # noqa: E501
),
]
for i, j in tests:
self.assert_equal("ginfo -c " + i, j)

@unittest.skip("Disabled to speed up debug")
@unittest.skip("Working locally, not within GA")
def test9_timeout(self):
self.assert_time_equal("ginfo --host bdii.scotgrid.ac.uk Endpoint", "60")
self.assert_time_equal(
Expand Down