Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61de8e53 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'linux-kselftest-3.19-rc1' of...

Merge tag 'linux-kselftest-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest update from Shuah Khan:
 "kselftest updates for 3.19-rc1:

   - kcmp test include file cleanup
   - kcmp change to build on all architectures
   - A light weight kselftest framework that provides a set of
     interfaces for tests to use to report results.  In addition,
     several tests are updated to use the framework.
   - A new runtime system size test that prints the amount of RAM that
     the currently running system is using"

* tag 'linux-kselftest-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftest: size: Add size test for Linux kernel
  selftests/kcmp: Always try to build the test
  selftests/kcmp: Don't include kernel headers
  kcmp: Move kcmp.h into uapi
  selftests/timers: change test to use ksft framework
  selftests/kcmp: change test to use ksft framework
  selftests/ipc: change test to use ksft framework
  selftests/breakpoints: change test to use ksft framework
  selftests: add kselftest framework for uniform test reporting
  selftests/user: move test out of Makefile into a shell script
  selftests/net: move test out of Makefile into a shell script
parents a7c180aa 3ce51050
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -212,6 +212,7 @@ header-y += ivtv.h
header-y += ixjuser.h
header-y += jffs2.h
header-y += joystick.h
header-y += kcmp.h
header-y += kdev_t.h
header-y += kd.h
header-y += kernelcapi.h
+3 −3
Original line number Diff line number Diff line
#ifndef _LINUX_KCMP_H
#define _LINUX_KCMP_H
#ifndef _UAPI_LINUX_KCMP_H
#define _UAPI_LINUX_KCMP_H

/* Comparison type */
enum kcmp_type {
@@ -14,4 +14,4 @@ enum kcmp_type {
	KCMP_TYPES,
};

#endif /* _LINUX_KCMP_H */
#endif /* _UAPI_LINUX_KCMP_H */
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ TARGETS += sysctl
TARGETS += firmware
TARGETS += ftrace
TARGETS += exec
TARGETS += size

TARGETS_HOTPLUG = cpu-hotplug
TARGETS_HOTPLUG += memory-hotplug
+6 −4
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
#include <sys/types.h>
#include <sys/wait.h>

#include "../kselftest.h"


/* Breakpoint access modes */
enum {
@@ -42,7 +44,7 @@ static void set_breakpoint_addr(void *addr, int n)
		     offsetof(struct user, u_debugreg[n]), addr);
	if (ret) {
		perror("Can't set breakpoint addr\n");
		exit(-1);
		ksft_exit_fail();
	}
}

@@ -105,7 +107,7 @@ static void toggle_breakpoint(int n, int type, int len,
		     offsetof(struct user, u_debugreg[7]), dr7);
	if (ret) {
		perror("Can't set dr7");
		exit(-1);
		ksft_exit_fail();
	}
}

@@ -275,7 +277,7 @@ static void check_success(const char *msg)
			msg2 = "Ok";
		if (ptrace(PTRACE_POKEDATA, child_pid, &trapped, 1)) {
			perror("Can't poke\n");
			exit(-1);
			ksft_exit_fail();
		}
	}

@@ -390,5 +392,5 @@ int main(int argc, char **argv)

	wait(NULL);

	return 0;
	return ksft_exit_pass();
}
+14 −12
Original line number Diff line number Diff line
@@ -5,6 +5,8 @@
#include <linux/msg.h>
#include <fcntl.h>

#include "../kselftest.h"

#define MAX_MSG_SIZE		32

struct msg1 {
@@ -195,58 +197,58 @@ int main(int argc, char **argv)

	if (getuid() != 0) {
		printf("Please run the test as root - Exiting.\n");
		exit(1);
		return ksft_exit_fail();
	}

	msgque.key = ftok(argv[0], 822155650);
	if (msgque.key == -1) {
		printf("Can't make key\n");
		return -errno;
		printf("Can't make key: %d\n", -errno);
		return ksft_exit_fail();
	}

	msgque.msq_id = msgget(msgque.key, IPC_CREAT | IPC_EXCL | 0666);
	if (msgque.msq_id == -1) {
		err = -errno;
		printf("Can't create queue\n");
		printf("Can't create queue: %d\n", err);
		goto err_out;
	}

	err = fill_msgque(&msgque);
	if (err) {
		printf("Failed to fill queue\n");
		printf("Failed to fill queue: %d\n", err);
		goto err_destroy;
	}

	err = dump_queue(&msgque);
	if (err) {
		printf("Failed to dump queue\n");
		printf("Failed to dump queue: %d\n", err);
		goto err_destroy;
	}

	err = check_and_destroy_queue(&msgque);
	if (err) {
		printf("Failed to check and destroy queue\n");
		printf("Failed to check and destroy queue: %d\n", err);
		goto err_out;
	}

	err = restore_queue(&msgque);
	if (err) {
		printf("Failed to restore queue\n");
		printf("Failed to restore queue: %d\n", err);
		goto err_destroy;
	}

	err = check_and_destroy_queue(&msgque);
	if (err) {
		printf("Failed to test queue\n");
		printf("Failed to test queue: %d\n", err);
		goto err_out;
	}
	return 0;
	return ksft_exit_pass();

err_destroy:
	if (msgctl(msgque.msq_id, IPC_RMID, 0)) {
		printf("Failed to destroy queue: %d\n", -errno);
		return -errno;
		return ksft_exit_fail();
	}
err_out:
	return err;
	return ksft_exit_fail();
}
Loading