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