case01.py 10.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
#******************************************************************************

#  Eurecom OpenAirInterface
#  Copyright(c) 1999 - 2013 Eurecom

#  This program is free software; you can redistribute it and/or modify it
#  under the terms and conditions of the GNU General Public License,
#  version 2, as published by the Free Software Foundation.

#  This program is distributed in the hope it will be useful, but WITHOUT
#  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
#  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
#  more details.

#  You should have received a copy of the GNU General Public License along with
#  this program; if not, write to the Free Software Foundation, Inc.,
#  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.

#  The full GNU General Public License is included in this distribution in
#  the file called "COPYING".

#  Contact Information
#  Openair Admin: openair_admin@eurecom.fr
#  Openair Tech : openair_tech@eurecom.fr
#  Forums       : http://forums.eurecom.fsr/openairinterface
#  Address      : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France

#*****************************************************************************

# \file case01.py
31
# \brief test case 01 for OAI: compilations
32
# \author Navid Nikaein
33
# \date 2013 - 2014
34 35 36 37 38 39 40
# \version 0.1
# @ingroup _test

import log
import openair
import core

41
makerr1 = '***'
42 43
makerr2 = 'Error 1'

44
def execute(oai, user, pw, host, logfile,logdir,debug):
45 46
    
    case = '01'
47
    rv = 1
48
    oai.send('cd $OPENAIR_TARGETS;')   
49
 
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
    try:
        test = '00'
        name = 'Check oai.svn.add'
        conf = 'svn st -q | grep makefile'
        diag = 'Makefile(s) changed. If you are adding a new file, make sure that it is added to the svn'
        rsp = oai.send_recv('svn st -q | grep -i makefile;') 
        for item in rsp.split("\n"):
            if "Makefile" in item:
                rsp2=item.strip() + '\n'
        oai.find_false_re(rsp,'Makefile')
    except log.err, e:
        diag = diag + "\n" + rsp2  
               #log.skip(case, test, name, conf, e.value, logfile)
        log.skip(case, test, name, conf, '', diag, logfile)
    else:
        log.ok(case, test, name, conf, '', logfile)
    
    oai.send('cd SIMU/USER;')   
68
    oai.send('mkdir ' + logdir + ';')
69
    
70 71 72 73
    try:
        test = '01'
        name = 'Compile oai.rel8.make'
        conf = 'make'
74 75
        trace = logdir + '/log_' + case + test + '.txt;'
        tee = ' 2>&1 | tee ' + trace
76 77 78
        diag = "check the compilation errors for oai"
        oai.send('make cleanall;')
        oai.send('make cleanasn1;')
79
        oai.send('rm -f ./oaisim.rel8.'+host)
80
        oai.send_expect_false('make -j4 JF=1' + tee, makerr1,  1500)
81
        oai.send('cp ./oaisim ./oaisim.rel8.'+host)
82
    except log.err, e:
83
        log.fail(case, test, name, conf, e.value, diag, logfile,trace)
84
        rv = 0
85 86 87 88 89 90 91 92 93
    else:
        log.ok(case, test, name, conf, '', logfile)
        
    try:
        test = '02'
        name = 'Compile oai.rel8.nas.make'
        conf = 'make nasmesh_fix; make NAS=1'
        diag = 'check the compilation errors for oai and nas driver'
        oai.send('make cleanall;')
94
        oai.send('rm -f ./oaisim.rel8.nas'+host)
95
        oai.send('rm -f ./nasmesh;')
96
        oai.send('make nasmesh_clean;')
97 98
        trace = logdir + '/log_' + case + test + '_1.txt;'
        tee = ' 2>&1 | tee ' + trace
99
        oai.send_expect_false('make nasmesh_fix' + tee, makerr1,  60)
100 101
        trace = logdir + '/log_' + case + test + '_2.txt;'
        tee = ' 2>&1 | tee ' + trace
102
        oai.send_expect_false('make NAS=1 JF=1 -j4' + tee, makerr1,  1500)
103
        oai.send('cp ./oaisim ./oaisim.rel8.nas.'+host)
104 105
        
    except log.err, e:
106
        log.fail(case, test, name, conf, e.value, diag, logfile,trace)
107
        rv = 0
108 109 110 111
    else:
        log.ok(case, test, name, conf, '', logfile)
    
    oai.send('cd $OPENAIR_TARGETS;')     
112
    oai.send('cd RT/USER;')   
113 114 115 116 117

    try:
        test = '03'
        name = 'Compile oai.rel8.rf.make' 
        conf = 'make RTAI=0 Rel8=1'
118 119
        trace = logdir + '/log_' + case + test + '.txt;'
        tee = ' 2>&1 | tee ' + trace
120 121
        diag = 'check the compilation errors for Rel8'
        oai.send('make cleanall;')
122
        oai.send('rm -f ./oaisim.rel8.rf.'+host)
123
        oai.send_expect_false('make RTAI=0 -j4' + tee, makerr1,  1500)
124
        oai.send('cp ./oaisim ./oaisim.rel8.rf.'+host)
125
    except log.err, e:
126
        log.fail(case, test, name, conf, e.value, diag, logfile,trace)
