File: 1.00.6a/server/web/testrun.php (View as Code)

1: 2: /* ------------------------------------------------------------- 3: This file is part of FreeNATS 4: 5: FreeNATS is (C) Copyright 2008 PurplePixie Systems 6: 7: FreeNATS is free software: you can redistribute it and/or modify 8: it under the terms of the GNU General Public License as published by 9: the Free Software Foundation, either version 3 of the License, or 10: (at your option) any later version. 11: 12: FreeNATS is distributed in the hope that it will be useful, 13: but WITHOUT ANY WARRANTY; without even the implied warranty of 14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15: GNU General Public License for more details. 16: 17: You should have received a copy of the GNU General Public License 18: along with FreeNATS. If not, see www.gnu.org/licenses 19: 20: For more information see www.purplepixie.org/freenats 21: -------------------------------------------------------------- */ 22: 23: ob_start(); 24: require("include.php"); 25: $NATS->Start(); 26: if (!$NATS_Session->Check($NATS->DB)) 27: { 28: header("Location: ./?login_msg=Invalid+Or+Expired+Session"); 29: exit(); 30: } 31: if ($NATS_Session->userlevel<9) UL_Error("Test Run"); 32: 33: 34: 35: ob_end_flush(); 36: Screen_Header("Test Run: test/".$_REQUEST['trid'],1); 37: 38: if (isset($_REQUEST['message'])) echo "".$_REQUEST['message']."
";
39: if (isset($amsg)) echo "".$amsg."
";
40: 41: if ( (isset($_REQUEST['action'])) && ($_REQUEST['action']=="finish") ) 42: { 43: if (!isset($_REQUEST['confirmed'])) 44: { 45: echo "Manually Close Test Session
";
46: echo "Are you sure you want to do this? Only close sessions that you're sure aren't still running in the background.
";
47: echo "This does not kill processes - just marks the test session as complete.

";
48: echo "Confirm Action: Yes - Delete | No - Cancel"; 49: echo "

";
50: } 51: else 52: { 53: $q="UPDATE fntestrun SET finishx=".time()." WHERE trid=".ss($_REQUEST['trid']); 54: $NATS->DB->Query($q); 55: echo "Session Closed

";
56: } 57: } 58: 59: echo "
Test Run test/".$_REQUEST['trid']."

";
60: 61: $q="SELECT * FROM fntestrun WHERE trid=".ss($_REQUEST['trid'])." LIMIT 0,1"; 62: $r=$NATS->DB->Query($q); 63: if (!$row=$NATS->DB->Fetch_Array($r)) 64: { 65: echo "Error fetching test run data

";
66: Screen_Footer(); 67: exit(); 68: } 69: $NATS->DB->Free($r); 70: 71: echo ""; 72: echo ""; 73: echo ""; 74: echo ""; 75: echo ""; 79: echo ""; 80: echo ""; 84: 85: echo ""; 86: echo ""; 88: 89: echo ""; 90: echo ""; 93: 94: echo "
Started : ".nicedt($row['startx'])." (".dtago($row['startx']).")
Finished : "; 76: if ($row['finishx']>0) echo nicedt($row['finishx'])." (".dtago($row['finishx']).")"; 77: else echo "Still Running (Manually Mark Finished)"; 78: echo "
Node Filter :"; 81: if ($row['fnode']=="") echo "All Nodes"; 82: else echo "".$row['fnode'].""; 83: echo "
Sysem Log :Log Events for Tester ".$row['trid'].""; 87: echo "
Output : "; 91: echo $row['routput']; 92: echo "
";
95: ?> 96: 97: 98: 99: Screen_Footer(); 100: ?> 101: