[Rt-commit] rt branch, 4.0/oracle-testing, updated. rt-4.0.18-53-g86d1b74
Alex Vandiver
alexmv at bestpractical.com
Sat Nov 9 02:34:47 EST 2013
The branch, 4.0/oracle-testing has been updated
via 86d1b740610437556e99dc70d2d76f5879599dc7 (commit)
via df28251b999943063ed9d8357310118c19180663 (commit)
via 1b8eddbb21b304b7a2f98449e2671334307053ea (commit)
from 47396796a467719ef74a80a415e2d47be49fff40 (commit)
Summary of changes:
share/html/Install/DatabaseDetails.html | 12 +++++++++++-
t/api/group.t | 22 +++++++++++++++-------
t/web/installer.t | 1 +
3 files changed, 27 insertions(+), 8 deletions(-)
- Log -----------------------------------------------------------------
commit 1b8eddbb21b304b7a2f98449e2671334307053ea
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Sat Nov 9 01:34:35 2013 -0500
We require the user and their schema to exist, for Oracle -- not just the DB
diff --git a/share/html/Install/DatabaseDetails.html b/share/html/Install/DatabaseDetails.html
index 30a495d..065e38e 100644
--- a/share/html/Install/DatabaseDetails.html
+++ b/share/html/Install/DatabaseDetails.html
@@ -143,7 +143,14 @@ if ( $Run ) {
$dbh = DBI->connect(
RT::Handle->DSN, $ARGS{DatabaseAdmin}, $ARGS{DatabaseAdminPassword}, { RaiseError => 0, PrintError => 0 },
);
-
+
+ if ( $dbh and $db_type eq "Oracle") {
+ # The database _existing_ is itself insufficient for Oracle -- we need to check for the RT user
+ my $sth = $dbh->prepare('SELECT username FROM dba_users WHERE username = ?');
+ $sth->execute( $ARGS{DatabaseUser} );
+ undef $dbh unless $sth->fetchrow_array;
+ }
+
if ( $dbh ) {
# check if table Users exists
eval {
commit df28251b999943063ed9d8357310118c19180663
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Sat Nov 9 01:35:10 2013 -0500
Oracle users cannot have empty passwords -- enforce this
We provide a user password for other databases as well, as it cannot hurt.
diff --git a/share/html/Install/DatabaseDetails.html b/share/html/Install/DatabaseDetails.html
index 065e38e..8e557fc 100644
--- a/share/html/Install/DatabaseDetails.html
+++ b/share/html/Install/DatabaseDetails.html
@@ -149,6 +149,9 @@ if ( $Run ) {
my $sth = $dbh->prepare('SELECT username FROM dba_users WHERE username = ?');
$sth->execute( $ARGS{DatabaseUser} );
undef $dbh unless $sth->fetchrow_array;
+
+ push @errors, loc("Oracle users cannot have empty passwords")
+ unless $ARGS{DatabasePassword};
}
if ( $dbh ) {
diff --git a/t/web/installer.t b/t/web/installer.t
index a34cdcb..79198a7 100644
--- a/t/web/installer.t
+++ b/t/web/installer.t
@@ -57,6 +57,7 @@ diag "Walking through install screens setting defaults";
$m->submit_form(with_fields => {
DatabaseAdmin => $ENV{RT_DBA_USER},
DatabaseAdminPassword => $ENV{RT_DBA_PASSWORD},
+ DatabasePassword => "rt_pass",
});
}
$m->content_contains('Connection succeeded');
commit 86d1b740610437556e99dc70d2d76f5879599dc7
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Sat Nov 9 01:47:20 2013 -0500
Minimal changes to t/api/group.t to not use principals 1, 2, 3
The original implementation of t/api/group.t blindly stuffed principals
1, 2, and 3 into the groups for membership testing. These are
(respectively) the RT_System user, the RT_System's ACL equiv group, and
the Everyone group.
Clearly, including the "Everyone" group when testing group membership is
a confounding factor. Create and use three users, instead. For minimal
changes, these are $users[1] through $users[3], to line up with the
original '1' through '3'.
diff --git a/t/api/group.t b/t/api/group.t
index 2c1ca73..d55fc5c 100644
--- a/t/api/group.t
+++ b/t/api/group.t
@@ -20,11 +20,19 @@ ok($ng->LoadUserDefinedGroup('TestGroup'), "Loaded testgroup");
is($ng->id , $group->id, "Loaded the right group");
-ok (($id,$msg) = $ng->AddMember('1'), "Added a member to the group");
+my @users = (undef);
+for my $number (1..3) {
+ my $user = RT::User->new(RT->SystemUser);
+ $user->Create( Name => "User $number" );
+ push @users, $user->id;
+}
+
+
+ok (($id,$msg) = $ng->AddMember( $users[1] ), "Added a member to the group");
ok($id, $msg);
-ok (($id,$msg) = $ng->AddMember('2' ), "Added a member to the group");
+ok (($id,$msg) = $ng->AddMember( $users[2] ), "Added a member to the group");
ok($id, $msg);
-ok (($id,$msg) = $ng->AddMember('3' ), "Added a member to the group");
+ok (($id,$msg) = $ng->AddMember( $users[3] ), "Added a member to the group");
ok($id, $msg);
# Group 1 now has members 1, 2 ,3
@@ -34,7 +42,7 @@ ok (my ($id_2, $msg_2) = $group_2->CreateUserDefinedGroup( Name => 'TestGroup2',
isnt ($id_2 , 0, "Created group 2 ok- $msg_2 ");
ok (($id,$msg) = $group_2->AddMember($ng->PrincipalId), "Made TestGroup a member of testgroup2");
ok($id, $msg);
-ok (($id,$msg) = $group_2->AddMember('1' ), "Added member RT_System to the group TestGroup2");
+ok (($id,$msg) = $group_2->AddMember( $users[1] ), "Added member User 1 to the group TestGroup2");
ok($id, $msg);
# Group 2 how has 1, g1->{1, 2,3}
@@ -48,12 +56,12 @@ ok($id, $msg);
# g3 now has g2->{1, g1->{1,2,3}}
my $principal_1 = RT::Principal->new(RT->SystemUser);
-$principal_1->Load('1');
+$principal_1->Load( $users[1] );
my $principal_2 = RT::Principal->new(RT->SystemUser);
-$principal_2->Load('2');
+$principal_2->Load( $users[2] );
-ok (($id,$msg) = $group_3->AddMember('1' ), "Added member RT_System to the group TestGroup2");
+ok (($id,$msg) = $group_3->AddMember( $users[1] ), "Added member User 1 to the group TestGroup2");
ok($id, $msg);
# g3 now has 1, g2->{1, g1->{1,2,3}}
-----------------------------------------------------------------------
More information about the rt-commit
mailing list