Test: Reimplemented the TLS test state machine to be inline with TLS handshake specs.
Implement reassembly for TLS packets, carve scapy TLS context out of TLS data.
Generate key exchange and encrypted handshake data from TLS session context
on receiving SERVER hello response for client certificate.

Change the TLS test case to timeout on 20 seconds in case of handshake failure.

Change-Id: I0816046c14ac0ae4a7fa71ecb9ab24287bd005d0
diff --git a/src/test/tls/tlsTest.py b/src/test/tls/tlsTest.py
index c98a069..2168640 100644
--- a/src/test/tls/tlsTest.py
+++ b/src/test/tls/tlsTest.py
@@ -17,6 +17,8 @@
 import time
 import os
 from nose.tools import *
+from nose.twistedtools import reactor, deferred
+from twisted.internet import defer
 from EapTLS import TLSAuthTest
 from OnosCtrl import OnosCtrl
 
@@ -43,10 +45,16 @@
                   log.info('Configure request for AAA returned status %d' %code)
                   assert_equal(status, True)
             time.sleep(3)
-            
+
+      @deferred(20)
       def test_eap_tls(self):
-          tls = TLSAuthTest()
-          tls.runTest()
+            df = defer.Deferred()
+            def eap_tls_verify(df):
+                  tls = TLSAuthTest()
+                  tls.runTest()
+                  df.callback(0)
+            reactor.callLater(0, eap_tls_verify, df)
+            return df
 
 if __name__ == '__main__':
     t = TLSAuthTest()