Skip to content

Commit cc38c1d

Browse files
author
efajardo
committed
Creating the macaroon
1 parent 46ed90b commit cc38c1d

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ env:
55
# - OS_TYPE=centos OS_VERSION=6 PACKAGES=osg-gridftp,rsv,lcmaps,lcmaps-db-templates,vo-client-lcmaps-voms,rsv,llrun
66
# - OS_TYPE=centos OS_VERSION=7 PACKAGES=osg-ce-condor,rsv,vo-client-lcmaps-voms,llrun,singularity-runtime,osg-oasis
77
# - OS_TYPE=centos OS_VERSION=7 PACKAGES=osg-gridftp,rsv,lcmaps,lcmaps-db-templates,vo-client-lcmaps-voms,rsv,llrun,singularity-runtime,osg-oasis
8-
- OS_TYPE=centos OS_VERSION=7 PACKAGES=xrootd,xrootd-client,xrootd-multiuser,xrootd-scitokens,globus-proxy-utils,lcmaps,lcmaps-db-templates,xrootd-lcmaps,vo-client,vo-client-lcmaps-voms
8+
- OS_TYPE=centos OS_VERSION=7 PACKAGES=xrootd,xrootd-client,xrootd-scitokens,globus-proxy-utils,lcmaps,lcmaps-db-templates,xrootd-lcmaps,vo-client,vo-client-lcmaps-voms
99

1010
services:
1111
- docker
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import os
2+
import socket
3+
import shutil
4+
import tempfile
5+
import pwd
6+
import requests
7+
8+
import osgtest.library.core as core
9+
import osgtest.library.files as files
10+
import osgtest.library.osgunittest as osgunittest
11+
12+
13+
class TestXrootdTPC(osgunittest.OSGTestCase):
14+
15+
16+
def test_01_create_macaroons(self):
17+
core.skip_ok_unless_installed('xrootd', 'xrootd-scitokens', by_dependency=True)
18+
euid = os.geteuid()
19+
cert = '/tmp/x509up_u%d' % euid
20+
key = '/tmp/x509up_u%d' % euid
21+
cert = os.environ.get('X509_USER_PROXY', cert)
22+
key = os.environ.get('X509_USER_PROXY', key)
23+
24+
session = requests.Session()
25+
session.verify = False
26+
data_json = {"caveats": "activity:%s" % "DOWNLOAD",
27+
"validity": 20}
28+
urlServer1 = ("http://",core.gethostname(),":9001", '/tmp/tmp.txt')
29+
response = session.post(urlServer1,
30+
headers={"Content-Type": "application/macaroon-request"},
31+
data=json.dumps(data_json)
32+
)
33+
self.assertEqual(response.status_code, requests.codes.ok, "Problems Generating the macaroon")
34+
Macaroon1 = response.text
35+
data_json = {"caveats": "activity:%s" % "UPLOAD",
36+
"validity": 20}
37+
urlServer1 = ("http://",core.gethostname(),":9002", '/tmp/tmp-tpc.txt')
38+
response = session.post(urlServer1,
39+
headers={"Content-Type": "application/macaroon-request"},
40+
data=json.dumps(data_json)
41+
)
42+
self.assertEqual(response.status_code, requests.codes.ok, "Problems Generating the macaroon")
43+
Macaroon2 = response.text
44+
45+
46+
47+

0 commit comments

Comments
 (0)