-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #190 from jpoimboe/test-special-sections
add tests for special sections
- Loading branch information
Showing
5 changed files
with
57 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
all: | ||
./kpatch-test | ||
|
||
# Just reuse any already-built modules for the tests. This isn't a | ||
# reliable way to run tests if the code has changed, but it comes in | ||
# handy when creating new tests. | ||
quick: | ||
./kpatch-test -s | ||
|
||
clean: | ||
rm -f *.ko *.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Index: src/fs/proc/proc_sysctl.c | ||
=================================================================== | ||
--- src.orig/fs/proc/proc_sysctl.c | ||
+++ src/fs/proc/proc_sysctl.c | ||
@@ -266,6 +266,7 @@ void sysctl_head_put(struct ctl_table_he | ||
|
||
static struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *head) | ||
{ | ||
+ printk("kpatch-test: testing __bug_table section changes\n"); | ||
BUG_ON(!head); | ||
spin_lock(&sysctl_lock); | ||
if (!use_table(head)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Index: src/fs/proc/generic.c | ||
=================================================================== | ||
--- src.orig/fs/proc/generic.c | ||
+++ src/fs/proc/generic.c | ||
@@ -132,6 +132,7 @@ int proc_alloc_inum(unsigned int *inum) | ||
unsigned int i; | ||
int error; | ||
|
||
+ printk("kpatch-test: testing change to .parainstructions section\n"); | ||
retry: | ||
if (!ida_pre_get(&proc_inum_ida, GFP_KERNEL)) | ||
return -ENOMEM; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Index: src/drivers/tty/tty_buffer.c | ||
=================================================================== | ||
--- src.orig/drivers/tty/tty_buffer.c | ||
+++ src/drivers/tty/tty_buffer.c | ||
@@ -245,6 +245,7 @@ static int __tty_buffer_request_room(str | ||
struct tty_buffer *b, *n; | ||
int left, change; | ||
|
||
+ printk("kpatch-test: testing .smp_locks section changes\n"); | ||
b = buf->tail; | ||
if (b->flags & TTYB_NORMAL) | ||
left = 2 * b->size - b->used; |