tst_kvcmp: Add support for extra kernel versions

This adds support for extra kernel versions to the tst_kvcmp shell
helper.

Now we can append the extra version(s) after the generic kernel version
in the expression. For example to check for older kernel than
3.0 or in case of RHEL6 older than 2.6.32-77 we do:

tst_kvcmp -lt '3.0 RHEL6:2.6.32-77'

This commit also reduces the number of uname() syscalls needed to
acquire the result as a side efect.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Acked-by: Jan Stancek <jstancek@redhat.com>
diff --git a/include/tst_kvercmp.h b/include/tst_kvercmp.h
index 6b0414a..1349976 100644
--- a/include/tst_kvercmp.h
+++ b/include/tst_kvercmp.h
@@ -35,13 +35,27 @@
 #define TST_KVERCMP_H__
 
 /*
- * Parse string kernel version into three integers.
- *
- * If version has only two numbers, i.e. 2.4 the third integer is set to zero.
+ * The same as tst_kvercmp() but running kernel version is passed as parameter
+ * instead of utilizing uname().
+ */
+int tst_kvcmp(const char *cur_kver, int r1, int r2, int r3);
+
+/*
+ * Parsers string into three integer version.
  */
 int tst_parse_kver(const char *str_kver, int *v1, int *v2, int *v3);
 
 /*
+ * Returns distribution name parsed from kernel version string or NULL.
+ */
+const char *tst_kvcmp_distname(const char *cur_kver);
+
+/*
+ * Compares versions up to five version numbers long.
+ */
+int tst_kvexcmp(const char *tst_exv, const char *cur_kver);
+
+/*
  * Compare given kernel version with currently running kernel.
  *
  * Returns negative if older, 0 if the smame and possitive if newer.