test/integration: remove obsolete tests

Cleaning house a bit.  Now that we have unit tests, a lot of these tests
aren't very useful anymore.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
This commit is contained in:
Josh Poimboeuf 2018-04-19 17:13:36 -05:00
parent 5629d91bfe
commit e16b4187a1
19 changed files with 0 additions and 433 deletions

View File

@ -1,12 +0,0 @@
diff -Nupr src.orig/fs/proc/proc_sysctl.c src/fs/proc/proc_sysctl.c
--- src.orig/fs/proc/proc_sysctl.c 2017-11-17 15:58:41.115211972 -0500
+++ src/fs/proc/proc_sysctl.c 2017-11-17 15:58:51.725211972 -0500
@@ -332,6 +332,8 @@ static void start_unregistering(struct c
static struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *head)
{
+ if (jiffies == 0)
+ printk("kpatch-test: testing __bug_table section changes\n");
BUG_ON(!head);
spin_lock(&sysctl_lock);
if (!use_table(head))

View File

@ -1,3 +0,0 @@
#!/bin/bash
grep kpatch=1 /proc/cmdline

View File

@ -1,12 +0,0 @@
diff -Nupr src.orig/fs/proc/cmdline.c src/fs/proc/cmdline.c
--- src.orig/fs/proc/cmdline.c 2017-11-17 15:58:41.126211972 -0500
+++ src/fs/proc/cmdline.c 2017-11-17 15:58:54.891211972 -0500
@@ -5,7 +5,7 @@
static int cmdline_proc_show(struct seq_file *m, void *v)
{
- seq_printf(m, "%s\n", saved_command_line);
+ seq_printf(m, "%s kpatch=1\n", saved_command_line);
return 0;
}

View File

@ -1,11 +0,0 @@
diff -Nupr src.orig/net/core/dev.c src/net/core/dev.c
--- src.orig/net/core/dev.c 2017-11-17 15:58:50.569211972 -0500
+++ src/net/core/dev.c 2017-11-17 15:59:00.286211972 -0500
@@ -4260,6 +4260,7 @@ skip_classify:
case RX_HANDLER_PASS:
break;
default:
+ printk("BUG!\n");
BUG();
}
}

View File

@ -1,12 +0,0 @@
diff -Nupr src.orig/fs/readdir.c src/fs/readdir.c
--- src.orig/fs/readdir.c 2017-11-17 15:58:39.457211972 -0500
+++ src/fs/readdir.c 2017-11-17 15:59:02.078211972 -0500
@@ -189,6 +189,8 @@ static int filldir(struct dir_context *c
goto efault;
}
dirent = buf->current_dir;
+ if (dirent->d_ino == 12345678)
+ printk("kpatch-test: testing .fixup section changes\n");
if (__put_user(d_ino, &dirent->d_ino))
goto efault;
if (__put_user(reclen, &dirent->d_reclen))

View File

