Subversion Repositories DevTools

Rev

Rev 5097 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5097 Rev 5168
Line 8... Line 8...
8
%>
8
%>
9
<%
9
<%
10
Option explicit
10
Option explicit
11
' Good idea to set when using redirect
11
' Good idea to set when using redirect
12
Response.Expires = 0   ' always load the page, dont store
12
Response.Expires = 0   ' always load the page, dont store
-
 
13
Response.ContentType="application/json"
13
%>
14
%>
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/qstr.asp"-->
17
<!--#include file="common/qstr.asp"-->
17
<!--#include file="common/common_subs.asp"-->
18
<!--#include file="common/common_subs.asp"-->
Line 44... Line 45...
44
'
45
'
45
If (parOpr = "zipTest") Then
46
If (parOpr = "zipTest") Then
46
    Call zipFile
47
    Call zipFile
47
ElseIf (parOpr = "eventTest") Then
48
ElseIf (parOpr = "eventTest") Then
48
    Call sendEvent
49
    Call sendEvent
-
 
50
ElseIf (parOpr = "eventTestWsh") Then
-
 
51
    Call sendEventWsh
49
ElseIf (parOpr = "emailTest") Then
52
ElseIf (parOpr = "emailTest") Then
50
    Call sendEmail
53
    Call sendEmail
51
ElseIf (parOpr = "emailWshTest") Then
54
ElseIf (parOpr = "emailWshTest") Then
52
    Call sendWshEmail
55
    Call sendWshEmail
53
ElseIf (parOpr = "remExecTest") Then
56
ElseIf (parOpr = "remExecTest") Then
54
    Call remExec
57
    Call remExec
55
ElseIf (parOpr = "pkgAccessTest") Then
58
ElseIf (parOpr = "pkgAccessTest") Then
56
    Call pkgAccess
59
    Call pkgAccess
-
 
60
ElseIf (parOpr = "reportEvent") Then
-
 
61
    Call reportEvent
57
ElseIf (parOpr = "ddpTest") Then
62
ElseIf (parOpr = "ddpTest") Then
58
    Call ddpTest
63
    Call ddpTest
59
 
64
 
60
Else
65
Else
61
    oJSON.data("emsgSummary") = "Unknown operation requested:" & parOpr
66
    oJSON.data("emsgSummary") = "Unknown operation requested:" & parOpr
Line 81... Line 86...
81
next
86
next
82
 
87
 
83
'Return the object
88
'Return the object
84
Response.Write oJSON.JSONoutput()
89
Response.Write oJSON.JSONoutput()
85
 
90
 
86
Sub ddpTest
-
 
87
    Dim rv
-
 
88
        Dim objRC: Set objRC = New ReleaseChanged
-
 
89
        Call objRC.Run_ReleaseChanged(62884,1042919,enumRELEASE_CHANGE_MODE_PKG_ADDED, true)
-
 
90
        rv = objRC.last_resultCode
-
 
91
        Set objRC = Nothing
-
 
92
 
-
 
93
        If rv = 0 Then
-
 
94
            result = 0
-
 
95
        Else
-
 
96
            result = 1
-
 
97
            oJSON.data("emsgSummary") = "Error:("&rv&")"
-
 
98
        End If
-
 
99
 
-
 
100
End Sub
-
 
101
'-------------------------------------------------
91
'-------------------------------------------------
102
' Function:    ddpTest
92
' Function:    ddpTest
103
' Description:
93
' Description:
104
' C:\WINDOWS\system32\cmd.exe" /c C:\clearcase\dpurdie_manager_suite\Release_Manager\scripts\bin\plink.exe -ssh -batch releasem@auperaarc01.vix.local -pw releasem "sudo ~/sbin/make_test_access;"
-
 
105
 
94
 
106
Sub ddpTest1
95
Sub ddpTest
107
   Dim objWSH, rv, wCmdLine
-
 
108
   Dim plinkPath, plinkCmd, archiveServer, uname, upasswd, sudoCmd
-
 
109
    
-
 
110
      Dim sqry: sqry = "SELECT * FROM BUILD_SERVICE_CONFIG WHERE SERVICE='ARCHIVE SERVER'"
-
 
111
      Dim rsTemp
-
 
112
      Set rsTemp = OraDatabase.DbCreateDynaset( sqry , cint(0) )
-
 
113
      archiveServer = rsTemp("config")
-
 
114
      rsTemp.Close()
-
 
115
      Set rsTemp = Nothing
-
 
116
 
96
 
117
      Dim pArchive_Path : pArchive_Path = "dpkg_archive"
-
 
118
      Dim apkg_name     : apkg_name     = "pkg_name"
-
 
119
      Dim apkg_version  : apkg_version  = "pkg_version"
-
 
120
      Dim artag_id      : artag_id      = "rtag_id"
-
 
121
      Dim apkg_id       : apkg_id       = "pkg_id"
-
 
122
      Dim apv_id        : apv_id        = "pv_id"
