2 #################################################################################
5 # Description: Verify that Rational Clearquest was installed correctly
6 # Author: Andrew@DeFaria.com
7 # Created: Mon Mar 15 08:48:24 PST 2004
10 ################################################################################
15 my $logpath = "\\\\rtnlprod02\\viewstore\\PMO\\CM_TOOLS\\log";
16 my $hostname = `hostname`; chomp $hostname;
17 my $logfile = "$logpath\\$hostname.log";
20 open LOGFILE, ">>$logfile"
21 or die "Unable to open logfile: $logfile - $!\n";
27 print LOGFILE "$message\n";
30 # Log in to CQ as guest
31 logmsg "CQVerify Version $cqverify";
32 logmsg "Verifying Clearquest/TUP installation on $hostname (" . scalar (localtime) . ")";
34 my $CQsession = CQPerlExt::CQSession_Build ()
35 or logmsg "Unable to establish CQSession", die;
37 my ($queryDef, $resultSet, $result);
39 $CQsession->UserLogon ("guest", "guest", "AMQST", "AMQST");
40 # Construct a CQ query that will return the ID of the first CQ record
41 $queryDef = $CQsession->BuildQuery ("defect");
42 $queryDef->BuildField ("id");
43 $resultSet = $CQsession->BuildResultSet ($queryDef);
45 $resultSet->GetNumberOfColumns;
46 $status = $resultSet->MoveNext;
47 $result = $resultSet->GetColumnValue ("1");
48 CQSession::Unbuild ($CQsession);
54 "-----------------------------------------------------
55 Clearquest/TUP NOT installed and functioning properly
56 -----------------------------------------------------";
59 if ($result =~ m/^AMQST/) {
60 logmsg "Clearquest query succeeded";
62 "-------------------------------------------------
63 Clearquest/TUP installed and functioning properly
64 -------------------------------------------------";
67 logmsg "Value returned not was not expected: $result";
69 "-----------------------------------------------------
70 Clearquest/TUP NOT installed and functioning properly
71 -----------------------------------------------------";