@ -1,16 +0,0 @@
ensure timekeeping_forward_now.constprop.8 and
timekeeping_forward_now.constprop.9 are correlated.
diff -Nupr src.orig/kernel/time/timekeeping.c src/kernel/time/timekeeping.c
--- src.orig/kernel/time/timekeeping.c 2017-11-17 15:58:51.500211972 -0500
+++ src/kernel/time/timekeeping.c 2017-11-17 15:59:03.810211972 -0500
@@ -1206,6 +1206,9 @@ void do_gettimeofday(struct timeval *tv)
{
struct timespec64 now;
+ if (!tv)
+ return;
+
getnstimeofday64(&now);
tv->tv_sec = now.tv_sec;
tv->tv_usec = now.tv_nsec/1000;

View File

@ -1,19 +0,0 @@
diff -Nupr src.orig/kernel/reboot.c src/kernel/reboot.c
--- src.orig/kernel/reboot.c 2017-11-17 15:58:51.558211972 -0500
+++ src/kernel/reboot.c 2017-11-17 15:59:10.774211972 -0500
@@ -366,8 +366,15 @@ SYSCALL_DEFINE4(reboot, int, magic1, int
return ret;
}
+void kpatch_bar(void)
+{
+ if (!jiffies)
+ printk("kpatch_foo\n");
+}
+
static void deferred_cad(struct work_struct *dummy)
{
+ kpatch_bar();
kernel_restart(NULL);
}

View File

@ -1,45 +0,0 @@
diff -Nupr src.orig/kernel/audit.c src/kernel/audit.c
--- src.orig/kernel/audit.c 2017-11-17 15:58:51.516211972 -0500
+++ src/kernel/audit.c 2017-11-17 15:59:14.324211972 -0500
@@ -282,6 +282,12 @@ void audit_panic(const char *message)
}
}
+void kpatch_audit_foo(void)
+{
+ if (!jiffies)
+ printk("kpatch audit foo\n");
+}
+
static inline int audit_rate_check(void)
{
static unsigned long last_check = 0;
@@ -292,6 +298,7 @@ static inline int audit_rate_check(void)
unsigned long elapsed;
int retval = 0;
+ kpatch_audit_foo();
if (!audit_rate_limit) return 1;
spin_lock_irqsave(&lock, flags);
@@ -311,6 +318,11 @@ static inline int audit_rate_check(void)
return retval;
}
+noinline void kpatch_audit_check(void)
+{
+ audit_rate_check();
+}
+
/**
* audit_log_lost - conditionally log lost audit message event
* @message: the message stating reason for lost audit message
@@ -357,6 +369,8 @@ static int audit_log_config_change(char
struct audit_buffer *ab;
int rc = 0;
+ kpatch_audit_check();
+
ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE);
if (unlikely(!ab))
return rc;

View File

@ -1,25 +0,0 @@
diff -Nupr src.orig/arch/x86/kernel/ldt.c src/arch/x86/kernel/ldt.c
--- src.orig/arch/x86/kernel/ldt.c 2017-11-17 15:58:09.662211972 -0500
+++ src/arch/x86/kernel/ldt.c 2017-11-17 15:59:16.084211972 -0500
@@ -100,6 +100,12 @@ static void free_ldt_struct(struct ldt_s
kfree(ldt);
}
+void hi_there(void)
+{
+ if (!jiffies)
+ printk("hi there\n");
+}
+
/*
* we do not have to muck with descriptors here, that is
* done in switch_mm() as needed.
@@ -110,6 +116,8 @@ int init_new_context_ldt(struct task_str
struct mm_struct *old_mm;
int retval = 0;
+ hi_there();
+
mutex_init(&mm->context.lock);
old_mm = current->mm;
if (!old_mm) {

View File

@ -1,147 +0,0 @@
diff -Nupr src.orig/net/ipv4/fib_frontend.c src/net/ipv4/fib_frontend.c
--- src.orig/net/ipv4/fib_frontend.c 2017-11-17 16:16:54.789211972 -0500
+++ src/net/ipv4/fib_frontend.c 2017-11-17 16:19:58.429211972 -0500
@@ -740,6 +740,7 @@ errout:
return err;
}
+#include "kpatch-macros.h"
static int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh,
struct netlink_ext_ack *extack)
{
@@ -759,6 +760,7 @@ static int inet_rtm_newroute(struct sk_b
}
err = fib_table_insert(net, tb, &cfg, extack);
+ KPATCH_PRINTK("[inet_rtm_newroute]: err is %d\n", err);
errout:
return err;
}
diff -Nupr src.orig/net/ipv4/fib_semantics.c src/net/ipv4/fib_semantics.c
--- src.orig/net/ipv4/fib_semantics.c 2017-11-17 16:16:54.789211972 -0500
+++ src/net/ipv4/fib_semantics.c 2017-11-17 16:21:11.653211972 -0500
@@ -1026,6 +1026,7 @@ fib_convert_metrics(struct fib_info *fi,
return 0;
}
+#include "kpatch-macros.h"
struct fib_info *fib_create_info(struct fib_config *cfg,
struct netlink_ext_ack *extack)
{
@@ -1059,6 +1060,7 @@ struct fib_info *fib_create_info(struct
#endif
err = -ENOBUFS;
+ KPATCH_PRINTK("[fib_create_info]: create error err is %d\n",err);
if (fib_info_cnt >= fib_info_hash_size) {
unsigned int new_size = fib_info_hash_size << 1;
struct hlist_head *new_info_hash;
@@ -1079,6 +1081,7 @@ struct fib_info *fib_create_info(struct
if (!fib_info_hash_size)
goto failure;
}
+ KPATCH_PRINTK("[fib_create_info]: 2 create error err is %d\n",err);
fi = kzalloc(sizeof(*fi)+nhs*sizeof(struct fib_nh), GFP_KERNEL);
if (!fi)
@@ -1093,6 +1096,8 @@ struct fib_info *fib_create_info(struct
} else {
fi->fib_metrics = (struct dst_metrics *)&dst_default_metrics;
}
+ KPATCH_PRINTK("[fib_create_info]: 3 create error err is %d\n",err);
+
fib_info_cnt++;
fi->fib_net = net;
fi->fib_protocol = cfg->fc_protocol;
@@ -1110,6 +1115,7 @@ struct fib_info *fib_create_info(struct
if (!nexthop_nh->nh_pcpu_rth_output)
goto failure;
} endfor_nexthops(fi)
+ KPATCH_PRINTK("[fib_create_info]: 4 create error err is %d\n",err);
err = fib_convert_metrics(fi, cfg);
if (err)
@@ -1174,6 +1180,9 @@ struct fib_info *fib_create_info(struct
#endif
}
+ KPATCH_PRINTK("[fib_create_info]: 5 create error err is %d\n",err);
+ KPATCH_PRINTK("[fib_create_info]: 6 create error err is %d\n",err);
+
if (fib_props[cfg->fc_type].error) {
if (cfg->fc_gw || cfg->fc_oif || cfg->fc_mp) {
NL_SET_ERR_MSG(extack,
@@ -1194,6 +1203,7 @@ struct fib_info *fib_create_info(struct
goto err_inval;
}
}
+ KPATCH_PRINTK("[fib_create_info]: 7 create error err is %d\n",err);
if (cfg->fc_scope > RT_SCOPE_HOST) {
NL_SET_ERR_MSG(extack, "Invalid scope");
@@ -1232,6 +1242,7 @@ struct fib_info *fib_create_info(struct
if (linkdown == fi->fib_nhs)
fi->fib_flags |= RTNH_F_LINKDOWN;
}
+ KPATCH_PRINTK("[fib_create_info]: 8 create error err is %d\n",err);
if (fi->fib_prefsrc && !fib_valid_prefsrc(cfg, fi->fib_prefsrc)) {
NL_SET_ERR_MSG(extack, "Invalid prefsrc address");
@@ -1242,6 +1253,7 @@ struct fib_info *fib_create_info(struct
fib_info_update_nh_saddr(net, nexthop_nh);
fib_add_weight(fi, nexthop_nh);
} endfor_nexthops(fi)
+ KPATCH_PRINTK("[fib_create_info]: 9 create error err is %d\n",err);
fib_rebalance(fi);
@@ -1253,6 +1265,7 @@ link_it:
ofi->fib_treeref++;
return ofi;
}
+ KPATCH_PRINTK("[fib_create_info]: 10 create error err is %d\n",err);
fi->fib_treeref++;
refcount_set(&fi->fib_clntref, 1);
@@ -1276,6 +1289,7 @@ link_it:
hlist_add_head(&nexthop_nh->nh_hash, head);
} endfor_nexthops(fi)
spin_unlock_bh(&fib_info_lock);
+ KPATCH_PRINTK("[fib_create_info]: 11 create error err is %d\n",err);
return fi;
err_inval:
@@ -1286,6 +1300,7 @@ failure:
fi->fib_dead = 1;
free_fib_info(fi);
}
+ KPATCH_PRINTK("[fib_create_info]: 12 create error err is %d\n",err);
return ERR_PTR(err);
}
diff -Nupr src.orig/net/ipv4/fib_trie.c src/net/ipv4/fib_trie.c
--- src.orig/net/ipv4/fib_trie.c 2017-11-17 16:16:54.789211972 -0500
+++ src/net/ipv4/fib_trie.c 2017-11-17 16:22:11.702211972 -0500
@@ -1116,6 +1116,7 @@ static bool fib_valid_key_len(u32 key, u
}
/* Caller must hold RTNL. */
+#include "kpatch-macros.h"
int fib_table_insert(struct net *net, struct fib_table *tb,
struct fib_config *cfg, struct netlink_ext_ack *extack)
{
@@ -1138,11 +1139,14 @@ int fib_table_insert(struct net *net, st
pr_debug("Insert table=%u %08x/%d\n", tb->tb_id, key, plen);
+ KPATCH_PRINTK("[fib_table_insert]: start\n");
fi = fib_create_info(cfg, extack);
if (IS_ERR(fi)) {
err = PTR_ERR(fi);
+ KPATCH_PRINTK("[fib_table_insert]: create error err is %d\n",err);
goto err;
}
+ KPATCH_PRINTK("[fib_table_insert]: cross\n");
l = fib_find_node(t, &tp, key);
fa = l ? fib_find_alias(&l->leaf, slen, tos, fi->fib_priority,

View File

@ -1,11 +0,0 @@
diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c
--- src.orig/fs/proc/meminfo.c 2017-11-17 15:58:41.113211972 -0500
+++ src/fs/proc/meminfo.c 2017-11-17 15:59:23.081211972 -0500
@@ -175,6 +175,7 @@ static const struct file_operations memi
static int __init proc_meminfo_init(void)
{
+ printk("a\n");
proc_create("meminfo", 0, NULL, &meminfo_proc_fops);
return 0;
}

View File

@ -1,20 +0,0 @@
diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c
--- src.orig/fs/proc/meminfo.c 2017-11-17 15:58:41.113211972 -0500
+++ src/fs/proc/meminfo.c 2017-11-17 15:59:21.276211972 -0500
@@ -51,6 +51,8 @@ static int meminfo_proc_show(struct seq_
unsigned long pages[NR_LRU_LISTS];
int lru;
+ printk("a\n");
+
si_meminfo(&i);
si_swapinfo(&i);
committed = percpu_counter_read_positive(&vm_committed_as);
@@ -175,6 +177,7 @@ static const struct file_operations memi
static int __init proc_meminfo_init(void)
{
+ printk("a\n");
proc_create("meminfo", 0, NULL, &meminfo_proc_fops);
return 0;
}

View File

@ -1,3 +0,0 @@
#!/bin/bash
grep VMALLOCCHUNK /proc/meminfo

View File

@ -1,12 +0,0 @@
diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c
--- src.orig/fs/proc/meminfo.c 2017-11-17 15:59:24.724211972 -0500
+++ src/fs/proc/meminfo.c 2017-11-17 15:59:24.721211972 -0500
@@ -132,7 +132,7 @@ static int meminfo_proc_show(struct seq_
seq_printf(m, "VmallocTotal: %8lu kB\n",
(unsigned long)VMALLOC_TOTAL >> 10);
show_val_kb(m, "VmallocUsed: ", 0ul);
- show_val_kb(m, "VmallocChunk: ", 0ul);
+ show_val_kb(m, "VMALLOCCHUNK: ", 0ul);
#ifdef CONFIG_MEMORY_FAILURE
seq_printf(m, "HardwareCorrupted: %5lu kB\n",

View File

@ -1,12 +0,0 @@
diff -Nupr src.orig/arch/x86/kvm/x86.c src/arch/x86/kvm/x86.c
--- src.orig/arch/x86/kvm/x86.c 2017-11-17 15:58:19.002211972 -0500
+++ src/arch/x86/kvm/x86.c 2017-11-17 15:59:34.499211972 -0500
@@ -252,6 +252,8 @@ static void shared_msr_update(unsigned s
void kvm_define_shared_msr(unsigned slot, u32 msr)
{
+ if (!jiffies)
+ printk("kpatch kvm define shared msr\n");
BUG_ON(slot >= KVM_NR_SHARED_MSRS);
shared_msrs_global.msrs[slot] = msr;
if (slot >= shared_msrs_global.nr)

View File

@ -1,12 +0,0 @@
diff -Nupr src.orig/drivers/tty/tty_buffer.c src/drivers/tty/tty_buffer.c
--- src.orig/drivers/tty/tty_buffer.c 2017-11-17 15:58:00.518211972 -0500
+++ src/drivers/tty/tty_buffer.c 2017-11-17 15:59:37.806211972 -0500
@@ -255,6 +255,8 @@ static int __tty_buffer_request_room(str
struct tty_buffer *b, *n;
int left, change;
+ if (!size)
+ printk("kpatch-test: testing .smp_locks section changes\n");
b = buf->tail;
if (b->flags & TTYB_NORMAL)
left = 2 * b->size - b->used;

View File

@ -1,24 +0,0 @@
diff -Nupr src.orig/arch/x86/kvm/x86.c src/arch/x86/kvm/x86.c
--- src.orig/arch/x86/kvm/x86.c 2017-11-17 15:58:19.002211972 -0500
+++ src/arch/x86/kvm/x86.c 2017-11-17 15:59:39.427211972 -0500
@@ -2126,12 +2126,20 @@ static void record_steal_time(struct kvm
&vcpu->arch.st.steal, sizeof(struct kvm_steal_time));
}
+void kpatch_kvm_x86_foo(void)
+{
+ if (!jiffies)
+ printk("kpatch kvm x86 foo\n");
+}
+
int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
{
bool pr = false;
u32 msr = msr_info->index;
u64 data = msr_info->data;
+ kpatch_kvm_x86_foo();
+
switch (msr) {
case MSR_AMD64_NB_CFG:
case MSR_IA32_UCODE_REV:

View File

@ -1,22 +0,0 @@
diff -Nupr src.orig/kernel/fork.c src/kernel/fork.c
--- src.orig/kernel/fork.c 2017-11-17 15:58:51.541211972 -0500
+++ src/kernel/fork.c 2017-11-17 15:59:41.041211972 -0500
@@ -1374,10 +1374,18 @@ static void posix_cpu_timers_init_group(
static inline void posix_cpu_timers_init_group(struct signal_struct *sig) { }
#endif
+void kpatch_foo(void)
+{
+ if (!jiffies)
+ printk("kpatch copy signal\n");
+}
+
static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
{
struct signal_struct *sig;
+ kpatch_foo();
+
if (clone_flags & CLONE_THREAD)
return 0;

View File

@ -1,15 +0,0 @@
ensure __jump_table is parsed and we can tell that it effectively didn't change
diff -Nupr src.orig/kernel/time/timer.c src/kernel/time/timer.c
--- src.orig/kernel/time/timer.c 2017-11-17 15:58:51.501211972 -0500
+++ src/kernel/time/timer.c 2017-11-17 15:59:42.654211972 -0500
@@ -1643,6 +1643,9 @@ static __latent_entropy void run_timer_s
*/
base->must_forward_clk = false;
+ if (!base)
+ printk("kpatch-test: testing __tracepoints section changes\n");
+
__run_timers(base);
if (IS_ENABLED(CONFIG_NO_HZ_COMMON) && base->nohz_active)
__run_timers(this_cpu_ptr(&timer_bases[BASE_DEF]));