-
 
123
      Dim aproj_id      : aproj_id      = "proj_id"
-
 
124
      Dim amode_id      : amode_id      = "mode_id"
-
 
125
 
-
 
126
      sudoCmd = "~/sbin/make_release_changed" &_
97
    Dim objRC: Set objRC = New ReleaseChanged
127
             " archive=" & pArchive_Path &_
-
 
128
             " pkg_name='\""" & apkg_name & "\""'" &_
-
 
129
             " pkg_version='\"""& apkg_version &"\""'" &_
-
 
130
             " rtag_id="& artag_id &_
-
 
131
             " pkg_id=" & apkg_id &_
-
 
132
             " pv_id="& apv_id &_
98
    Dim rv
133
             " proj_id="& aproj_id &_
-
 
134
             " mode_id="& amode_id
-
 
135
 
99
 
136
       uname = "releasem"
-
 
137
       upasswd = "releasem"
-
 
138
       plinkPath = Request.ServerVariables("APPL_PHYSICAL_PATH") & "Release_Manager\scripts\bin\plink.exe"
100
    Call objRC.Run_ReleaseChanged(6884,693010,enumRELEASE_CHANGE_MODE_PKG_RELEASED,true)
139
       plinkCmd =  "-ssh -batch " & uname & "@" & archiveServer & " -pw " & upasswd & " ""sudo " & sudoCmd & ";"""
-
 
140
       wCmdLine =  plinkPath & " " & plinkCmd
-
 
141
        
-
 
142
        Set objWSH = Server.CreateObject("WScript.Shell")
-
 
143
        rv = objWSH.Run (wCmdLine, 0, TRUE)
-
 
144
        Set objWSH = Nothing
101
    rv = objRc.last_resultCode
145
        If rv = 105 Then
102
    If rv = 0 Then
146
            result = 0
103
        result = 0
147
        Else
104
    Else
148
            result = 1
105
        result = 1
149
            oJSON.data("emsgSummary") = "Error:("&rv&")" & wCmdLine
106
        oJSON.data("emsgSummary") = "Error:("&rv&"), " & objRc.last_errorMsg
150
        End If
107
    End If
-
 
108
    Set objRC = Nothing
151
End Sub
109
End Sub
152
 
110
 
153
'-------------------------------------------------
111
'-------------------------------------------------
154
' Function:    zipFile
112
' Function:    zipFile
155
' Description: Test the File Zipping process
113
' Description: Test the File Zipping process
Line 213... Line 171...
213
    End If
171
    End If
214
    set objFSO = Nothing
172
    set objFSO = Nothing
215
End Sub
173
End Sub
216
 
174
 
217
'-------------------------------------------------
175
'-------------------------------------------------
-
 
176
' Function:    reportEvent
-
 
177
' Description:  Create an event in the machines event log
-
 
178
 
-
 
179
Sub reportEvent
-
 
180
    Report_Event enumEVENT_ERROR, "Admin Test", "", "Release Manager test: reportEvent" 
-
 
181
    If Err.number = 0 Then
-
 
182
        result = 0
-
 
183
    Else
-
 
184
        result = 1
-
 
185
        oJSON.data("emsgSummary") = "Error:("&Err.number&"):" & Err.description
-
 
186
    End If
-
 
187
End Sub
-
 
188
 
-
 
189
'-------------------------------------------------
218
' Function:    sendEvent
190
' Function:    sendEvent
219
' Description: Send an Event to the Windows Log
191
' Description: Send an Event to the Windows Log
220
Sub sendEvent
192
Sub sendEvent
-
 
193
    Send_Event enumEVENT_ERROR, "Release Manager Test Log" 
-
 
194
    If Err.number = 0 Then
-
 
195
        result = 0
-
 
196
    Else
-
 
197
        result = 1
-
 
198
        oJSON.data("emsgSummary") = "Error:("&Err.number&"):" & err.description
-
 
199
    End If
-
 
200
End Sub
-
 
201
 
-
 
202
'-------------------------------------------------
-
 
203
' Function:    sendEventWsh
-
 
204
' Description: Send an Event to the Windows Log using Wsh
-
 
205
Sub sendEventWsh
221
   Dim objWSH, rv
206
   Dim objWSH, rv
222
    Set objWSH = Server.CreateObject("WScript.Shell")
207
    Set objWSH = Server.CreateObject("WScript.Shell")
223
    rv = objWSH.Run ("cmd.exe /c cscript.exe //B //NoLogo " & rootPath & SCRIPTS_FOLDER & "\Admin_Test.wsf //job:onRaiseEvent", 0, TRUE)
208
    rv = objWSH.Run ("cmd.exe /c cscript.exe //B //NoLogo " & rootPath & SCRIPTS_FOLDER & "\Admin_Test.wsf //job:onRaiseEvent", 0, TRUE)
224
    Set objWSH = Nothing
209
    Set objWSH = Nothing
225
    If rv = 0 Then
210
    If rv = 0 Then