127 128 129 130 131 132 133 134 135 136
    else:
        log.ok(case, test, name, conf, '', logfile)
        
    oai.send('cd $OPENAIR1_DIR;')     
    oai.send('cd SIMULATION/LTE_PHY;')   

    try:
        test = '04'
        name = 'Compile oai.rel8.phy.dlsim.make' 
        conf = 'make dlsim'
137 138
        trace = logdir + '/log_' + case + test + '.txt;'
        tee = ' 2>&1 | tee ' + trace
139 140
        diag = 'check the compilation errors for dlsim in $OPENAIR1_DIR/SIMULATION/LTE_PHY'
        oai.send('make clean;')
141
        oai.send('rm -f ./dlsim.rel8.'+host)
142
        oai.send_expect_false('make dlsim -j4' + tee, makerr1,  1500)
143
        oai.send('cp ./dlsim ./dlsim.rel8.'+host)
144
    except log.err, e:
145
        log.fail(case, test, name, conf, e.value, diag, logfile,trace)
146
        rv = 0
147 148 149 150 151 152 153
    else:
        log.ok(case, test, name, conf, '', logfile)

    try:
        test = '05'
        name = 'Compile oai.rel8.phy.ulsim.make' 
        conf = 'make ulsim'
154 155
        trace = logdir + '/log_' + case + test + '.txt;'
        tee = ' 2>&1 | tee ' + trace
Lionel Gauthier's avatar
 
Lionel Gauthier committed
156
        diag = 'check the compilation errors for ulsim in $OPENAIR1_DIR/SIMULATION/LTE_PHY'
157
        oai.send('make clean;')
158
        oai.send('rm -f ./ulsim.rel8.'+host)
159
        oai.send_expect_false('make ulsim -j4' + tee, makerr1,  1500)
160
        oai.send('cp ./ulsim ./ulsim.rel8.'+host)
161
    except log.err, e:
162
        log.fail(case, test, name, conf, e.value, diag, logfile,trace)
163
        rv = 0
164 165 166 167 168 169 170 171
    else:
        log.ok(case, test, name, conf, '', logfile)
    
    oai.send('cd $OPENAIR_TARGETS;')     
    oai.send('cd SIMU/USER;')   
    
    try:
        test = '06'
172 173
        name = 'Compile oai.rel8.itti.make' 
        conf = 'make DISABLE_XER_PRINT=1 ENABLE_ITTI=1 Rel8=1'
174 175
        trace = logdir + '/log_' + case + test + '.txt;'
        tee = ' 2>&1 | tee ' + trace
176
        diag = 'check the compilation errors for ITTI Rel8'
177
        oai.send('make clean;')
178
        oai.send('rm -f ./oaisim.rel8.itti.'+host)
179
        oai.send_expect_false('make DISABLE_XER_PRINT=1 ENABLE_ITTI=1 Rel8=1 -j4' + tee, makerr1,  1500)
180
        oai.send('cp ./oaisim ./oaisim.rel8.itti.'+host)
181
    except log.err, e:
182
        log.fail(case, test, name, conf, e.value, diag, logfile,trace)
183
        rv = 0
184 185 186
    else:
        log.ok(case, test, name, conf, '', logfile)

187
    try:
188 189
        test = '07'
        name = 'Compile oai.rel10.make' 
Lionel Gauthier's avatar
 
Lionel Gauthier committed
190
        conf = 'make RLC_STOP_ON_LOST_PDU=1 Rel10=1'
191 192
        trace = logdir + '/log_' + case + test + '.txt;'
        tee = ' 2>&1 | tee ' + trace
193
        diag = 'check the compilation errors for Rel10'
194 195 196
        oai.send('make clean;')
        oai.send('make cleanall;')
        oai.send('make cleanasn1;')
197
        oai.send('rm -f ./oaisim.rel10.'+host)
Lionel Gauthier's avatar
 
Lionel Gauthier committed
198
        oai.send_expect_false('make RLC_STOP_ON_LOST_PDU=1 Rel10=1 -j4' + tee, makerr1,  1500)
199
        oai.send('cp ./oaisim ./oaisim.rel10.'+host)
200
    except log.err, e:
201
        log.fail(case, test, name, conf, e.value, diag, logfile,trace)
202
        rv = 0
203 204
    else:
        log.ok(case, test, name, conf, '', logfile)
205

206
    try:
207
        test = '08'
208
        name = 'Compile oai.rel10.itti.make' 
Lionel Gauthier's avatar
 
Lionel Gauthier committed
209
        conf = 'make DISABLE_XER_PRINT=1 ENABLE_ITTI=1 RLC_STOP_ON_LOST_PDU=1 Rel10=1'
210 211
        trace = logdir + '/log_' + case + test + '.txt;'
        tee = ' 2>&1 | tee ' + trace
212 213
        diag = 'check the compilation errors for ITTI Rel10'
        oai.send('make cleanall;')
214
        oai.send('rm -f ./oaisim.rel10.itti.'+host)
Lionel Gauthier's avatar
 
