Bug 8747 - fix python md5/sha checksum incorrect on qemu86-64 with corei7-64 as DEFAULTTUNE
Summary: fix python md5/sha checksum incorrect on qemu86-64 with corei7-64 as DEFAULTTUNE
Status: VERIFIED DUPLICATE of bug 8748
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Undecided normal
Target Milestone: ---
Assignee: Hongxu Jia
QA Contact: Cristina Agurida
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-12-02 03:16 UTC by Hongxu Jia
Modified: 2015-12-07 13:32 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hongxu Jia 2015-12-02 03:16:11 UTC
1. On qemux86-64, set corei7-64 to instaed of core2-64
diff --git a/meta/conf/machine/qemux86-64.conf b/meta/conf/machine/qemux86-64.conf
index 489194a..080ca79 100644
--- a/meta/conf/machine/qemux86-64.conf
+++ b/meta/conf/machine/qemux86-64.conf
@@ -8,8 +8,8 @@ PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
 PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
 
 require conf/machine/include/qemu.inc
-DEFAULTTUNE ?= "core2-64"
-require conf/machine/include/tune-core2.inc
+DEFAULTTUNE ?= "corei7-64"
+require conf/machine/include/tune-corei7.inc
 
 KERNEL_IMAGETYPE = "bzImage"

diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
index 3b0e54c..1543f94 100755
--- a/scripts/runqemu-internal
+++ b/scripts/runqemu-internal
@@ -442,7 +442,7 @@ if [ "$MACHINE" = "qemux86-64" ]; then
     if [ "$KVM_ACTIVE" = "yes" ]; then
         CPU_SUBTYPE=kvm64
     else
-        CPU_SUBTYPE=core2duo
+        CPU_SUBTYPE=Nehalem
     fi
     if [ ! -z "$vga_option" ]; then
         QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS"


2. Build core-image-minimal
$ bitbake core-image-minimal

3. Run qemu
$ runqemu qemux86-64 slirp nographic

4. Run python tests

root@qemux86-64:~# python /usr/lib/python2.7/test/test_md5.py   
test_basics (__main__.MD5_Test) ... FAIL
test_hexdigest (__main__.MD5_Test) ... FAIL
test_large_update (__main__.MD5_Test) ... ok

======================================================================
FAIL: test_basics (__main__.MD5_Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/test/test_md5.py", line 27, in test_basics
    eq('', 'd41d8cd98f00b204e9800998ecf8427e')
  File "/usr/lib/python2.7/test/test_md5.py", line 23, in md5test
    self.assertEqual(md5(s).hexdigest(), expected)
AssertionError: 'd41d8cd98f00b204e90009080c08020e' != 'd41d8cd98f00b204e9800998ecf8427e'

======================================================================
FAIL: test_hexdigest (__main__.MD5_Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/test/test_md5.py", line 41, in test_hexdigest
    self.assertEqual(hexstr(m.digest()), h)
AssertionError: 'fdd9171bf32437e652bd753741b76a52' != 'fdd9171bf32437e6520d050701070a02'

----------------------------------------------------------------------
Ran 3 tests in 0.013s

FAILED (failures=2)
Traceback (most recent call last):
  File "/usr/lib/python2.7/test/test_md5.py", line 61, in <module>
    test_main()
  File "/usr/lib/python2.7/test/test_md5.py", line 58, in test_main
    test_support.run_unittest(MD5_Test)
  File "/usr/lib/python2.7/test/test_support.py", line 1372, in run_unittest
    _run_suite(suite)
  File "/usr/lib/python2.7/test/test_support.py", line 1355, in _run_suite
    raise TestFailed(err)
test.test_support.TestFailed: multiple errors occurred
root@qemux86-64:~# random: nonblocking pool is initialized

root@qemux86-64:~# python /usr/lib/python2.7/test/test_sha.py
test_case_1 (__main__.SHATestCase) ... FAIL
test_case_2 (__main__.SHATestCase) ... FAIL
test_case_3 (__main__.SHATestCase) ... FAIL
test_case_4 (__main__.SHATestCase) ... FAIL

======================================================================
FAIL: test_case_1 (__main__.SHATestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/test/test_sha.py", line 37, in test_case_1
    "a9993e364706816aba3e25717850c26c9cd0d89d")
  File "/usr/lib/python2.7/test/test_sha.py", line 21, in check
    self.assertTrue(computed == digest)
AssertionError: False is not true

======================================================================
FAIL: test_case_2 (__main__.SHATestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/test/test_sha.py", line 41, in test_case_2
    "84983e441c3bd26ebaae4aa1f95129e5e54670f1")
  File "/usr/lib/python2.7/test/test_sha.py", line 21, in check
    self.assertTrue(computed == digest)
AssertionError: False is not true

======================================================================
FAIL: test_case_3 (__main__.SHATestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/test/test_sha.py", line 45, in test_case_3
    "34aa973cd4c4daa4f61eeb2bdbad27316534016f")
  File "/usr/lib/python2.7/test/test_sha.py", line 21, in check
    self.assertTrue(computed == digest)
AssertionError: False is not true

======================================================================
FAIL: test_case_4 (__main__.SHATestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/test/test_sha.py", line 49, in test_case_4
    '4ca0ef38f1794b28a8f8ee110ee79d48ce13be25')
  File "/usr/lib/python2.7/test/test_sha.py", line 21, in check
    self.assertTrue(computed == digest)
AssertionError: False is not true

----------------------------------------------------------------------
Ran 4 tests in 0.165s

FAILED (failures=4)
Traceback (most recent call last):
  File "/usr/lib/python2.7/test/test_sha.py", line 56, in <module>
    test_main()
  File "/usr/lib/python2.7/test/test_sha.py", line 52, in test_main
    test_support.run_unittest(SHATestCase)
  File "/usr/lib/python2.7/test/test_support.py", line 1372, in run_unittest
    _run_suite(suite)
  File "/usr/lib/python2.7/test/test_support.py", line 1355, in _run_suite
    raise TestFailed(err)
test.test_support.TestFailed: multiple errors occurred
root@qemux86-64:~#
Comment 1 Hongxu Jia 2015-12-02 03:17:16 UTC
The qemu didn't support gcc optimization level 3 very well,
in which the /usr/lib64/python2.7/test/test_sha.py and
/usr/lib64/python2.7/test/test_sha.py failed.

So we use gcc optimization level 2 to instead.
Comment 2 Hongxu Jia 2015-12-02 05:01:19 UTC
The root cause if https://bugzilla.yoctoproject.org/show_bug.cgi?id=8747
Comment 4 Ross Burton 2015-12-03 15:57:34 UTC
There's no point working around this in Python when qemu is broken.  Marking as a duplicate.

*** This bug has been marked as a duplicate of bug 8748 ***
Comment 5 Cristina Agurida 2015-12-07 13:32:54 UTC
Duplicate of bug 8748.