Skip to content
Browse files

test pass (again AHHHH)

  • Loading branch information...
1 parent e2a0f66 commit 5abde07fde502e5f117acd42e1edf1294edb67a0 BuzzTroll committed Jun 15, 2010
View
2 authzdb/src/org/nimbus/authz/AuthzDBAdapter.java
@@ -341,6 +341,8 @@ private int getParentObject(
ow.setName(rs.getString("name"));
ow.setId(rs.getInt("id"));
ow.setSize(rs.getInt("object_size"));
+ Timestamp time = rs.getTimestamp("creation_time");
+ ow.setTime(time.getTime());
objs.add(ow);
}
return objs;
View
13 authzdb/src/org/nimbus/authz/ObjectWrapper.java
@@ -1,5 +1,7 @@
package org.nimbus.authz;
+import java.sql.Timestamp;
+
/**
* Created by John Bresnahan
* User: bresnaha
@@ -13,6 +15,7 @@
private String name;
private int id;
private long size;
+ private long timestamp;
public void setName(String n)
{
@@ -43,4 +46,14 @@ public int getId()
{
return this.id;
}
+
+ public void setTime(long tm)
+ {
+ this.timestamp = tm;
+ }
+
+ public long getTime()
+ {
+ return this.timestamp;
+ }
}
View
5 bin/create-nimbus-home
@@ -79,6 +79,11 @@ if [ $? -ne 0 ]; then
exit 1
fi
source $NIMBUS_HOME/cumulus/env.sh
+export CUMULUS_REPO_BUCKET="Repo"
+export CUMULUS_HOST=`hostname`:8888
+
+echo $CUMULUS_REPO_BUCKET $CUMULUS_HOST
+${NIMBUS_SRC}/cumulus/bin/cumulus-create-repo-admin nimbusadmin@`hostname -f` ${CUMULUS_REPO_BUCKET}
echo "Deploying skeleton directory structure.."
View
4 cumulus/src/etc/acl.sql
@@ -72,8 +72,8 @@ insert into user_alias_types(name) values ('unix');
create table user_alias(
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id char(36) REFERENCES users_canonical(id) NOT NULL,
- alias_name varchar(256),
- friendly_name varchar(256),
+ alias_name varchar(256) NOT NULL,
+ friendly_name varchar(256) NOT NULL,
alias_type INTEGER REFERENCES user_alias_types(id) NOT NULL,
alias_type_data varchar(1024),
UNIQUE(alias_name, alias_type),
View
6 cumulus/src/pycb/cbAuthzSecurity.py
@@ -277,15 +277,15 @@ def __init__(self, con_str):
# add a public user (if not there)
try:
pub = User(db_obj, uu=pycb.public_user_id, friendly=pycb.public_user_id, create=True)
- pu = pub.create_alias(pycb.public_user_id, pynimbusauthz.alias_type_s3)
+ pu = pub.create_alias(pycb.public_user_id, pynimbusauthz.alias_type_s3, pycb.public_user_id)
except:
#pycb.log(logging.INFO, "error adding user public %s" % (sys.exc_info()[0]), tb = traceback)
pass
#traceback.print_exc(file=sys.stdout)
# add a authenticated user (if not there)
try:
authed = User(db_obj, uu=pycb.authenticated_user_id, friendly=pycb.authenticated_user_id, create=True)
- au = authed.create_alias(pycb.authenticated_user_id, pynimbusauthz.alias_type_s3)
+ au = authed.create_alias(pycb.authenticated_user_id, pynimbusauthz.alias_type_s3, pycb.authenticated_user_id)
except:
#pycb.log(logging.INFO, "error adding user authed %s" % (sys.exc_info()[0]), tb=traceback)
#traceback.print_exc(file=sys.stdout)
@@ -303,7 +303,7 @@ def get_user(self, id):
def create_user(self, display_name, id, pw, opts):
db_obj = DB(con_str=self.con_str)
user = User(db_obj)
- user_alias = user.create_alias(id, "s3", alias_data=pw, friendly_name=display_name)
+ user_alias = user.create_alias(id, "s3", display_name, alias_data=pw)
db_obj.commit()
db_obj.close()
View
5 cumulus/src/pynimbusauthz/add_user.py
@@ -49,6 +49,9 @@ def setup_options(argv):
if o.alias == None and o.setkey != None:
raise AuthzException('CLI_PARAMETER', "You must specify the alias that you are changing")
+ if o.alias != None and o.friendlyname == None:
+ o.friendlyname = o.alias
+
return (o, args)
def main(argv=sys.argv[1:]):
@@ -72,7 +75,7 @@ def main(argv=sys.argv[1:]):
if opts.alias != None:
user_alias = user.get_alias(opts.alias, opts.type)
if user_alias == None:
- user_alias = user.create_alias(opts.alias, opts.type, friendly_name=opts.friendlyname)
+ user_alias = user.create_alias(opts.alias, opts.type, opts.friendlyname)
pynimbusauthz.print_msg(opts, 0, "Creating new alias %s:%s" % (opts.type,opts.alias))
if opts.genkey:
data = pynimbusauthz.random_string_gen(42)
View
2 cumulus/src/pynimbusauthz/user.py
@@ -129,7 +129,7 @@ def get_alias_by_type(self, alias_type):
c = self.db_obj._run_fetch_iterator(s, data, _convert_alias_row_to_UserAlias)
return c
- def create_alias(self, alias_name, alias_type, alias_data=None, friendly_name=None):
+ def create_alias(self, alias_name, alias_type, friendly_name, alias_data=None):
at = pynimbusauthz.alias_types[alias_type]
i = "INSERT INTO user_alias(user_id, alias_name, alias_type"
v = "values(?, ?, ?"
View
24 cumulus/src/tests/authz/user_tests.py
@@ -49,19 +49,19 @@ def test_null_alias(self):
def test_create_alias_simple(self):
user1 = User(self.db)
- alias1 = user1.create_alias("/name/", pynimbusauthz.alias_type_s3)
+ alias1 = user1.create_alias("/name/", pynimbusauthz.alias_type_s3, "testname@")
user2 = alias1.get_canonical_user()
self.assertEqual(user1.get_id(), user2.get_id(), "User IDs should be equal")
- alias1 = user1.create_alias("/name2", pynimbusauthz.alias_type_s3, "pooP")
+ alias1 = user1.create_alias("/name2", pynimbusauthz.alias_type_s3, "name2@", "pooP")
user2 = alias1.get_canonical_user()
self.assertEqual(user1.get_id(), user2.get_id(), "User IDs should be equal")
print alias1
def test_alias_lookup_simple(self):
user1 = User(self.db)
- alias1 = user1.create_alias("/name/", pynimbusauthz.alias_type_s3)
+ alias1 = user1.create_alias("/name/", pynimbusauthz.alias_type_s3, "name1@")
alias2 = user1.get_alias("/name/", pynimbusauthz.alias_type_s3)
self.assertEqual(alias1.get_name(), alias2.get_name(), "Alias names should be the same")
@@ -70,10 +70,10 @@ def test_alias_lookup_simple(self):
def test_alias_lookup(self):
user1 = User(self.db)
- alias1 = user1.create_alias("/name/", pynimbusauthz.alias_type_s3)
- aliasX = user1.create_alias("/name2", pynimbusauthz.alias_type_s3)
- aliasX = user1.create_alias("/name3", pynimbusauthz.alias_type_s3)
- aliasX = user1.create_alias("/name4", pynimbusauthz.alias_type_s3)
+ alias1 = user1.create_alias("/name/", pynimbusauthz.alias_type_s3, "1")
+ aliasX = user1.create_alias("/name2", pynimbusauthz.alias_type_s3, "2")
+ aliasX = user1.create_alias("/name3", pynimbusauthz.alias_type_s3, "3")
+ aliasX = user1.create_alias("/name4", pynimbusauthz.alias_type_s3, "4")
all_alias = user1.get_all_alias()
found = False
for a in all_alias:
@@ -90,17 +90,17 @@ def test_alias_lookup(self):
def test_delete_alias(self):
user1 = User(self.db)
- alias1 = user1.create_alias("/name/", pynimbusauthz.alias_type_s3)
+ alias1 = user1.create_alias("/name/", pynimbusauthz.alias_type_s3, "name@")
alias1.remove()
alias2 = user1.get_alias("/name/", pynimbusauthz.alias_type_s3)
self.assertEqual(alias2, None, "The alias should be gone")
def test_create_same_alias(self):
user1 = User(self.db)
- alias1 = user1.create_alias("/name/", pynimbusauthz.alias_type_s3)
+ alias1 = user1.create_alias("/name/", pynimbusauthz.alias_type_s3, "name@")
try:
- alias2 = user1.create_alias("/name/", pynimbusauthz.alias_type_s3)
+ alias2 = user1.create_alias("/name/", pynimbusauthz.alias_type_s3, "name@")
self.fail("This should have caused an conflict on insert")
except:
pass
@@ -138,7 +138,7 @@ def test_find_user_alias(self):
user1 = User(self.db)
self.db.commit()
alias_name = "helloname"
- alias1 = user1.create_alias(alias_name, pynimbusauthz.alias_type_s3)
+ alias1 = user1.create_alias(alias_name, pynimbusauthz.alias_type_s3, alias_name)
self.db.commit()
fid = "%%" + alias_name[1:]
lid = alias_name[:-1] + "%%"
@@ -164,7 +164,7 @@ def test_set_alias_data(self):
user1 = User(self.db)
self.db.commit()
alias_name = "helloname"
- alias1 = user1.create_alias(alias_name, pynimbusauthz.alias_type_s3)
+ alias1 = user1.create_alias(alias_name, pynimbusauthz.alias_type_s3, alias_name)
key = "helloworld"
alias1.set_data(key)
self.db.commit()
View
1 cumulus/src/tests/run-pass.sh
@@ -20,6 +20,7 @@ if [ "X${CUMULUS_TEST_HTTPS}" == "X" ]; then
fi
+$CUMULUS_HOME/bin/cumulus-remove-user tests3cmd1@nimbus.test
$CUMULUS_HOME/bin/cumulus -p $cumulus_port $https_opt &
cumulus_pid=$!
echo $cumulus_pid
View
5 messaging/gt4.0/java/gar-builder/etc/post-deploy.xml
@@ -120,6 +120,11 @@
value="${env.CUMULUS_HOME}"/>
<filter token="AUTHZDB"
value="${env.NIMBUS_AUTHZ_DB}"/>
+
+ <filter token="CUMULUS_REPO_BUCKET"
+ value="${env.CUMULUS_REPO_BUCKET}"/>
+ <filter token="CUMULUS_HOST"
+ value="${env.CUMULUS_HOST}"/>
</filterset>
View
4 service/service/java/source/etc/workspace-service/other/common.conf
@@ -64,6 +64,6 @@ msgsinks.dir=/@WORKSPACE_PERSISTENCEDIR@/msg-sinks
cumulus.home.dir=/@CUMULUSDIR@
cumulus.authz.db=/@AUTHZDB@
cumulus.repo.dir=/@CUMULUSDIR@/posixdata
-cumulus.host=@CUMULUSHOST@
-cumulus.repo.bucket=Repo
+cumulus.host=@CUMULUS_HOST@
+cumulus.repo.bucket=@CUMULUS_REPO_BUCKET@
cumulus.repo.prefix=VM

0 comments on commit 5abde07

Please sign in to comment.
Something went wrong with that request. Please try again.