I'm having troubles with a shellscript...
I'm creating a script that return a deltavalue between result and lastresult.
it needs to run on RMA's so i'm creating it as a shell script (windows).
I have a test called "Cdrive" that checks the freespace.
Next I created a new test, that has these settings
Params %::Cdrive::LastReply% %::Cdrive::Reply% 10
Enabled Translate Macros
and runs this script:
Code: Select all
Option Explicit
const statusAlive = "Host is alive:"
const statusDead = "No answer:"
const statusUnknown = "Unknown:"
const statusNotResolved = "Unknown host:"
const statusOk = "Ok:"
const statusBad = "Bad:"
const statusBadContents = "Bad contents:"
If cStr("%LastReply%") = cStr("%" & "LastReply" & "%") then
WScript.StdOut.Write "scriptres:" & StatusBad & "Please enable \'Translate Macros\' on the Test Properties"
WScript.Quit(0)
End If
Set objArgs = WScript.Arguments
If objArgs.Count<3 Then
WScript.StdOut.Write "scriptres:" & statusUnknown & "Unsufficient Parameters"
Else
LastReply=objArgs(0)
Reply=objArgs(1)
MaxDelta=objArgs(2)
WScript.StdOut.Write "scriptres:OK:(" & LastReply & ")(" & Reply & ")(" & MexDelta & ")"
If LastReply>0 Then
Delta=(LastReply-Reply)/LastReply*100
If cInt(Delta) > cInt(MaxDelta) Then
WScript.StdOut.Write "scriptres:BAD:" & Delta & " %"
Else
WScript.StdOut.Write "scriptres:OK:" & Delta & " %"
End If
Else
WScript.StdOut.Write "scriptres:Bad contents:LastReply can't be zero"
End If
End If
Set objArgs = Nothing
Can you try to reproduce this ?
I'm using v4.60, testing it localy without RMA
thx
Pieter