Subversion Repositories DevTools

Rev

Rev 6048 | Rev 6086 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|
5
'|  ADMIN Page
6
'|  Build Service
7
'|  admin_build_test_page.asp
8
'|
9
'=====================================================
10
%>
11
<%
12
Option explicit
13
' Good idea to set when using redirect
14
Response.Expires = 0   ' always load the page, dont store
15
%>
16
<!--#include file="common/conf.asp"-->
17
<!--#include file="common/globals.asp"-->
18
<!--#include file="common/qstr.asp"-->
19
<!--#include file="common/common_subs.asp"-->
5632 dpurdie 20
<!--#include file="common/formating.asp"-->
5357 dpurdie 21
<!--#include file="_jquery_includes.asp"-->
22
<%
23
'------------ ACCESS CONTROL ------------------
24
%>
6048 dpurdie 25
<!--#include file="_access_control_login.asp"-->
5357 dpurdie 26
<!--#include file="_access_control_general.asp"-->
27
<%
28
'------------ Variable Definition -------------
29
Dim active
30
Dim FileSystemObject
31
Dim dpkgArchiveAvailable
32
 
33
'------------ Constants Declaration -----------
34
'------------ Variable Init -------------------
35
active = canActionControl("ConfigureBuildService")
36
 
37
'   Determine if dpkg_archive can be accessed directly via a UNC
38
If testArchiveAccessPkg("","") Then
39
    dpkgArchiveAvailable = "Exists" 
40
Else
41
    dpkgArchiveAvailable = "Not Accessible" 
42
End If
43
 
44
'----------------------------------------------
45
function testFromRegistry (strRegistryKey )
46
    Dim WSHShell, value
47
 
48
    On Error Resume Next
49
    Set WSHShell = CreateObject("WScript.Shell")
50
    value = WSHShell.RegRead( strRegistryKey )
51
 
52
    testFromRegistry = NOT (err.number <> 0)
53
 
54
    set WSHShell = nothing
55
end function
5442 dpurdie 56
'----------------------------------------------
57
'Returns the current database date-time
58
Function getDataBaseDateTime()
5814 dpurdie 59
   Dim sqry: sqry = "SELECT TO_CHAR (ora_sysdatetime, 'Dy DD-Mon-YYYY HH24:MI:SS') FROM DUAL"
5442 dpurdie 60
   Dim rsTemp
61
   Set rsTemp = OraDatabase.DbCreateDynaset( sqry , cint(0) )
62
   getDataBaseDateTime = rsTemp(0)
63
   rsTemp.Close()
64
   Set rsTemp = Nothing
65
End Function
5357 dpurdie 66
 
5442 dpurdie 67
'----------------------------------------------
68
Function WebServerDateTime ()
5632 dpurdie 69
    WebServerDateTime = DisplayDateTimeSecs(Now())
5442 dpurdie 70
End Function
71
 
5357 dpurdie 72
Function makeAjaxButton( text, script )
73
    If active Then
74
        makeAjaxButton = "&nbsp;&nbsp;<a id="""&script &""" href="""" class=""form_btn"" title=""" &text& """ onclick="""&script&"();return false;"">"&text&"</a>"
75
    Else
