afarran / swm2m_vms_tests

Feature tests for VMS agent
0 stars 2 forks source link

Strange behaviour of lsf method : getProperties() #10

Open pblo opened 9 years ago

pblo commented 9 years ago

When lsf.getProperties(sin, proplist) is fired a couple of times , some of the results are always nil while the rest is expected result.

All should be different than nil!

To make it more interesting it happends only when in the middle of doing lua chunk code is posted via shell service ...

To see what I mean just look at this code:

i = 0
while i < 10 do
    helmPanel:setConnected("true") -- this is posting event via shell service(lua code chunk)
    local result = lsf.getProperties(162, {2})
    D:log(result,"RESULT")
    helmPanel:setConnected("false")
    local result = lsf.getProperties(162, {2})
    D:log(result,"RESULT")
    framework.delay(1)
    i = i+1
end

and this debug output

Test Framework v2.0.1983
tf.trace1 OFF, tf.trace2 OFF
ServiceWrapper Position initialized. SIN 20
ServiceWrapper Filesystem initialized. SIN 24
ServiceWrapper System initialized. SIN 16
ServiceWrapper VMS initialized. SIN 115
ServiceWrapper Geofence initialized. SIN 21
ServiceWrapper Log initialized. SIN 23
ServiceWrapper Shell initialized. SIN 26
ServiceWrapper UniboxInOut initialized. SIN 162
Helm Panel used : unibox
Creating profile for 690
1   -v
2   -s
3   TestHelmPanelModule
4   -t
5   test_getPro
*** VMS Feature Tests Started ***
Starting tests, 7 suite(s)
-- Starting suite "TestHelmPanelModule", 7 test(s)
RESULT | {
    1 = {
        value = "3"
        pin = "2"
    }
}

RESULT | {
    1 = {
        value = "0"
        pin = "2"
    }
}

RESULT | {
    1 = {
        value = "3"
        pin = "2"
    }
}

RESULT | {
    1 = {
        value = "0"
        pin = "2"
    }
}

RESULT | {
    1 = {
        value = "3"
        pin = "2"
    }
}

RESULT | {
    1 = {
        value = "0"
        pin = "2"
    }
}

RESULT | {
    1 = {
        value = "3"
        pin = "2"
    }
}

RESULT | nil
RESULT | nil
RESULT | nil
RESULT | {
    1 = {
        value = "3"
        pin = "2"
    }
}

RESULT | {
    1 = {
        value = "0"
        pin = "2"
    }
}

RESULT | {
    1 = {
        value = "3"
        pin = "2"
    }
}

RESULT | {
    1 = {
        value = "0"
        pin = "2"
    }
}

RESULT | {
    1 = {
        value = "3"
        pin = "2"
    }
}

RESULT | {
    1 = {
        value = "0"
        pin = "2"
    }
}

RESULT | {
    1 = {
        value = "3"
        pin = "2"
    }
}

RESULT | nil
RESULT | nil
RESULT | nil
PASS: test_getPropertiesBug (136923.89ms)
    Finished suite "TestHelmPanelModule", +1 -0 E0 s0
*** VMS Feature Tests Completed ***

--------------------------------
Return messages statistics:
Received 18 cmdResult messages.
Received 8 AbnormalReport messages.
Received 14 propertyValues messages.
Received 1 terminalInfo messages.

Time to run tests: 00:02:23.

Framework version: 2.0.1983 
Gateway version: 3.2.1.0 
Terminal package: 5.0.7.8877
pblo commented 9 years ago

More details :

1) We have a loop with range 0-9

2) In an iteration:

a) lua chunk passed to shell service:

 sched.post(user.UniboxInOut._NAME,"UNIBOX_CONNECTED",true)

b) lsf.getProperties() is requested and sometimes the result is nil (usually an array)

c) lua chunk passed to shell service:

 sched.post(user.UniboxInOut._NAME,"UNIBOX_CONNECTED",false)

d) lsf.getProperties() is requested and sometimes the result is nil (usually an array)

The message used by shell service is : ExecuteLua ( SIN 26, MIN 2 )

When you use loop with range 0-3 bug is not reproduced nor manually in GUI of simulator.

It is quite strange isn't it?