Bug 638822 - FEAT: port /kernel/memory/mmap1 into v7
Summary: FEAT: port /kernel/memory/mmap1 into v7
Keywords:
Status: CLOSED DUPLICATE of bug 715215
Alias: None
Product: Red Hat Hardware Certification Program
Classification: Retired
Component: Test Suite (tests)
Version: 1.2
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: Caspar Zhang
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-09-30 03:33 UTC by Qian Cai
Modified: 2023-07-19 11:58 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-10-24 06:06:38 UTC
Embargoed:


Attachments (Terms of Use)
patch (4.30 KB, patch)
2010-11-03 04:49 UTC, Caspar Zhang
no flags Details | Diff
add mmap test in v7 (3.62 KB, patch)
2010-11-03 05:14 UTC, Caspar Zhang
no flags Details | Diff
add mmap test in v7 (new test) (9.57 KB, patch)
2011-01-22 09:19 UTC, Caspar Zhang
no flags Details | Diff

Description Qian Cai 2010-09-30 03:33:47 UTC
Description of problem:
# makes a tmp file, mmaps it, writes to the mmaped memory, syncs and reads from the file
# mkstemp, sysconf, possix_fallocate
# mmap, msync
# lseek, read

Comment 1 Caspar Zhang 2010-11-03 04:49:51 UTC
Created attachment 457356 [details]
patch

Comment 2 Caspar Zhang 2010-11-03 05:12:54 UTC
a build for RHEL6: http://lacrosse.corp.redhat.com/~czhang/v7/rhel6/noarch/v7-1.2-25.1.czhang.el6.noarch.rpm

running log:

...snip...

<output>
Running ./memory.py:
<output name="Limits" description="Get test parameters based on hardware">
System Memory: 3765 MB
Free Memory: 3213 MB
Swap Memory: 4102 MB
<summary>PASS</summary>
</output>
<output name="mmap" description="Run mmap test ported from Kernel Tier 1 tests">
Run mmap test ported from Kernel Tier 1
get pagesize = 4096
allocate file space with pagesize
mmap twice of pagezie in r/w and shared mapping mode
allocate rest space in the file
synchronize with mmap
validating by reading data from fd.
mmap: PASS
done.
<summary>PASS</summary>
</output>
<output name="Single-process" description="None">
Starting Threaded Memory Test
running for more than free memory at 3373 MB for 60 sec.
...snip...

Comment 3 Caspar Zhang 2010-11-03 05:14:08 UTC
Created attachment 457357 [details]
add mmap test in v7

updated patch

Comment 4 Greg Nichols 2010-11-05 12:41:01 UTC
Moving to POST  for patch review.

Comment 5 Rob Landry 2010-11-19 20:03:57 UTC
Is the intent here to add a new hwcert test or a new qa use only test?

Comment 6 Caspar Zhang 2011-01-12 09:56:11 UTC
(In reply to comment #5)
> Is the intent here to add a new hwcert test or a new qa use only test?

According the meeting and follow-up discussion. I think we can put this kind of memory tests into existed memory test item, and creating a new qa/non-hwcert test for other kernel tier tests.

Comment 7 Rob Landry 2011-01-12 15:35:05 UTC
What is the run time?  What is the technical argument to add this test both as it compares to the existing v7 tests and why we should block a system which fails this test.  Is this duplicate to another portion of the existing v7 tests?

Comments on patch: probably nobody external will care that it is a ported test, perhaps those should be comments in code instead of announcement in the run logs?

Comment 8 Caspar Zhang 2011-01-22 09:19:48 UTC
Created attachment 474728 [details]
add mmap test in v7 (new test)

I create a new tag "kerneltier1" for running Kernel Tier 1 tests, and
mark this test as non-certification test. Since there are many tests
needed to port to v7, customers maybe not accept if we integrate them
to existed tests unless we have a solid technical argument of adding
them.

New test basic information:

Runtime: 5m

Architecture: All

Function: test memory mapping by firstly allocating part of file space,
    mmaping whole file into memory, then allocating rest part of file
    space, then sync file with memory map. To validate mmap works, seek
    to certain file place, confirm the content is the same as in the
    memory map or not.

PASS/FAIL criteria: if the test returns non-zero value, the test would
fail, else the test gets passed.

Technical Argument: this test is used to test mmap() functionality, as
well as kernel memory functions. If the test fails, there may be
something incorrect with glibc, kernel or memory hardware. Additionally,
this test is ported from Kernel Tier 1 tests, which are used to run as
key tests suite before a kernel is confirmed to be usable.

Signed-off-by: Caspar Zhang <czhang>

Comment 9 Caspar Zhang 2011-01-22 09:22:40 UTC
Since it's not tagged as "certification" test, you cannot directly run via `v7 run -t kt1_mmap1', you should add -g option: -g osqa (existed tag) or -g kerneltier1 (required by Jeff and Kernel QE, newly added in the patch)

A running result:

running kt1_mmap1 on 
sh: kudzu: command not found
mkdir -p /tmp/v7-kt1_mmap1-2Zeu1h/mnt/tests/V7/v7/kt1_mmap1
cp -a testinfo.desc runtest.sh kt1_mmap1.py mmaptst.c Makefile /tmp/v7-kt1_mmap1-2Zeu1h/mnt/tests/V7/v7/kt1_mmap1
install -m 0755 runtest.sh /tmp/v7-kt1_mmap1-2Zeu1h/mnt/tests/V7/v7/kt1_mmap1
make OUTPUTFILE=/var/log/v7/runs/1/kt1_mmap1/output.log RUNMODE=normal UDI= DEVICE= TESTSERVER=unknown run
cc     mmaptst.c   -o mmaptst
chmod a+x ./runtest.sh ./kt1_mmap1.py
./runtest.sh
/tmp/v7-kt1_mmap1-2Zeu1h/mnt/tests/V7/v7/kt1_mmap1/kt1_mmap1.py
<output>
Running ./kt1_mmap1.py:
<output name="mmap1" description="mmap test">
running mmap test ported from Kernel Tier 1
created tempfile /tmp/mmaptst.jf4PlX
Get PAGESIZE = 4096
allocate file space first time done.
map memory done.
allocate file space second time done.
Verify 1: accessed value correct
sync file with memory map done.
lseek to offset = PAGESIZE.
Verify 2: read file contents correct.
Verify 3: read value correct.
PASS
done.
<summary>PASS</summary>
</output>
...finished running ./kt1_mmap1.py, exit code=0
</output>
recovered exit code=0
v7-report-result /V7/v7/kt1_mmap1 PASS /var/log/v7/runs/1/kt1_mmap1/output.log 
saved to /var/v7/results.xml
saveOutput: /var/log/v7/runs/1/kt1_mmap1/output.log
Return value was 0

Comment 10 Caspar Zhang 2011-10-24 06:06:38 UTC

*** This bug has been marked as a duplicate of bug 715215 ***


Note You need to log in before you can comment on or make changes to this bug.