Commit e6fe1c47 authored by urbant's avatar urbant
Browse files

SIP torture test cases (from RFC 4475/May 2006)

parent 4f7d5ce7
Loading
Loading
Loading
Loading
+1012 −0
Original line number Diff line number Diff line
module SipTorture_TestCases
{
	import from LibSip_SIPTypesAndValues all;
	import from TestSystem all;
	
	type component SipSimuEx extends SipSimu
	{
		timer tc_defaultTimeout := 3.0;
	}
	
	testcase TC_BADASPEC() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(OPTIONS_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_BADBRANCH() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(OPTIONS_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_BADDATE() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(INVITE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_BADDN() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(OPTIONS_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_BADINV01() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(INVITE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_BADVERS() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(OPTIONS_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_BCAST() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(Response:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_BEXT01() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(OPTIONS_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_BIGCODE() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(Response:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_CLERR() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(INVITE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_CPARAM01() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(REGISTER_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_CPARAM02() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(REGISTER_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_DBLREQ() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(REGISTER_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_ESC01() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(INVITE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_ESC02() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(REGISTER_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_ESCNULL() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(REGISTER_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_ESCRURI() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(INVITE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_INSUF() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(INVITE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_INTMETH() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_INV2543() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(INVITE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_INVUT() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(INVITE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_LONGREQ() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(INVITE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_LTGTRURI() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(INVITE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_LWSDISP() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(OPTIONS_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_LWSRURI() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(INVITE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_LWSSTART() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(INVITE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_MCL01() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(OPTIONS_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_MISMATCH01() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(OPTIONS_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_MISMATCH02() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_MPART01() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(MESSAGE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_MULTI01() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(INVITE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_NCL() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(INVITE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_NOREASON() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(Response:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_NOVELSC() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(OPTIONS_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_QUOTBAL() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(INVITE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_REGAUT01() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(REGISTER_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_REGBADCT() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(REGISTER_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_REGESCRT() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(REGISTER_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_SCALAR02() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(REGISTER_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_SCALARLG() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(Response:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_SDP01() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(INVITE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_SEMIURI() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(OPTIONS_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_TEST() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(INVITE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_TRANSPORTS() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(OPTIONS_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_TRWS() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(OPTIONS_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_UNKSCM() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(OPTIONS_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_UNKSM2() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(REGISTER_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_UNREASON() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(Response:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_WSINV() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(INVITE_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}

	testcase TC_ZEROMF() runs on SipSimuEx
	{
		tc_defaultTimeout.start;
		alt
		{
			[]sipPort.receive(OPTIONS_Request:?)
			{
				setverdict(pass);
			}
			[]sipPort.receive
			{
				setverdict(fail, "Codec failed to decode the received message");
			}
			[]tc_defaultTimeout.timeout
			{
				setverdict(fail, "Timeout: no message received within specified time");
			}
		}
	}


}
 No newline at end of file