Lionel Gauthier committed
215
        oai.send_expect_false('make DISABLE_XER_PRINT=1 ENABLE_ITTI=1 RLC_STOP_ON_LOST_PDU=1 Rel10=1 -j4' + tee, makerr1,  1500)
216
        oai.send('cp ./oaisim ./oaisim.rel10.itti.'+host)
217
    except log.err, e:
218
        log.fail(case, test, name, conf, e.value, diag, logfile,trace)
219
        rv = 0
220 221
    else:
        log.ok(case, test, name, conf, '', logfile)
Lionel Gauthier's avatar
Lionel Gauthier committed
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242
    try:
        test = '13'
        name = 'Compile oai_nw_ether IP driver' 
        conf = 'make oai_nw_drv'
        trace = logdir + '/log_' + case + test + '.txt;'
        tee = ' 2>&1 | tee ' + trace
        diag = 'check the compilation errors for ITTI Rel8'
        oai.send('make clean;')
        oai.send('make cleanall;')
        oai.send('make cleanasn1;')
        oai.send('rm -f ./oai_nw_drv;')
        oai.send('make oai_nw_drv_clean;')
        tee = ' 2>&1 | tee ' + trace
        oai.send_expect_false('make oai_nw_drv' + tee, makerr1,  60)
    except log.err, e:
        log.fail(case, test, name, conf, e.value, diag, logfile,trace)
    else:
        log.ok(case, test, name, conf, '', logfile)
    try:
        test = '14'
        name = 'Compile oai.rel8.itti.ral.make' 
Lionel Gauthier's avatar
 
Lionel Gauthier committed
243
        conf = 'make DISABLE_XER_PRINT=1 NAS=1 OAI_NW_DRIVER_TYPE_ETHERNET=1 ENABLE_ITTI=1 USER_MODE=1 OPENAIR2=1 ENABLE_RAL=1 MIH_C_MEDIEVAL_EXTENSIONS=1 RLC_STOP_ON_LOST_PDU=1 Rel8=1'
Lionel Gauthier's avatar
Lionel Gauthier committed
244 245 246 247 248 249
        trace = logdir + '/log_' + case + test + '.txt;'
        tee = ' 2>&1 | tee ' + trace
        diag = 'check the compilation errors for ITTI Rel8'
        oai.send('make clean;')
        oai.send('make cleanall;')
        oai.send('make cleanasn1;')
250
        oai.send('rm -f ./oaisim.rel8.itti.ral.'+host)
Lionel Gauthier's avatar
 
Lionel Gauthier committed
251
        oai.send_expect_false('make DISABLE_XER_PRINT=1 NAS=1 OAI_NW_DRIVER_TYPE_ETHERNET=1 ENABLE_ITTI=1 USER_MODE=1 OPENAIR2=1 ENABLE_RAL=1 MIH_C_MEDIEVAL_EXTENSIONS=1 RLC_STOP_ON_LOST_PDU=1 Rel8=1 -j4' + tee, makerr1,  1500)
252
        oai.send('cp ./oaisim ./oaisim.rel8.itti.ral.'+host)
Lionel Gauthier's avatar
Lionel Gauthier committed
253 254 255 256 257 258 259
    except log.err, e:
        log.fail(case, test, name, conf, e.value, diag, logfile,trace)
    else:
        log.ok(case, test, name, conf, '', logfile)
    try:
        test = '15'
        name = 'Compile oai.rel10.itti.ral.make' 
Lionel Gauthier's avatar
 
Lionel Gauthier committed
260
        conf = 'make DISABLE_XER_PRINT=1 NAS=1 OAI_NW_DRIVER_TYPE_ETHERNET=1 ENABLE_ITTI=1 USER_MODE=1 OPENAIR2=1 ENABLE_RAL=1 MIH_C_MEDIEVAL_EXTENSIONS=1 RLC_STOP_ON_LOST_PDU=1 Rel10=1'
Lionel Gauthier's avatar
Lionel Gauthier committed
261 262 263 264 265 266
        trace = logdir + '/log_' + case + test + '.txt;'
        tee = ' 2>&1 | tee ' + trace
        diag = 'check the compilation errors for ITTI Rel10'
        oai.send('make clean;')
        oai.send('make cleanall;')
        oai.send('make cleanasn1;')
267
        oai.send('rm -f ./oaisim.rel10.itti.ral.'+host)
Lionel Gauthier's avatar
 
Lionel Gauthier committed
268
        oai.send_expect_false('make DISABLE_XER_PRINT=1 NAS=1 OAI_NW_DRIVER_TYPE_ETHERNET=1 ENABLE_ITTI=1 USER_MODE=1 OPENAIR2=1 ENABLE_RAL=1 MIH_C_MEDIEVAL_EXTENSIONS=1 RLC_STOP_ON_LOST_PDU=1 Rel10=1 -j4' + tee, makerr1,  1500)
269
        oai.send('cp ./oaisim ./oaisim.rel10.itti.ral.'+host)
Lionel Gauthier's avatar
Lionel Gauthier committed
270 271 272 273 274
    except log.err, e:
        log.fail(case, test, name, conf, e.value, diag, logfile,trace)
    else:
        log.ok(case, test, name, conf, '', logfile)

275 276
    return rv

277