From f984df91e1900dee575b20b5c9fdc9e66955d28a Mon Sep 17 00:00:00 2001 From: gsmselftest Date: Sun, 30 Oct 2011 19:30:03 +0100 Subject: mutex4smart test --- For Weekly Test/tricode/GSMClass.pyc | Bin 7163 -> 7337 bytes For Weekly Test/tricode/GSMExt.Eplus handler.log | 4 + For Weekly Test/tricode/TestProcessLog.log | 37 ++ For Weekly Test/tricode/mutexSmartTest.php | 804 +++++++++++++++++++++++ 4 files changed, 845 insertions(+) create mode 100644 For Weekly Test/tricode/mutexSmartTest.php (limited to 'For Weekly Test/tricode') diff --git a/For Weekly Test/tricode/GSMClass.pyc b/For Weekly Test/tricode/GSMClass.pyc index 0d2e2cc..93723ce 100644 Binary files a/For Weekly Test/tricode/GSMClass.pyc and b/For Weekly Test/tricode/GSMClass.pyc differ diff --git a/For Weekly Test/tricode/GSMExt.Eplus handler.log b/For Weekly Test/tricode/GSMExt.Eplus handler.log index 44a1143..91134ab 100644 --- a/For Weekly Test/tricode/GSMExt.Eplus handler.log +++ b/For Weekly Test/tricode/GSMExt.Eplus handler.log @@ -578,3 +578,7 @@ On: 2011-10-30 16:20:25.319368 Event: LISTEN ON PORT: 58405 ------------------STARTED THE LOGGING 2011-10-30 18:11:35.309188 ------------------ On: 2011-10-30 18:11:35.309606 Event: LISTEN ON PORT: 49819 + + +------------------STARTED THE LOGGING 2011-10-30 19:17:06.848693 ------------------ +On: 2011-10-30 19:17:06.849034 Event: LISTEN ON PORT: 42607 diff --git a/For Weekly Test/tricode/TestProcessLog.log b/For Weekly Test/tricode/TestProcessLog.log index e0ee1ff..e224311 100644 --- a/For Weekly Test/tricode/TestProcessLog.log +++ b/For Weekly Test/tricode/TestProcessLog.log @@ -1452,3 +1452,40 @@ On: 2011-10-30 18:11:34.621233 Event: GSMExt.Eplus On: 2011-10-30 18:11:36.629739 Event: Connected to Receiver Handler On: 2011-10-30 18:11:36.630514 Event: connect to Receiver but device doesnt work On: 2011-10-30 18:11:36.630571 Event: 802 General Device Error: Destination device no respond timeout + + +------------------STARTED THE LOGGING 2011-10-30 19:14:42.308567 ------------------ +On: 2011-10-30 19:14:42.308642 Event: init Caller +On: 2011-10-30 19:14:42.308669 Event: GSMRZ2 +On: 2011-10-30 19:14:50.319795 Event: Connected to Caller Handler +On: 2011-10-30 19:14:50.324229 Event: Connect to Caller but device doesnt work +On: 2011-10-30 19:14:50.324399 Event: 802 General Device Error: Caller device no respond timeout + + +------------------STARTED THE LOGGING 2011-10-30 19:16:57.927877 ------------------ +On: 2011-10-30 19:16:57.927949 Event: init Caller +On: 2011-10-30 19:16:57.927976 Event: GSMRZ2 +On: 2011-10-30 19:17:05.938164 Event: Connected to Caller Handler +On: 2011-10-30 19:17:06.152150 Event: Caller Handler respond +On: 2011-10-30 19:17:06.154444 Event: Caller handler : Ready +On: 2011-10-30 19:17:06.154479 Event: init Receiver +On: 2011-10-30 19:17:06.154501 Event: GSMExt.Eplus +On: 2011-10-30 19:17:08.161724 Event: Connected to Receiver Handler +On: 2011-10-30 19:17:08.163716 Event: connect to Receiver but device doesnt work +On: 2011-10-30 19:17:08.163775 Event: 802 General Device Error: Destination device no respond timeout + + +------------------STARTED THE LOGGING 2011-10-30 19:17:54.260777 ------------------ +On: 2011-10-30 19:17:54.260849 Event: init Caller +On: 2011-10-30 19:17:54.260876 Event: GSMRZ2 +On: 2011-10-30 19:18:02.271850 Event: Connected to Caller Handler +On: 2011-10-30 19:18:02.482683 Event: Caller Handler respond +On: 2011-10-30 19:18:02.484927 Event: Caller handler : Ready +On: 2011-10-30 19:18:02.484965 Event: init Receiver +On: 2011-10-30 19:18:02.484987 Event: GSMExt.Eplus +On: 2011-10-30 19:18:04.491574 Event: Connected to Receiver Handler +On: 2011-10-30 19:18:04.605707 Event: Receiver Handler respond +On: 2011-10-30 19:18:04.605996 Event: Receiver handler : Ready +On: 2011-10-30 19:18:04.606028 Event: Start Call +On: 2011-10-30 19:18:04.606177 Event: Waiting Feedback +On: 2011-10-30 19:18:14.606566 Event: Test Failed - Eplus No credit on Eplus diff --git a/For Weekly Test/tricode/mutexSmartTest.php b/For Weekly Test/tricode/mutexSmartTest.php new file mode 100644 index 0000000..8bd5d49 --- /dev/null +++ b/For Weekly Test/tricode/mutexSmartTest.php @@ -0,0 +1,804 @@ + + + + +Network test live results! + + + +
+ /dev/null 2>&1 &"); //start the software in background and don't wait for any output + sleep(6); //sleep half second till the software starts + //the software should be running already and set the lock, now we test it and then connect to it! + + $softwareRunning1 = isLocked($softwareLock); + if($softwareRunning1 == '0') //Software running and waiting for connection! + { + //try to open the socket and connect to the software + $fp = fsockopen($ip, $port, $errno, $error, 5); + + if (!$fp) + { + echo 'Could not open the socket or connect to the testing software! Check ports on both sides!'; + + } + else + { + socket_set_timeout($fp,50); //one should set the number of the longest test, so we can define the timeout function (it is the number after "$fp,") + fwrite($fp, "SMART TEST"); + + //fwrite($fp, "SMART TEST"); //send command to start the tests + if(!feof($fp)) + { + while(!feof($fp)) + { + $received = fgets($fp, 128); //receive data! + + if ($received == "CONFIRM\n") //we got the confirmation from the testing software + { + //test finished successfully + + $GSMRZ1 = 0; + $GSMRZ2 = 0; + $GSMRZ3 = 0; + + $SIP = 0; + $UNISIP = 0; + $LANDLINE = 0; + $LSFKS = 0; + + $GSMEE = 0; + $GSMEV = 0; + $GSMET = 0; + $GSMEO = 0; + + $SIPP = 0; + $LANDLINEP = 0; + $UNISIPP = 0; + $NANOBTS1P = 0; + $NANOBTS2P = 0; + /////////// end of test! + echo '
+ + + + + + + + + + + '; + echo str_repeat("\n",7024); + flush(); + } + elseif ($received == "TEST DONE\n") + { + if ($taskAmount == "ON"){$taskAmount = "SMART TEST";} + + echo '
From: To: Message: Status:
'; + echo '
'; + echo '"; + echo ''; + echo str_repeat("\n",7024); + flush(); + usleep(100); + fwrite($fp, 'DISCONNECT'); //tell the testing software it may close + break; + } + else + { + //parse the received data! + $numberofTask++; + $received = str_replace("\n",'',$received); + $dataForTable = explode("|", $received); + $callFrom = strtoupper($dataForTable[1]); + $callTo = strtoupper($dataForTable[2]); + $testStatus = strtoupper($dataForTable[3]); + //ADD HERE THE TEST CASES BUT MAKE IT INSIDE OF A FILE (e.q. include 'testing.php'); HERE I PUT IT ONLY FOR EXAMPLE PURPOSES! + if($callFrom == 'SIP' || $callTo == 'SIP') + { + if($testStatus == '200') + { + $SIP = 1; + $SIPP = 1; + $LSFKS = 1; + } + elseif($testStatus == '486') + { + //Check that SIP already working or not, if working, leave as it is, otherwise update that sip broken. same with LSFKS + if ($SIP != 1) + { + $SIP = 1; + } + $SIPP = 1; + if ($LSFKS != 1) + { + $LSFKS = -1; + } + } + if ($callFrom == 'SIP') + { + if ($testStatus == '998') + { + $SIP = 1; + $SIPP = 1; + if ($LSFKS != 1) + { + $LSFKS = 0; + } + + } + elseif($testStatus == '999') + { + if ($SIP != 1) + { + $SIP = -1; + } + $SIPP = -1; + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + } + elseif ($callTo == 'SIP') + { + if ($testStatus == '999') + { + if ($SIP != 1) + { + $SIP = 0; + } + if ($SIPP != 1) + { + $SIPP = 0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '998') + { + if ($SIP != 1) + { + $SIP = -1; + } + $SIPP = -1; + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + } + } + + if($callFrom == 'GSMRZ1' || $callTo == 'GSMRZ1') + { + if($testStatus == '200') + { + $GSMRZ1 = 1; + } + elseif($testStatus == '486') + { + if ($GSMRZ1 != 1) + { + $GSMRZ1 = -1; + } + } + if ($callFrom == 'GSMRZ1') + { + if ($testStatus == '999') + { + if ($GSMRZ1 != 1) + { + $GSMRZ1 = -1; + } + } + elseif($testStatus == '998') + { + $GSMRZ1 = 1; //where is nanoBTS1 + } + } + elseif ($callTo == 'GSMRZ1') + { + if ($testStatus == '998') + { + if ($GSMRZ1 != 1) + { + $GSMRZ1 = -1; + } + } + elseif($testStatus == '999') + { + $GSMRZ1 = 1; //where is nanoBTS1 + } + } + } + + if($callFrom == 'GSMRZ2' || $callTo == 'GSMRZ2') + { + if($testStatus == '200') + { + $GSMRZ2 = 1; + $NANOBTS1P = 1; + } + elseif($testStatus == '486') + { + $GSMRZ2 = -1; + $NANOBTS1P = 1; + } + else + { $GSMRZ1 = 0; + $NANOBTS1P = 0; + + } + } + if($callFrom == 'GSMRZ3' || $callTo == 'GSMRZ3') + { + if($testStatus == '200') + { + $GSMRZ3 = 1; + $NANOBTS2P = 1; + } + elseif($testStatus == '486') + { + $GSMRZ3 = -1; + $NANOBTS2P = 1; + } + else + { $GSMRZ3 = 0; + $NANOBTS2P = 0; + + } + + } + if($callFrom == 'GSMEXT.O2' || $callTo == 'GSMEXT.O2') + { + if($testStatus == '200') + { + $GSMEO = 1; + $LSFKS = 1; + } + elseif($testStatus == '486') + { + if ($GSMEO != 1) + { + $GSMEO = -1; + } + if ($LSFKS != 1) + { + $LSFKS = -1; + } + } + if ($callFrom == 'GSMEXT.O2') + { + if ($testStatus == '999') + { + if ($GSMEO != 1) + { + $GSMEO = -1; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '998') + { + if ($GSMEO != 1) + { + $GSMEO =1; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + } + elseif ($callTo == 'GSMEXT.O2') + { + if ($testStatus == '999') + { + if ($GSMEO != 1) + { + $GSMEO = 0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '998') + { + if ($GSMEO != 1) + { + $GSMEO =-1; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + } + } + if($callFrom == 'GSMEXT.VODA' || $callTo == 'GSMEXT.VODA') + { + if($testStatus == '200') + { + $GSMEV = 1; + $LSFKS = 1; + } + elseif($testStatus == '486') + { + if ($GSMEV != 1) + { + $GSMEV = -1; + } + if ($LSFKS != 1) + { + $LSFKS = -1; + } + } + if ($callFrom == 'GSMEXT.VODA') + { + if ($testStatus == '999') + { + if ($GSMEV != 1) + { + $GSMEV = -1; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '998') + { + if ($GSMEV != 1) + { + $GSMEV =1; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + } + elseif ($callTo == 'GSMEXT.VODA') + { + if ($testStatus == '999') + { + if ($GSMEV != 1) + { + $GSMEV = 0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '998') + { + if ($GSMEV != 1) + { + $GSMEV =-1; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + } + } + + if($callFrom == 'GSMEXT.EPLUS' || $callTo == 'GSMEXT.EPLUS') + { + if($testStatus == '200') + { + $GSMEE = 1; + $LSFKS = 1; + } + elseif($testStatus == '486') + { + if ($GSMEE != 1) + { + $GSMEE = -1; + } + if ($LSFKS != 1) + { + $LSFKS = -1; + } + } + if ($callFrom == 'GSMEXT.EPLUS') + { + if ($testStatus == '999') + { + if ($GSMEE != 1) + { + $GSMEE = -1; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '998') + { + if ($GSMEE != 1) + { + $GSMEE =1; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + } + elseif ($callTo == 'GSMEXT.EPLUS') + { + if ($testStatus == '999') + { + if ($GSMEE != 1) + { + $GSMEE = 0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '998') + { + if ($GSMEE != 1) + { + $GSMEE=-1; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + } + } + + if($callFrom == 'GSMEXT.TM' || $callTo == 'GSMEXT.TM') + { + if($testStatus == '200') + { + $GSMET = 1; + $LSFKS = 1; + } + elseif($testStatus == '486') + { + if ($GSMET != 1) + { + $GSMET = -1; + } + if ($LSFKS != 1) + { + $LSFKS = -1; + } + } + if ($callFrom == 'GSMEXT.TM') + { + if ($testStatus == '999') + { + if ($GSMET != 1) + { + $GSMET = -1; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '998') + { + if ($GSMET != 1) + { + $GSMET =1; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + } + elseif ($callTo == 'GSMEXT.TM') + { + if ($testStatus == '999') + { + if ($GSMET != 1) + { + $GSMET = 0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '998') + { + if ($GSMET != 1) + { + $GSMET =-1; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + } + + } + + if($callFrom == 'LANDLINE' || $callTo == 'LANDLINE') + { + + if($testStatus == '200') + { + + $LANDLINEP = 1; + $LANDLINE = 1; + $LSFKS = 1; + } + elseif($testStatus == '486') + { + if ($LANDLINE != 1) + { + $LANDLINE = -1; + } + } + if ($callFrom == 'LANDLINE') + { + if ($testStatus == '999') + { + if ($LANDLINE != 1) + { + $LANDLINE = -1; + } + if ($LSFKS != 1) + { + $LSFKS = -1; + } + if ($LANDLINEP != 1) + { + $LANDLINEP = -1; + } + } + elseif($testStatus == '998') + { + $LANDLINE = 1; + if ($LSFKS != 1) + { + $LSFKS = 0; + } + $LANDLINEP = 1; + } + } + elseif ($callTo == 'LANDLINE') + { + if ($testStatus == '999') + { + if ($LANDLINE != 1) + { + $LANDLINE = 0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + if ($LANDLINEP != 1) + { + $LANDLINEP = 0; + } + } + elseif($testStatus == '998') + { + if ($LANDLINE != 1) + { + $LANDLINE = -1; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + if ($LANDLINEP != 1) + { + $LANDLINEP = 0; + } + } + } + } + if($callFrom == 'UNISIP' || $callTo == 'UNISIP') + { + + if($testStatus == '200') + { + $UNISIPP = 1; + $UNISIP = 1; + } + elseif($testStatus == '486') + { + if ($UNISIP != 1) + { + $UNISIP = -1; + } + } + if ($callFrom == 'UNISIP') + { + if ($testStatus == '999') + { + if ($UNISIP != 1) + { + $UNISIP = -1; + } + if ($UNISIPP != 1) + { + $UNISIPP = -1; + } + } + elseif($testStatus == '998') + { + $UNISIP = 1; + $UNISIPP = 1; + } + } + if ($callTo == 'UNISIP') + { + if ($testStatus == '998') + { + if ($UNISIP != 1) + { + $UNISIP = -1; + } + if ($UNISIPP != 1) + { + $UNISIPP = -1; + } + + } + elseif($testStatus == '999') + { + if ($UNISIP != 1) + { + $UNISIP = 0; + } + if ($UNISIPP != 1) + { + $UNISIPP = 0; + } + } + } + } + + + //END OF TEST CASE EXAMPLE + echo ' + '. $dataForTable[1] . ' + '. $dataForTable[2] . ' + ' . $dataForTable[4] . ' + ' . $dataForTable[3] . ' + '; + //echo $received . '
'; + echo str_repeat("\n",7024); + flush(); + usleep(100); + fwrite($fp, "CONTINUE"); //tell the software to proceed with the test and confirm receiving data + } + } + } + + fclose($fp);//close the soccket and the connection + + } + + } + elseif($softwareRunning1 == '1') + { + echo 'Testing software was not started(didn\'t obtain the lock)! Check it!'; + } + else + { + echo 'Testing software didn\'t obtain the lock'; + } + } + elseif($softwareRunning == '0') //0 means the software is still running in the background + { + echo 'Testing software is still running! Maybe you should kill it (if not started manually!)'; + } + else + { + echo 'We have an unknown error! Refresh te web page!'; + } + + //$release = ReleaseLock($nameOfLock); + //echo $release . "
"; + } + else + { + echo 'No single test was selected! Please go back and select at least one test'; + } + } + elseif($lockMe == '0') //0 means if the attempt timed out (for example, because another client has previously locked the name) + { + echo 'Someone was faster than you'; + } + else + { + // # if an error occurred (such as running out of memory or the thread was killed with + echo 'We have an error here'; + } +} +elseif ($locking == '0') //0 means somebody is already on the web site +{ + echo 'Somebody is using the web site already!' . "
"; +} +else +{ + echo 'We have some serious error here'; +} +?> +
+ + + -- cgit v1.2.3-55-g7522