Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
e90a6e2a
Commit
e90a6e2a
authored
Mar 25, 2010
by
Tom Mitchell
Browse files
Merge branch 'master' into passphrase
parents
76e8ef8a
7b0b0005
Changes
2
Hide whitespace changes
Inline
Side-by-side
protogeni/test/
clrhouse
list.py
→
protogeni/test/list
-ch
.py
View file @
e90a6e2a
...
...
@@ -26,29 +26,31 @@ from M2Crypto import X509
execfile
(
"test-common.py"
)
TYPE
=
None
if
len
(
REQARGS
)
==
1
:
TYPE
=
REQARGS
[
0
]
else
:
print
"You must supply a TYPE (users|slices|authorities) to list"
sys
.
exit
(
1
)
pass
# sanity check on TYPE
if
TYPE
not
in
[
"users"
,
"slices"
,
"authorities"
]:
print
"TYPE must be one of users|slices|authorities"
sys
.
exit
(
1
)
#
# Get a credential for myself, that allows me to do things at the SA.
#
mycredential
=
get_self_credential
()
#
# Ask the clearinghouse for a list of slices
#
params
=
{}
params
[
"credential"
]
=
mycredential
params
[
"type"
]
=
"slices"
rval
,
response
=
do_method
(
"ch"
,
"List"
,
params
)
if
rval
:
Fatal
(
"Could not get the list from the ClearingHouse"
)
pass
print
str
(
response
[
"value"
])
#
# Ask the clearinghouse for a list of authorities
#
# Ask the clearinghouse for a list of users|slices|authorities as specified
# by TYPE
params
=
{}
params
[
"credential"
]
=
mycredential
params
[
"type"
]
=
"authorities"
params
[
"type"
]
=
TYPE
rval
,
response
=
do_method
(
"ch"
,
"List"
,
params
)
if
rval
:
Fatal
(
"Could not get the list from the ClearingHouse"
)
...
...
protogeni/test/resolve-ch.py
0 → 100755
View file @
e90a6e2a
#! /usr/bin/env python
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2009-2010 University of Utah and the Flux Group.
# All rights reserved.
#
# Permission to use, copy, modify and distribute this software is hereby
# granted provided that (1) source code retains these copyright, permission,
# and disclaimer notices, and (2) redistributions including binaries
# reproduce the notices in supporting documentation.
#
# THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
# CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
# FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
#
#
#
import
sys
import
pwd
import
getopt
import
os
import
time
import
re
execfile
(
"test-common.py"
)
HRN
=
None
TYPE
=
None
if
len
(
REQARGS
)
==
2
:
HRN
=
REQARGS
[
0
]
TYPE
=
REQARGS
[
1
]
else
:
print
"You must supply a HRN and TYPE to resolve"
sys
.
exit
(
1
)
pass
# sanity check on specified type
if
TYPE
not
in
[
"SA"
,
"CM"
,
"Component"
,
"Slice"
,
"User"
]:
print
"TYPE must be one of SA|CM|Component|Slice|User"
sys
.
exit
(
1
)
#
# Get special credentials from the command line, that allows me to do things at the CH.
#
if
not
selfcredentialfile
:
print
"Please specify special credentials with -c option."
sys
.
exit
(
1
)
mycredential
=
get_self_credential
()
print
"Resolving at the CH"
params
=
{}
params
[
"credential"
]
=
mycredential
params
[
"hrn"
]
=
HRN
params
[
"type"
]
=
TYPE
rval
,
response
=
do_method
(
"ch"
,
"Resolve"
,
params
,
version
=
"2.0"
)
if
rval
:
Fatal
(
"Could not resolve"
)
pass
value
=
response
[
"value"
]
print
str
(
value
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment