Write a simple adapter in functest project to run TESTON 65/2465/2
authorlanqinglong <lanqinglong@huawei.com>
Tue, 13 Oct 2015 01:32:17 +0000 (09:32 +0800)
committerlanqinglong <lanqinglong@huawei.com>
Tue, 13 Oct 2015 12:53:37 +0000 (20:53 +0800)
JIRA:FUNCTEST-46

Add Env function: replace onos file
Add log folder

Change-Id: Ice2679ccf00258dfb206ab252590ec586b1d2c9d
Signed-off-by: lanqinglong <lanqinglong@huawei.com>
testcases/Controllers/ONOS/Teston/CI/adapters/environment.py

index 01e72cd..ea1a836 100644 (file)
@@ -22,6 +22,7 @@ class environment( connection ):
         connection.__init__( self )
         self.loginfo = connection( )
         self.masterhandle = ''
+        self.home = ''
 
     def DownLoadCode( self, handle, codeurl ):
         """
@@ -202,6 +203,12 @@ class environment( connection ):
         #Release ssh
         handle.logout()
 
+    def CopyOnostoTestbin( self ):
+        sourcefile = os.curdir + '/dependencies/onos'
+        destifile = self.home + '/onos/tools/test/bin/'
+        runcommand = 'cp ' + sourcefile + ' ' + destifile
+        os.system( runcommand )
+
     def OnosEnvSetup( self, handle ):
         """
         Onos Environment Setup function
@@ -213,6 +220,7 @@ class environment( connection ):
         self.AddKnownHost( handle, self.OC3, "karaf", "karaf" )
         self.DownLoadCode( handle, 'https://github.com/sunyulin/OnosSystemTest.git' )
         self.DownLoadCode( handle, 'https://gerrit.onosproject.org/onos' )
+        self.CopyOnostoTestbin()
         self.ChangeOnosName(self.agentusername,self.agentpassword)
         self.InstallDefaultSoftware( handle )
-        self.SetOnosEnvVar(handle, self.masterpassword,self.agentpassword)
\ No newline at end of file
+        self.SetOnosEnvVar(handle, self.masterpassword,self.agentpassword)