[issue26944] android: test_posix fails

2016-10-19 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
dependencies:  -add the 'is_android' attribute to test.support

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26944] android: test_posix fails

2016-10-12 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Thanks for the patch David, see my comment in Rietveld.
New patch based on David patch, just a bit simpler.

--
stage: patch review -> commit review
versions: +Python 3.7
Added file: http://bugs.python.org/file45067/test_getgroups_4.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26944] android: test_posix fails

2016-08-18 Thread R. David Murray

Changes by R. David Murray :


--
stage: commit review -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26944] android: test_posix fails

2016-08-18 Thread R. David Murray

R. David Murray added the comment:

Haypo: we are testing that our function wrapper (getgroups) returns something 
that we can parse as matching the results from the 'id' command.  This gives us 
a much more meaningful test than just testing that getgroups returns 
*something*.  That is, we are testing that it returns integers, and that they 
"look right".

In that light, I propose an alternate patch.

--
nosy: +r.david.murray
Added file: http://bugs.python.org/file44143/test_getgroups_3.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26944] android: test_posix fails

2016-07-25 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The test is already skipped by the patch, for Android API level < 23, with the 
statement:
raise unittest.SkipTest("need working 'id -G'")

Do you mean that the test should be skipped instead more explicitly with 
something like:
skiIf(support.android_api_level < 23, "-G option of id -G is ignored by 
Android")

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26944] android: test_posix fails

2016-07-25 Thread STINNER Victor

STINNER Victor added the comment:

Ooops, I missed the part where you say that it works on API level >= 23. So I 
suggest to only skip the test on Android API level < 23.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26944] android: test_posix fails

2016-07-25 Thread STINNER Victor

STINNER Victor added the comment:

Sorry but I don't see the point of trying to "fix" the unit test on
Android if "id -G" doesn't work as expected.

In fact, I don't really understand the point of such functional test.
Are we still testing Python? Or are we testing the OS itself?

I suggest to remove the whole unit test, or skip the whole unit test
on Android (@skipIf(is_android(), "-G option of id -G is ignored"),
something like that).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26944] android: test_posix fails

2016-07-25 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> Hum, does the id program supports -G on Android?

It does on Android 6.0 but prints the same result as 'id' (without -G) on 
previous Android versions.

Here is the output of the commands involved in the test for the root user on my 
archlinux box, the Android 5.0 emulator and the Android 6.0 emulator:

archlinux:
  [root@bilboquet default]# python
  ...
  >>> from posix import getegid, getgroups
  >>> getgroups()
  [0, 1, 2, 3, 4, 6, 10, 19]
  >>> getegid()
  0
  [root@bilboquet default]# id -G
  0 1 2 3 4 6 10 19

Android 5.0 (API level 21)
  root@generic_x86:/data/data/org.bitbucket.pyona # python
  ...
  >>> from posix import getegid, getgroups
  >>> getgroups()
  [1003, 1004, 1007, 1011, 1015, 1028, 3001, 3002, 3003, 3006]
  >>> getegid()
  0
  root@generic_x86:/data/data/org.bitbucket.pyona # id -G
  uid=0(root) gid=0(root) 
groups=1003(graphics),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats)

Android 6.0 (API level 23)
  root@generic_x86:/data/data/org.bitbucket.pyona # python
  ...
  >>> from posix import getegid, getgroups
  >>> getgroups()
  [1004, 1007, 1011, 1015, 1028, 3001, 3002, 3003, 3006]
  >>> getegid()
  0
  root@generic_x86:/data/data/org.bitbucket.pyona # id -G
  1004 1007 1011 1015 1028 3001 3002 3003 3006

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26944] android: test_posix fails

2016-07-25 Thread STINNER Victor

STINNER Victor added the comment:

> ValueError: invalid literal for int() with base 10: 'uid=0(root)'

Hum, does the id program supports -G on Android? The output looks like the 
regular id output (without -G). Example on my Linux (Fedora 24):

$ id
uid=1000(haypo) gid=1000(haypo) groupes=1000(haypo),10(wheel) 
contexte=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

$ id -G
1000 10

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26944] android: test_posix fails

2016-07-24 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
nosy: +haypo
stage: patch review -> commit review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26944] android: test_posix fails

2016-07-21 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> Is there a plan to make Android a supported platform in 3.6?

Answer in the Android meta-issue at msg 270942.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26944] android: test_posix fails

2016-07-21 Thread Larry Hastings

Larry Hastings added the comment:

Is there a plan to make Android a supported platform in 3.6?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26944] android: test_posix fails

2016-07-21 Thread Xavier de Gaye

Xavier de Gaye added the comment:

New patch with cosmetic changes.

--
assignee:  -> xdegaye
stage:  -> patch review
Added file: http://bugs.python.org/file43817/test_getgroups_2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26944] android: test_posix fails

2016-05-22 Thread Xavier de Gaye

Xavier de Gaye added the comment:

test_getgroups is ok on an android emulator running API 23 with the attached 
patch, and the test is skipped when running API 21.

--
dependencies: +add is_android in test.support to detect Android platform 
-android: add platform.android_ver()
keywords: +patch
Added file: http://bugs.python.org/file42943/test_getgroups.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26944] android: test_posix fails

2016-05-10 Thread Xavier de Gaye

Xavier de Gaye added the comment:

'id -G' produces the expected result on an android-23-x86 emulator running 
Android 6.0 (API 23).

There is a new error now instead of the one reported at issue #26932:

==
FAIL: test_getgroups (test.test_posix.PosixTester)
--
Traceback (most recent call last):
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/test_posix.py", line 
816, in test_getgroups
set(posix.getgroups() + [posix.getegid()]))
AssertionError: Items in the second set but not the first:
0


The problem is that posix.getegid() returns 0, and 0 is not in the list printed 
by 'id -G'.

--
nosy: +Chi Hsuan Yen

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26944] android: test_posix fails

2016-05-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See more information in comments in issue26932. Since the id tool looks fixed 
in Android 6.x we should skip the test on Android <6.x.

--
components: +Tests -Cross-Build, Library (Lib)
dependencies: +android: add platform.android_ver()
nosy: +serhiy.storchaka
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26944] android: test_posix fails

2016-05-04 Thread Xavier de Gaye

New submission from Xavier de Gaye:

test_posix fails on an android emulator running an x86 system image at API 
level 21.

On android we have instead of a list of group IDs:
root@generic_x86:/data/local/tmp # id -G
uid=0(root) gid=0(root) 
groups=1003(graphics),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats)
 context=u:r:su:s0


==
ERROR: test_getgroups (test.test_posix.PosixTester)
--
Traceback (most recent call last):
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/test_posix.py", line 
815, in test_getgroups
set([int(x) for x in groups.split()]),
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/test_posix.py", line 
815, in 
set([int(x) for x in groups.split()]),
ValueError: invalid literal for int() with base 10: 'uid=0(root)'

--
Ran 83 tests in 0.114s

FAILED (errors=1, skipped=11)
test test_posix failed
1 test failed:
test_posix
Total duration: 0:00:01

--
components: Cross-Build, Library (Lib)
messages: 264789
nosy: Alex.Willmer, larry, xdegaye
priority: normal
severity: normal
status: open
title: android: test_posix fails
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com