summaryrefslogtreecommitdiff
path: root/tools/testing
AgeCommit message (Collapse)Author
2013-05-24revert "selftest: add simple test for soft-dirty bit"Andrew Morton
Revert commit 58c7be84fec8 ("selftest: add simple test for soft-dirty bit"). This is the self test for Pavel's pagemap2 patches which didn't actually get merged. Reported-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-05-01Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-nextLinus Torvalds
Pull networking updates from David Miller: "Highlights (1721 non-merge commits, this has to be a record of some sort): 1) Add 'random' mode to team driver, from Jiri Pirko and Eric Dumazet. 2) Make it so that any driver that supports configuration of multiple MAC addresses can provide the forwarding database add and del calls by providing a default implementation and hooking that up if the driver doesn't have an explicit set of handlers. From Vlad Yasevich. 3) Support GSO segmentation over tunnels and other encapsulating devices such as VXLAN, from Pravin B Shelar. 4) Support L2 GRE tunnels in the flow dissector, from Michael Dalton. 5) Implement Tail Loss Probe (TLP) detection in TCP, from Nandita Dukkipati. 6) In the PHY layer, allow supporting wake-on-lan in situations where the PHY registers have to be written for it to be configured. Use it to support wake-on-lan in mv643xx_eth. From Michael Stapelberg. 7) Significantly improve firewire IPV6 support, from YOSHIFUJI Hideaki. 8) Allow multiple packets to be sent in a single transmission using network coding in batman-adv, from Martin Hundebøll. 9) Add support for T5 cxgb4 chips, from Santosh Rastapur. 10) Generalize the VXLAN forwarding tables so that there is more flexibility in configurating various aspects of the endpoints. From David Stevens. 11) Support RSS and TSO in hardware over GRE tunnels in bxn2x driver, from Dmitry Kravkov. 12) Zero copy support in nfnelink_queue, from Eric Dumazet and Pablo Neira Ayuso. 13) Start adding networking selftests. 14) In situations of overload on the same AF_PACKET fanout socket, or per-cpu packet receive queue, minimize drop by distributing the load to other cpus/fanouts. From Willem de Bruijn and Eric Dumazet. 15) Add support for new payload offset BPF instruction, from Daniel Borkmann. 16) Convert several drivers over to mdoule_platform_driver(), from Sachin Kamat. 17) Provide a minimal BPF JIT image disassembler userspace tool, from Daniel Borkmann. 18) Rewrite F-RTO implementation in TCP to match the final specification of it in RFC4138 and RFC5682. From Yuchung Cheng. 19) Provide netlink socket diag of netlink sockets ("Yo dawg, I hear you like netlink, so I implemented netlink dumping of netlink sockets.") From Andrey Vagin. 20) Remove ugly passing of rtnetlink attributes into rtnl_doit functions, from Thomas Graf. 21) Allow userspace to be able to see if a configuration change occurs in the middle of an address or device list dump, from Nicolas Dichtel. 22) Support RFC3168 ECN protection for ipv6 fragments, from Hannes Frederic Sowa. 23) Increase accuracy of packet length used by packet scheduler, from Jason Wang. 24) Beginning set of changes to make ipv4/ipv6 fragment handling more scalable and less susceptible to overload and locking contention, from Jesper Dangaard Brouer. 25) Get rid of using non-type-safe NLMSG_* macros and use nlmsg_*() instead. From Hong Zhiguo. 26) Optimize route usage in IPVS by avoiding reference counting where possible, from Julian Anastasov. 27) Convert IPVS schedulers to RCU, also from Julian Anastasov. 28) Support cpu fanouts in xt_NFQUEUE netfilter target, from Holger Eitzenberger. 29) Network namespace support for nf_log, ebt_log, xt_LOG, ipt_ULOG, nfnetlink_log, and nfnetlink_queue. From Gao feng. 30) Implement RFC3168 ECN protection, from Hannes Frederic Sowa. 31) Support several new r8169 chips, from Hayes Wang. 32) Support tokenized interface identifiers in ipv6, from Daniel Borkmann. 33) Use usbnet_link_change() helper in USB net driver, from Ming Lei. 34) Add 802.1ad vlan offload support, from Patrick McHardy. 35) Support mmap() based netlink communication, also from Patrick McHardy. 36) Support HW timestamping in mlx4 driver, from Amir Vadai. 37) Rationalize AF_PACKET packet timestamping when transmitting, from Willem de Bruijn and Daniel Borkmann. 38) Bring parity to what's provided by /proc/net/packet socket dumping and the info provided by netlink socket dumping of AF_PACKET sockets. From Nicolas Dichtel. 39) Fix peeking beyond zero sized SKBs in AF_UNIX, from Benjamin Poirier" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1722 commits) filter: fix va_list build error af_unix: fix a fatal race with bit fields bnx2x: Prevent memory leak when cnic is absent bnx2x: correct reading of speed capabilities net: sctp: attribute printl with __printf for gcc fmt checks netlink: kconfig: move mmap i/o into netlink kconfig netpoll: convert mutex into a semaphore netlink: Fix skb ref counting. net_sched: act_ipt forward compat with xtables mlx4_en: fix a build error on 32bit arches Revert "bnx2x: allow nvram test to run when device is down" bridge: avoid OOPS if root port not found drivers: net: cpsw: fix kernel warn on cpsw irq enable sh_eth: use random MAC address if no valid one supplied 3c509.c: call SET_NETDEV_DEV for all device types (ISA/ISAPnP/EISA) tg3: fix to append hardware time stamping flags unix/stream: fix peeking with an offset larger than data in queue unix/dgram: fix peeking with an offset larger than data in queue unix/dgram: peek beyond 0-sized skbs openvswitch: Remove unneeded ovs_netdev_get_ifindex() ...
2013-04-30selftest: add a test case for PTRACE_PEEKSIGINFOAndrey Vagin
* Dump signals from process-wide and per-thread queues with different sizes of buffers. * Check error paths for buffers with restricted permissions. A part of buffer or a whole buffer is for read-only. * Try to get nonexistent signal. Signed-off-by: Andrew Vagin <avagin@openvz.org> Cc: Roland McGrath <roland@redhat.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> Cc: David Howells <dhowells@redhat.com> Cc: Dave Jones <davej@redhat.com> Cc: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> Cc: Pavel Emelyanov <xemul@parallels.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Pedro Alves <palves@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-04-30selftest: add simple test for soft-dirty bitPavel Emelyanov
It creates a mapping of 3 pages and checks that reads, writes and clear-refs result in present and soft-dirt bits reported from pagemap2 set as expected. [akpm@linux-foundation.org: alphasort the Makefile TARGETS to reduce rejects] Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-04-29Merge tag 'ktest-v3.10' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest Pull ktest update from Steven Rostedt: "A couple of fixes to handle a config file that tests multiple machines and has conflicts it the grub menus. That is, if the machines use the same grub menu name, but they are at different locations in the menu.lst file" * tag 'ktest-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest: ktest: Reset grub menu cache with different machines ktest: Allow tests to use different GRUB_MENUs
2013-04-29selftests: psock_tpacket: fix status checkDaniel Borkmann
Testing like this for TP_STATUS_AVAILABLE clearly is a stupid bug since it always returns true. Fix this by only checking for flags where the kernel owns the packet and negate this result, since we also could run into the non-zero status TP_STATUS_WRONG_FORMAT and need to reclaim frames. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-04-24ktest: Reset grub menu cache with different machinesSteven Rostedt (Red Hat)
Different tests may use a different machine. In such cases, we need to try to get the current grub menu index. If the same grub menu is used for two different machines, it may not be at the same index on the second machine. A search for the index must be performed again. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2013-04-19net: Add .gitignore to networking selftests directory.David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-04-07selftests: net: add PF_PACKET TPACKET v1/v2/v3 selftestsDaniel Borkmann
This patch adds a simple test case that probes the packet socket's TPACKET_V1, TPACKET_V2 and TPACKET_V3 behavior regarding mmap(2)'ed I/O for a small burst of 100 packets. The test currently runs for ... TPACKET_V1: RX_RING, TX_RING TPACKET_V2: RX_RING, TX_RING TPACKET_V3: RX_RING ... and will output on success: test: TPACKET_V1 with PACKET_RX_RING .................... 100 pkts (9600 bytes) test: TPACKET_V1 with PACKET_TX_RING .................... 100 pkts (9600 bytes) test: TPACKET_V2 with PACKET_RX_RING .................... 100 pkts (9600 bytes) test: TPACKET_V2 with PACKET_TX_RING .................... 100 pkts (9600 bytes) test: TPACKET_V3 with PACKET_RX_RING .................... 100 pkts (9600 bytes) OK. All tests passed Reusable parts of psock_fanout.c have been put into a psock_lib.h file for common usage. Test case successfully tested on x86_64. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-03-21net: fix psock_fanout on sparc64Willem de Bruijn
The packetsocket fanout test uses a packet ring. Use TPACKET_V2 instead of TPACKET_V1 to work around a known 32/64 bit issue in the older ring that manifests on sparc64. Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-03-20net: Move selftests to common net/ subdirectory.David S. Miller
Suggested-by: Daniel Baluta <daniel.baluta@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-03-20net: fix psock_fanout selftest bind error messageDaniel Baluta
Signed-off-by: Daniel Baluta <dbaluta@ixiacom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-03-20net: fix psock_fanout selftest hash collisionWillem de Bruijn
Fix flaky results with PACKET_FANOUT_HASH depending on whether the two flows hash into the same packet socket or not. Also adds tests for PACKET_FANOUT_LB and PACKET_FANOUT_CPU and replaces the counting method with a packet ring. Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-03-19net: Get rid of compat defines in psock_fanout.c selftest.David S. Miller
Reported-by: Daniel Baluta <dbaluta@ixiacom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-03-19net: Fix failure string in net-socket selftests Makefile.David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-03-19packet: packet fanout rollover during socket overloadWillem de Bruijn
Changes: v3->v2: rebase (no other changes) passes selftest v2->v1: read f->num_members only once fix bug: test rollover mode + flag Minimize packet drop in a fanout group. If one socket is full, roll over packets to another from the group. Maintain flow affinity during normal load using an rxhash fanout policy, while dispersing unexpected traffic storms that hit a single cpu, such as spoofed-source DoS flows. Rollover breaks affinity for flows arriving at saturated sockets during those conditions. The patch adds a fanout policy ROLLOVER that rotates between sockets, filling each socket before moving to the next. It also adds a fanout flag ROLLOVER. If passed along with any other fanout policy, the primary policy is applied until the chosen socket is full. Then, rollover selects another socket, to delay packet drop until the entire system is saturated. Probing sockets is not free. Selecting the last used socket, as rollover does, is a greedy approach that maximizes chance of success, at the cost of extreme load imbalance. In practice, with sufficiently long queues to absorb bursts, sockets are drained in parallel and load balance looks uniform in `top`. To avoid contention, scales counters with number of sockets and accesses them lockfree. Values are bounds checked to ensure correctness. Tested using an application with 9 threads pinned to CPUs, one socket per thread and sufficient busywork per packet operation to limits each thread to handling 32 Kpps. When sent 500 Kpps single UDP stream packets, a FANOUT_CPU setup processes 32 Kpps in total without this patch, 270 Kpps with the patch. Tested with read() and with a packet ring (V1). Also, passes psock_fanout.c unit test added to selftests. Signed-off-by: Willem de Bruijn <willemb@google.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-03-19net: Add socket() system call self test.David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-03-08ktest: Allow tests to use different GRUB_MENUsSteven Rostedt (Red Hat)
To save connecting and searching for a given grub menu for each test, ktest.pl will cache the grub number it found. The problem is that different tests might use a different grub menu, but ktest.pl will ignore it. Instead, have ktest.pl check if the grub menu it used to cache the content is the same as when it grabbed the menu. If not, grab it again, otherwise just return the cached value. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2013-03-06efivars: efivarfs_valid_name() should handle pstore syntaxMatt Fleming
Stricter validation was introduced with commit da27a24383b2b ("efivarfs: guid part of filenames are case-insensitive") and commit 47f531e8ba3b ("efivarfs: Validate filenames much more aggressively"), which is necessary for the guid portion of efivarfs filenames, but we don't need to be so strict with the first part, the variable name. The UEFI specification doesn't impose any constraints on variable names other than they be a NULL-terminated string. The above commits caused a regression that resulted in users seeing the following message, $ sudo mount -v /sys/firmware/efi/efivars mount: Cannot allocate memory whenever pstore EFI variables were present in the variable store, since their variable names failed to pass the following check, /* GUID should be right after the first '-' */ if (s - 1 != strchr(str, '-')) as a typical pstore filename is of the form, dump-type0-10-1-<guid>. The fix is trivial since the guid portion of the filename is GUID_LEN bytes, we can use (len - GUID_LEN) to ensure the '-' character is where we expect it to be. (The bogus ENOMEM error value will be fixed in a separate patch.) Reported-by: Joseph Yasi <joe.yasi@gmail.com> Tested-by: Joseph Yasi <joe.yasi@gmail.com> Reported-by: Lingzhu Xiang <lxiang@redhat.com> Cc: Josh Boyer <jwboyer@redhat.com> Cc: Jeremy Kerr <jk@ozlabs.org> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: <stable@vger.kernel.org> # v3.8 Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-02-27selftests: add a simple docJeremy Kerr
This change adds a little documentation to the tests under tools/testing/selftests/, based on akpm's explanation. [akpm@linux-foundation.org: move from Documentation to tools/testing/selftests/README.txt] Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Cc: Dave Young <dyoung@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-27tools/testing/selftests/Makefile: rearrange targetsAndrew Morton
Do it one-per-line to reduce patch conflict pain. Cc: Dave Young <dyoung@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-27selftests/efivarfs: add create-read testJeremy Kerr
Test that reads from a newly-created efivarfs file (with no data written) will return EOF. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Cc: Matt Fleming <matt.fleming@intel.com> Cc: Lingzhu Xiang <lxiang@redhat.com> Cc: Dave Young <dyoung@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-27selftests/efivarfs: add empty file creation testJeremy Kerr
Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Cc: Matt Fleming <matt.fleming@intel.com> Cc: Lingzhu Xiang <lxiang@redhat.com> Cc: Dave Young <dyoung@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-27selftests: add tests for efivarfsJeremy Kerr
This change adds a few initial efivarfs tests to the tools/testing/selftests directory. The open-unlink test is based on code from Lingzhu Xiang. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Cc: Matt Fleming <matt.fleming@intel.com> Cc: Lingzhu Xiang <lxiang@redhat.com> Cc: Dave Young <dyoung@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-18ktest: Remove indexes from warnings checkSteven Rostedt (Red Hat)
The index of a line where a warning is tested can be returned differently on different versions of gcc (or same version compiled differently). That is, a tab + space can give different results. This causes the warning check to produce a false positive. Removing the index from the check fixes this issue. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2013-02-05ktest: Ignore warnings during rebootSteven Rostedt (Red Hat)
The reboot just wants to get to the next kernel. But if a warning (Call Trace) appears, the monitor will report an error, and the reboot will think something went wrong and power cycle the box, even though we successfully made it to the next kernel. Ignore warnings during the reboot until we get to the next kernel. It will still timeout if we never get to the next kernel and then a power cycle will happen. That's what we want it to do. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2013-02-05ktest: Search for linux banner for successful rebootSteven Rostedt (Red Hat)
Sometimes when a test kernel passed fine, but on reboot it crashed, ktest could get stuck and not proceed. This would be frustrating if you let a test run overnight to find out the next morning that it was stuck on the first test. To fix this, I made reboot check for the REBOOT_SUCCESS_LINE. If the line was not detected, then it would power cycle the box. What it didn't cover was if the REBOOT_SUCCESS_LINE wasn't defined or if a 'good' kernel did not display the line. Instead have it search for the Linux banner "Linux version". The reboot just needs to get to the start of the next kernel, it does not need to test if the next kernel makes it to a boot prompt. After we find the next kernel has booted, then we just wait for either the REBOOT_SUCCESS_LINE to appear or the timeout. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2013-01-31ktest: Add make_warnings_file and process full warningsSteven Rostedt (Red Hat)
Although the patchcheck test checks for warnings in the files that were changed, this check does not catch warnings that were caused by header file changes and the warnings appear in C files not touched by the commit. Add a new option called WARNINGS_FILE. If this option is set, then the file it points to is read before bulid, and the file should contain a list of known warnings. If a warning appears in the build, this file is checked, and if the warning does not exist in this file, then it fails the build showing the new warning. If the WARNINGS_FILE points to a file that does not exist, this will cause any warning in the build to fail. A new test is also added called "make_warnings_file". This test will create do a build and record any warnings it finds into the WARNINGS_FILE. This test is something that can be run before other tests to build a warnings file of "known warnings", ie, warnings that were there before your changes. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2013-01-31ktest: Allow a test option to use its default optionSteven Rostedt (Red Hat)
Options are allowed to use other options, for example: LOG_FILE = ${OUTPUT_DIR}/${MACHINE}.log where the option LOG_FILE used the options OUTPUT_DIR and MACHINE. But if a test option were to use a default option, it will not get substituted: OUTPUT_DIR = ${THIS_DIR}/${MACHINE} TEST_START OUTPUT_DIR = ${OUTPUT_DIR}/t1 For the above test, OUTPUT_DIR will stay literally "${OUTPUT_DIR}/t1" and not be converted to "${THIS_DIR}/${MACHINE}/t1". When the test runs, it will pass the ${OUTPUT_DIR} to the shell, which would probaly interpret it as "", and the output directory will end up as "/t1". Change the code where if a test option has its own option name in its defined field, and a default option exists, then substitute the default option in its place. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2013-01-30ktest: Strip off '\n' when reading which files were modifiedSteven Rostedt (Red Hat)
The patchcheck test looks at what files are modified for each patch it checks and makes sure that those files do not produce any warnings. Unfortunately, when it read the diffstat, the newlines were added on the files and this made compares miss warnings, and commits that should not have passed, ktest let pass. Fix this by using the perl command "chomp" that strips off whitespace at the end of lines. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2013-01-30ktest: Do not require CONSOLE for build or install bisectsSteven Rostedt (Red Hat)
If the user is doing a build or install bisect, there's no reason to have them define CONSOLE, as the console does not need to be read. The console only needs to be read for boot tests. CONSOLE is not required for normal build or install tests, let's not require it for bisect tests with BISECT_TYPE of build or install. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2013-01-04selftests: IPC message queue copy feature testStanislav Kinsbursky
This test can be used to check wheither kernel supports IPC message queue copy and restore features (required by CRIU project). Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Cc: Serge Hallyn <serge.hallyn@canonical.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Pavel Emelyanov <xemul@parallels.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-12-17tools/testing/selftests/kcmp/kcmp_test.c: print reason for failure in kcmp_testDave Jones
I was curious why sys_kcmp wasn't working, which led me to the testcase. It turned out I hadn't enabled CHECKPOINT_RESTORE in the kernel I was testing. Add a decoding of errno to the testcase to make that obvious. Signed-off-by: Dave Jones <davej@redhat.com> Acked-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-12-17breakpoint selftests: print failure status instead of cause make errorDave Young
In case breakpoint test exit non zero value it will cause make error. Better way is just print the test failure status. Signed-off-by: Dave Young <dyoung@redhat.com> Reviewed-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-12-17kcmp selftests: print fail status instead of cause make errorDave Young
In case kcmp_test exit non zero value it will cause make error. Better way is just print the test failure status. Signed-off-by: Dave Young <dyoung@redhat.com> Reviewed-by: Pekka Enberg <penberg@kernel.org> Cc: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-12-17kcmp selftests: make run_tests fixDave Young
make run_tests need the target is run_tests instead of run-tests Also gcc output should be kcmp_test. Fix these two issues. Signed-off-by: Dave Young <dyoung@redhat.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-12-17mem-hotplug selftests: print failure status instead of cause make errorDave Young
Original behavior: bash-4.1$ make -C memory-hotplug run_tests make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/memory-hotplug' ./on-off-test.sh make: execvp: ./on-off-test.sh: Permission denied make: *** [run_tests] Error 127 make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/memory-hotplug' After applying the patch: bash-4.1$ make -C memory-hotplug run_tests make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/memory-hotplug' /bin/sh: ./on-off-test.sh: Permission denied memory-hotplug selftests: [FAIL] make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/memory-hotplug' Signed-off-by: Dave Young <dyoung@redhat.com> Reviewed-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-12-17cpu-hotplug selftests: print failure status instead of cause make errorDave Young
Original behavior: bash-4.1$ make -C cpu-hotplug run_tests make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/cpu-hotplug' ./on-off-test.sh make: execvp: ./on-off-test.sh: Permission denied make: *** [run_tests] Error 127 make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/cpu-hotplug' After applying the patch: bash-4.1$ make -C cpu-hotplug run_tests make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/cpu-hotplug' /bin/sh: ./on-off-test.sh: Permission denied cpu-hotplug selftests: [FAIL] make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/cpu-hotplug' Signed-off-by: Dave Young <dyoung@redhat.com> Reviewed-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-12-17mqueue selftests: print failure status instead of cause make errorDave Young
Original behavior: bash-4.1$ make -C mqueue run_tests make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/mqueue' ./mq_open_tests /test1 Not running as root, but almost all tests require root in order to modify system settings. Exiting. make: *** [run_tests] Error 1 make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/mqueue' After applying the patch: bash-4.1$ make -C mqueue run_tests make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/mqueue' Not running as root, but almost all tests require root in order to modify system settings. Exiting. mq_open_tests: [FAIL] Not running as root, but almost all tests require root in order to modify system settings. Exiting. mq_perf_tests: [FAIL] make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/mqueue' Signed-off-by: Dave Young <dyoung@redhat.com> Reviewed-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-12-17vm selftests: print failure status instead of cause make errorDave Young
Original behavior: bash-4.1$ make -C vm run_tests make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/vm' /bin/sh ./run_vmtests ./run_vmtests: line 24: /proc/sys/vm/nr_hugepages: Permission denied Please run this test as root make: *** [run_tests] Error 1 make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/vm' After applying the patch: bash-4.1$ make -C vm run_tests make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/vm' ./run_vmtests: line 24: /proc/sys/vm/nr_hugepages: Permission denied Please run this test as root vmtests: [FAIL] make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/vm' Signed-off-by: Dave Young <dyoung@redhat.com> Cc: Pekka Enberg <penberg@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-12-13Merge tag 'ktest-v3.8' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest Pull ktest update from Steven Rostedt: "fixes and updated for new boot loaders" * tag 'ktest-v3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest: ktest: Test if target machine is up before install ktest: Fix breakage from change of oldnoconfig to olddefconfig ktest: Add native support for syslinux boot loader ktest: Sync before reboot ktest: Add support for grub2
2012-12-11ktest: Test if target machine is up before installSteven Rostedt
Sometimes a test kernel will crash or hang on reboot (this is even more apparent when testing a config without CGROUPS on a box running systemd). When this happens, on the next iteration of installing a kernel, ktest will fail when it tries to install. Have ktest do a check to see if the target can be connected to via ssh before it tries to install. If it can't connect, then reboot again. This time the reboot will fail because it can't connect and will force a power cycle. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2012-12-11ktest: Fix breakage from change of oldnoconfig to olddefconfigSteven Rostedt
Commit fb16d891 "kconfig: replace 'oldnoconfig' with 'olddefconfig', and keep the old name", changed ktest's default config update from oldnoconfig to olddefconfig without adding oldnoconfig as a backup. The make oldnoconfig works much better than its backup of: yes '' | make oldconfig But due to this change, and the fact that ktest is used to build lots of older kernels (and for bisects), it forgoes the oldnoconfig completely. Cc: Adam Lee <adam8157@gmail.com> Cc: Michal Marek <mmarek@suse.cz> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2012-12-11selftests: add a test program for variable huge page sizes in mmap/shmgetAndi Kleen
Also remove -Wextra because gcc-4.6 emits lots of irritating signed/unsigned comparison warnings. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-12-11ktest: Add native support for syslinux boot loaderSteven Rostedt
I installed Fedora 17 which no longer supports grub v1. I worked with grub2 for a while, but there's so many issues with it and automated rebooting, that I decided to switch to syslinux. Instead of using the REBOOT_SCRIPT and add customized changes to get syslinux booted, I thought it better to make ktest aware of syslinux and add options to simplify the use of syslinux on a target test box. Acked-by: H. Peter Anvin <hpa@zytor.com> Cc: John 'Warthog9' Hawley <warthog9@kernel.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2012-12-11ktest: Sync before rebootSteven Rostedt
Before rebooting the target, run the sync command, as it seems that either Grub2 or systemd gets screwed up if you update to reboot a kernel once and do a reboot without doing a sync. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2012-11-13ktest: Add support for grub2Steven Rostedt
As only grub or 'script' is supported for rebooting to a new kernel, and Fedora 17 has dropped support for grub, I decided to add grub2 support as well (I also plan on adding syslinux/extlinux support too). The options GRUB_FILE and GRUB_REBOOT were added to allow the user to specify where to find the grub.cfg and what tool to use to reboot into the next kernel respectively. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2012-11-09revert "epoll: support for disabling items, and a self-test app"Andrew Morton
Revert commit 03a7beb55b9f ("epoll: support for disabling items, and a self-test app") pending resolution of the issues identified by Michael Kerrisk, copied below. We'll revisit this for 3.8. : I've taken a look at this patch as it currently stands in 3.7-rc1, and : done a bit of testing. (By the way, the test program : tools/testing/selftests/epoll/test_epoll.c does not compile...) : : There are one or two places where the behavior seems a little strange, : so I have a question or two at the end of this mail. But other than : that, I want to check my understanding so that the interface can be : correctly documented. : : Just to go though my understanding, the problem is the following : scenario in a multithreaded application: : : 1. Multiple threads are performing epoll_wait() operations, : and maintaining a user-space cache that contains information : corresponding to each file descriptor being monitored by : epoll_wait(). : : 2. At some point, a thread wants to delete (EPOLL_CTL_DEL) : a file descriptor from the epoll interest list, and : delete the corresponding record from the user-space cache. : : 3. The problem with (2) is that some other thread may have : previously done an epoll_wait() that retrieved information : about the fd in question, and may be in the middle of using : information in the cache that relates to that fd. Thus, : there is a potential race. : : 4. The race can't solved purely in user space, because doing : so would require applying a mutex across the epoll_wait() : call, which would of course blow thread concurrency. : : Right? : : Your solution is the EPOLL_CTL_DISABLE operation. I want to : confirm my understanding about how to use this flag, since : the description that has accompanied the patches so far : has been a bit sparse : : 0. In the scenario you're concerned about, deleting a file : descriptor means (safely) doing the following: : (a) Deleting the file descriptor from the epoll interest list : using EPOLL_CTL_DEL : (b) Deleting the corresponding record in the user-space cache : : 1. It's only meaningful to use this EPOLL_CTL_DISABLE in : conjunction with EPOLLONESHOT. : : 2. Using EPOLL_CTL_DISABLE without using EPOLLONESHOT in : conjunction is a logical error. : : 3. The correct way to code multithreaded applications using : EPOLL_CTL_DISABLE and EPOLLONESHOT is as follows: : : a. All EPOLL_CTL_ADD and EPOLL_CTL_MOD operations should : should EPOLLONESHOT. : : b. When a thread wants to delete a file descriptor, it : should do the following: : : [1] Call epoll_ctl(EPOLL_CTL_DISABLE) : [2] If the return status from epoll_ctl(EPOLL_CTL_DISABLE) : was zero, then the file descriptor can be safely : deleted by the thread that made this call. : [3] If the epoll_ctl(EPOLL_CTL_DISABLE) fails with EBUSY, : then the descriptor is in use. In this case, the calling : thread should set a flag in the user-space cache to : indicate that the thread that is using the descriptor : should perform the deletion operation. : : Is all of the above correct? : : The implementation depends on checking on whether : (events & ~EP_PRIVATE_BITS) == 0 : This replies on the fact that EPOLL_CTL_AD and EPOLL_CTL_MOD always : set EPOLLHUP and EPOLLERR in the 'events' mask, and EPOLLONESHOT : causes those flags (as well as all others in ~EP_PRIVATE_BITS) to be : cleared. : : A corollary to the previous paragraph is that using EPOLL_CTL_DISABLE : is only useful in conjunction with EPOLLONESHOT. However, as things : stand, one can use EPOLL_CTL_DISABLE on a file descriptor that does : not have EPOLLONESHOT set in 'events' This results in the following : (slightly surprising) behavior: : : (a) The first call to epoll_ctl(EPOLL_CTL_DISABLE) returns 0 : (the indicator that the file descriptor can be safely deleted). : (b) The next call to epoll_ctl(EPOLL_CTL_DISABLE) fails with EBUSY. : : This doesn't seem particularly useful, and in fact is probably an : indication that the user made a logic error: they should only be using : epoll_ctl(EPOLL_CTL_DISABLE) on a file descriptor for which : EPOLLONESHOT was set in 'events'. If that is correct, then would it : not make sense to return an error to user space for this case? Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: "Paton J. Lewis" <palewis@adobe.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-10-28Merge tag 'ktest-v3.7-rc2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest Pull ktest confusion fix from Steven Rostedt: "With the v3.7-rc2 kernel, the network cards on my target boxes were not being brought up. I found that the modules for the network was not being installed. This was due to the config CONFIG_MODULES_USE_ELF_RELA that came before CONFIG_MODULES, and confused ktest in thinking that CONFIG_MODULES=y was not found. Ktest needs to test all configs and not just stop if something starts with CONFIG_MODULES." * tag 'ktest-v3.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest: ktest: Fix ktest confusion with CONFIG_MODULES_USE_ELF_RELA
2012-10-26ktest: Fix ktest confusion with CONFIG_MODULES_USE_ELF_RELASteven Rostedt
In order to decide if ktest should bother installing modules on the target box, it checks if the config file has CONFIG_MODULES=y. But it also checks if the '=y' part exists. It only will install modules if the config exists and is set with '=y'. But as the regex that was used tests: /^CONFIG_MODULES(=y)?/ this will also match: CONFIG_MODULES_USE_ELF_RELA as the '=y' part was optional and it did not test the rest of the line. When this happens, ktest will stop checking the rest of the configs but it will also think that no modules are needed to be installed. What it should do is only jump out of the loop if it actually found a CONFIG_MODULES that is set to true. Otherwise, ktest wont install the necessary modules needed for proper booting of the test target. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>