test: add basic tests for special sections

One of the tests is now failing:

    ERROR: smp-locks-section: kpatch replace failed

I suspect the issue is the vmlinux mismatch problem.  Fix for that
coming soon.
This commit is contained in:
Josh Poimboeuf 2014-05-15 16:47:46 -05:00
parent 707afe238c
commit ecfed91904
3 changed files with 36 additions and 0 deletions

View File

@ -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))

View File

@ -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;

View File

@ -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;