Subversion Repositories DevTools

Rev

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