Subversion Repositories DevTools

Rev

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