Search code examples
androidcts

Android CTS, app security test - private data


I'm a almost newbee Android developer, struggling with CTS. (I'm using kitkat.. yes it's little bit old...)

I met a problem about com.android.cts.appsecurity.AppSecurityTests at testAppFailAccessPrivateData, like below..

It seems that CTS test app(com.android.cts.appwithdata) can't find it's own traffic data in the xt_qtaguid,

What Can i do more to clear this problem?? May i add some necessary module for quota?

Someone please help me.. I tried to find on the goole about this issue, but I failed..

and is there any site or community for android CTS beginner, like me??

logcat :

E/memtrack(26467): Couldn't load memtrack module (No such file or directory)
E/android.os.Debug(26467): failed to load memtrack module: -2
D/AndroidRuntime(26467): Calling main entry com.android.commands.am.Am
I/ActivityManager( 1145): Force stopping com.android.cts.appwithdata appid=10612 user=0: start instr
I/ActivityManager( 1145): Start proc com.android.cts.appwithdata for added application com.android.cts.appwithdata: pid=26476 uid=10612 gids={50612, 3003}
I/TestRunner(26476): started: testCreatePrivateData(com.android.cts.appwithdata.CreatePrivateDataTest)
I/TestRunner(26476): failed: testCreatePrivateData(com.android.cts.appwithdata.CreatePrivateDataTest)
I/TestRunner(26476): ----- begin exception -----
I/TestRunner(26476): 
I/TestRunner(26476): junit.framework.AssertionFailedError: Was expecting to find own traffic stats
I/TestRunner(26476):    at junit.framework.Assert.fail(Assert.java:50)
I/TestRunner(26476):    at junit.framework.Assert.assertTrue(Assert.java:20)
I/TestRunner(26476):    at com.android.cts.appwithdata.CreatePrivateDataTest.accessOwnTrafficStats(CreatePrivateDataTest.java:195)
I/TestRunner(26476):    at com.android.cts.appwithdata.CreatePrivateDataTest.createTrafficStatsWithTags(CreatePrivateDataTest.java:243)
I/TestRunner(26476):    at com.android.cts.appwithdata.CreatePrivateDataTest.testCreatePrivateData(CreatePrivateDataTest.java:93)

and adb shell :/proc/net/xt_qtaguid # cat stats 

idx iface acct_tag_hex uid_tag_int cnt_set rx_bytes rx_packets tx_bytes tx_packets rx_tcp_bytes rx_tcp_packets rx_udp_bytes rx_udp_packets rx_other_bytes rx_other_packets tx_tcp_bytes tx_tcp_packets tx_udp_bytes tx_udp_packets tx_other_bytes tx_other_packets
2 usb0 0x0 0 0 0 0 441054 5264 0 0 0 0 0 0 24814 308 0 0 416240 4956
3 usb0 0x0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
4 lo 0x0 0 0 0 0 2968 43 0 0 0 0 0 0 744 18 0 0 2224 25
5 lo 0x0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
adbshell :/proc/net/xt_qtaguid # 

thanks! Jihoon Kim.


Solution

  • Here is the fix would be adapted from Android guys gerrit :

    https://android-review.googlesource.com/#/c/269115/1/net/netfilter/xt_qtaguid.c

    I also have faced with issue when connect adb via TCP as test only looks at rx/tx byte differences of related process and adb datas counts in it.