76
        makeAjaxButton = "&nbsp;&nbsp;<a class=""form_btn_disabled"" title=""" &text& """>"&text&"</a>"
77
    End If
78
End Function
79
%>
80
<script type="text/javascript" charset="utf-8">
81
///////////////////////////////////////////////
82
//  Function:    ajaxOpr
83
//  Description: Perform an ajax operation
84
//  Args       :    prog        - Progam to invoke
85
//                  args        - Part of URL to pass to script
86
//                  callback    - Callback on success
87
//                  ecall       - Callback on error            
88
//
89
function ajaxOpr(prog, args, callback, ecall)
90
{
91
    $.ajax({
92
        method: "GET",
93
        url: prog,
94
        data: args,
95
        dataType: 'json'
96
    })
97
    .done(function( myJson, textStatus, jqXHR ) {
98
        try {
99
            //alert("ajaxOprCallback:" + myJson);
100
            if (myJson.result != 0) {
101
                ecall('Error');
102
                vixAlert("AJAX request error: " + myJson.emsgSummary);
103
            }
104
            else {
105
                callback(myJson);
106
            }
107
        }
108
        catch(e) {
109
            ecall('Error');
110
            vixAlert("JSON Parse Error: " + e);
111
        }
112
    })
113
    .fail(function(  jqXHR, textStatus, errorThrown ) {
114
        ecall('Bad Status');
115
        vixAlert("Internal AJAX error<br>Status: " + textStatus + "<br>Msg: " + errorThrown);
116
    });
117
}
118
 
119
///////////////////////////////////////////////
120
//  Function:       jiraTest   
121
//  Description:    Get the list of projects from the Jira Server
122
//
123
function jiraTest()
124
{
125
    //  Show that testing has started
126
    var el = document.getElementById("jiraTest");
127
    el.innerHTML = 'Testing';
128
 
129
    ajaxOpr('_json_jiraIssues.asp',
130
            {Opr:'getAllKeys'}, 
131
            function(myJson){ el.innerHTML = 'Test OK'; },
132
            function(txt){ el.innerHTML = "Test Failed:" + txt}
133
           );
134
}
135
 
136
///////////////////////////////////////////////
137
//  Function:       LXRTest   
138
//  Description:    Get some data fromthe LXR Server
139
//
140
function LXRTest()
141
{
142
    //  Show that testing has started
143
    var el = document.getElementById("LXRTest");
144
    el.innerHTML = 'Testing';
145
 
146
    ajaxOpr('_json_RmTests.asp',
147
            {Opr:'lxrAccessTest'}, 
148
            function(myJson){ el.innerHTML = 'Test OK'; },
149
            function(txt){ el.innerHTML = "Test Failed:" + txt}
150
           );
151
}
152
 
153
///////////////////////////////////////////////
154
//  Function:       zipTest   
155
//  Description:    Test that the server can ZIP a file
156
//
157
function zipTest()
158
{
159
    //  Show that testing has started
160
    var el = document.getElementById("zipTest");
161
    el.innerHTML = 'Testing';
162
 
163
    ajaxOpr('_json_RmTests.asp',
164
            {Opr:'zipTest'}, 
165
            function(myJson){ el.innerHTML = 'Test OK'; },
166
            function(txt){ el.innerHTML = "Test Failed:" + txt}
167
           );
168
}
169
 
170
///////////////////////////////////////////////
171
//  Function:       eventTest   
172
//  Description:    Test that the server can send an Event
173
//
174
function eventTest()
175
{
176
    //  Show that testing has started
177
    var el = document.getElementById("eventTest");
178
    el.innerHTML = 'Sending';
179
 
180
    ajaxOpr('_json_RmTests.asp',
181
            {Opr:'eventTest'}, 
182
            function(myJson){ el.innerHTML = 'Sent OK'; },
183
            function(txt){ el.innerHTML = "Test Failed:" + txt}
184
           );
185
}
186
 
187
///////////////////////////////////////////////
188
//  Function:       reportEvent
189
//  Description:    Test that the server can report and event
190
//
191
function reportEvent()
192
{
193
    //  Show that testing has started
194
    var el = document.getElementById("reportEvent");
195
    el.innerHTML = 'Reporting';
196
 
197
    ajaxOpr('_json_RmTests.asp',
198
            {Opr:'reportEvent'}, 
199
            function(myJson){ el.innerHTML = 'Reported OK'; },
200
            function(txt){ el.innerHTML = "Test Failed:" + txt}
201
           );
202
}
203
 
204
///////////////////////////////////////////////
205
//  Function:       emailTest   
206
//  Description:    Test that the server can send an email
207
//
208
function emailTest()
209
{
210
    //  Show that testing has started
211
    var el = document.getElementById("emailTest");
212
    el.innerHTML = 'Sending';
213
 
214
    ajaxOpr('_json_RmTests.asp',
215
            {Opr:'emailTest'}, 
216
            function(myJson){ el.innerHTML = 'Sent OK'; },
217
            function(txt){ el.innerHTML = "Test Failed:" + txt}
218
           );
219
}
220
///////////////////////////////////////////////
221
//  Function:       emailTest1   
222
//  Description:    Test that the server can send an email with an attachment
223
//
224
function emailTest1()
225
{
226
    //  Show that testing has started
227
    var el = document.getElementById("emailTest1");
228
    el.innerHTML = 'Sending';
229
 
230
    ajaxOpr('_json_RmTests.asp',
231
            {Opr:'emailTest', Mode:'Attach'}, 
232
            function(myJson){ el.innerHTML = 'Sent OK'; },
233
            function(txt){ el.innerHTML = "Test Failed:" + txt}
234
           );
235
}
236
 
237
///////////////////////////////////////////////
238
//  Function:       remExec
239
//  Description:    Test Remote Execution
240
//
241
function remExec()
242
{
243
    //  Show that testing has started
244
    var el = document.getElementById("remExec");
245
    el.innerHTML = 'Testing';
246
 
247
    ajaxOpr('_json_RmTests.asp',
248
            {Opr:'remExecTest'}, 
249
            function(myJson){ el.innerHTML = 'Test OK'; },
250
            function(txt){ el.innerHTML = "Test Failed:" + txt}
251
           );
252
}
253
 
254
///////////////////////////////////////////////
255
//  Function:       pkgAccess
256
//  Description:    http access of package
257
//
258
function pkgAccess()
259
{
260
    //  Show that testing has started
261
    var el = document.getElementById("pkgAccess");
262
    el.innerHTML = 'Testing';
263
 
264
    ajaxOpr('_json_RmTests.asp',
265
            {Opr:'pkgAccessTest'}, 
266
            function(myJson){ el.innerHTML = 'Test OK'; },
267
            function(txt){ el.innerHTML = "Test Failed:" + txt}
268
           );
269
}
270
 
271
</script>
272
<html>
273
<head>
274
 
275
<title>Admin Test Page</title>
276
<link rel="shortcut icon" href="<%=FavIcon%>"/>
277
 
278
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
279
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
280
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
281
<link rel="stylesheet" href="images/navigation.css" type="text/css">
282
<!-- DROPDOWN MENUS -->
283
<!--#include file="_menu_def.asp"-->
284
<script language="JavaScript1.2" src="images/popup_menu.js"></script>
285
<!-- StyleSheet Extensions -->
286
<style>
287
.pagebody {margin-left:auto; margin-right:auto; width:50%;border-width: 0px;border-spacing: 2px; background-color: rgb(255, 204, 0)}
288
.pagebody td{white-space:nowrap;vertical-align: top;text-align: left;padding-left: 3px;padding-right: 3px; background: #f2f0e4}
289
.tablehdr td{background-color: rgb(255, 204, 0)}
290
</style>
291
</head>
292
 
293
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
294
<!-- HEADER -->
295
<!--#include file="_header.asp"-->
296
<p>
297
<!-- Body of the page -->
298
<table class="pagebody">
299
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
300
   <tr class="body_col tablehdr">
301
      <td>Test</td>
302
      <td>Result</td>
303
   </tr>
304
 
305
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
306
   <tr class="body_row">
307
      <td>User ID</td>
308
      <td><%=objAccessControl.UserId%></td>
309
   </tr>
310
   <tr class="body_row">
311
      <td>User Name</td>
312
      <td><%=objAccessControl.UserName%></td>
313
   </tr>
314
   <tr class="body_row">
315
      <td>User Email</td>
316
      <td><%=objAccessControl.UserEmail%></td>
317
   </tr>
318
 
319
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
320
   <tr class="body_row">
321
      <td>Database Name</td>
322
      <td><%=OraDatabase.DatabaseName%></td>
323
   </tr>
324
 
325
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
326
   <tr class="body_row">
5442 dpurdie 327
      <td>Database Time</td>
328
      <td><%=getDataBaseDateTime()%></td>
329
   </tr>
330
 
331
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
332
   <tr class="body_row">
333
      <td>Web Server Time</td>
334
      <td><%=WebServerDateTime()%></td>
335
   </tr>
336
 
337
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
338
   <tr class="body_row">
5357 dpurdie 339
      <td>Archive Server</td>
340
      <td><%=archive_server%></td>
341
   </tr>
342
 
343
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
344
   <tr class="body_row">
345
      <td>Archive Root: <%=dpkg_archiveURL%></td>
346
      <td><%=dpkgArchiveAvailable%></td>
347
   </tr>
348
 
349
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
350
   <tr class="body_row">
351
      <td>Package Archive Access - Check Presence</td>
352
      <td><%=makeAjaxButton("Test", "pkgAccess")%></td>
353
   </tr>
354
 
355
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
356
   <%
357
       Dim sKey2, sValue2, kFragment
358
       kFragment = "rsa2@22:" & archive_server
359
       sKey2 = "HKEY_USERS\.DEFAULT\Software\SimonTatham\PuTTY\SshHostKeys\" & kFragment
360
       sValue2 = testFromRegistry(sKey2)
361
   %>
362
    <tr class="body_row">
363
      <td>Plink Key [<%=sKey2%>]</td>
364
      <td><%=sValue2%></td>
365
   </tr>
366
 
367
    <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
368
    <tr class="body_row">
369
       <td>Package Archive Access - Remote cmd execution</td>
370
       <td><%=makeAjaxButton("Test", "remExec")%></td>
371
    </tr>
372
 
373
  <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
374
   <tr class="body_row">
375
     <td>Zip File</td>
376
     <td><%=makeAjaxButton("Test", "zipTest")%></td>
377
   </tr>
378
 
379
  <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
380
   <tr class="body_row">
381
      <td>Email Server</td>
382
      <td><%=MAIL_SERVER%></td>
383
   </tr>
384
   <tr class="body_row">
385
      <td>Admin Email</td>
386
      <td><%=ADMIN_EMAIL%></td>
387
   </tr>
388
   <tr class="body_row">
389
      <td>Fault Email List</td>
390
      <td><%=FAULT_EMAIL_LIST%></td>
391
   </tr>
392
   <tr class="body_row">
393
      <td>Send Email</td>
394
      <td><%=makeAjaxButton("eMail", "emailTest")%></td>
395
   </tr>
396
   <tr class="body_row">
397
      <td>Send Email With attachment</td>
398
      <td><%=makeAjaxButton("eMail", "emailTest1")%></td>
399
   </tr>
400
 
401
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
402
   <tr class="body_row">
403
    <td>Generate error event</td>
404
    <td><%=makeAjaxButton("Event", "eventTest")%></td>
405
   </tr>
406
 
407
   <tr class="body_row">
408
    <td>Report Event</td>
409
    <td><%=makeAjaxButton("Report", "reportEvent")%></td>
410
   </tr>
411
 
412
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
413
   <tr class="body_row">
414
      <td>Jira Server</td>
5375 dpurdie 415
      <td><%=Application("JIRA_URL")%></td>
5357 dpurdie 416
   </tr>
417
   <tr class="body_row">
418
      <td>Jira Test</td>
419
      <td><%=makeAjaxButton("Test", "jiraTest")%></td>
420
   </tr>
421
 
422
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
423
   <tr class="body_row">
424
      <td>LXR Server</td>
425
      <td><%=LXR_URL%></td>
426
   </tr>
427
   <tr class="body_row">
428
      <td>LXR Test</td>
429
      <td><%=makeAjaxButton("Test", "LXRTest")%></td>
430
   </tr>
431
 
432
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
433
   <tr class="body_col tablehdr">
434
      <td>End of Tests</td>
435
      <td><a class="form_btn" href="admin_build_test_page.asp" title="Refresh Page">Refresh</a></td>
436
   </tr>
437
 
438
</table>
439
<input type="hidden" name="action" value="true">
440
<p>
5957 dpurdie 441
<!-- FOOTER -->
442
<!--#include file="_footer.asp"-->
5357 dpurdie 443
</body>
444
</html>