History log of /external/ltp/lib/tst_kvercmp.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
882f45a8e9d321ca108495517e25778a518eb58c 21-Apr-2017 Cyril Hrubis <chrubis@suse.cz> 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>
/external/ltp/lib/tst_kvercmp.c
4dcfd2865dd42f62d52f3930ea4abfcef41fbaf5 01-Nov-2016 Cyril Hrubis <chrubis@suse.cz> lib: Add new tst_kvcmp for shell

Add tst_kvcmp inspired by the shell test syntax.

Now we can write the kernel version checks as:

if tst_kvcmp -ge 3.8.0 -a -le 4.3.2; then
tst_brk TCONF "Needs kernel older than 3.8.0 or newer than 4.3.2"
fi

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
/external/ltp/lib/tst_kvercmp.c
9c74eef6a3e728e5f39b1683f491f2ed3e7f3df8 04-Feb-2016 Cyril Hrubis <chrubis@suse.cz> lib: tst_kvercmp: Move defs to separate header

* Move definitions to separate header
(so that we can reuse them in new library)

* Remove nonexisting function prototype tst_getkver()

* Add tst_parse_kver() (to be used later in newlib)

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
/external/ltp/lib/tst_kvercmp.c
cd5983de92184a317a7923630b58ad12ca740584 01-Oct-2014 Cyril Hrubis <chrubis@suse.cz> tst_kvercmp: Do not segfault on short release number

Debian testing (jessie) has "3.14-2-amd' in the release string and
because of that all testcases that call tst_kvercmp() segfaults in
atoi(NULL).

So if there is no third number in the version string, we now assume
(possibly incorrectly) that it's zero. But at least these testcases runs
fine there.

There seems to be three number version as a part of the uname.version
string there but parsing that seems to be even more fragile.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
/external/ltp/lib/tst_kvercmp.c
b217b3ead51fa07d61455fb868db97ae0c732b02 09-Oct-2013 Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com> tst_kvercmp2: Criteria for Oracle Linux UEK kernels

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Acked-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
/external/ltp/lib/tst_kvercmp.c
e94c67a392b6c68721464416712dcdfe50895fc7 01-Aug-2013 Cyril Hrubis <metan@ucw.cz> Revert "lib/tst_kvercmp: fixed a compiling error"

This reverts commit 793ba8a8f6fbf024ff64b88f2669e75a3f5e1e94.

It's no longer needed after the tests were fixed.

Signed-off-by: Cyril Hrubis <metan@ucw.cz>
/external/ltp/lib/tst_kvercmp.c
e323edcc33d30d39a4f277f666d38b2ecda0b7fb 23-Jul-2013 Wanlong Gao <gaowanlong@cn.fujitsu.com> lib: fix a NULL pointer caused error

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
/external/ltp/lib/tst_kvercmp.c
793ba8a8f6fbf024ff64b88f2669e75a3f5e1e94 23-Jul-2013 Zhouping Liu <zliu@redhat.com> lib/tst_kvercmp: fixed a compiling error

commit 18f7be7eb introduced the following compiling error:

make[1]: Leaving directory `/mnt/tests/kernel/distribution/ltp/git_test/ltp/testcases/kernel/containers/libclone'
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -I../../../include -I../../../include -L../../../lib check_for_unshare.c -ldl -lltp -o check_for_unshare
check_for_unshare.c: In function ‘main’:
check_for_unshare.c:35:8: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
void *ret;
^
../../../lib/libltp.a(tst_res.o): In function `cat_file':
/mnt/tests/kernel/distribution/ltp/git_test/ltp/lib/tst_res.c:777: undefined reference to `TCID'
/mnt/tests/kernel/distribution/ltp/git_test/ltp/lib/tst_res.c:787: undefined reference to `TCID'
/mnt/tests/kernel/distribution/ltp/git_test/ltp/lib/tst_res.c:795: undefined reference to `TCID'
../../../lib/libltp.a(tst_res.o): In function `tst_res':
/mnt/tests/kernel/distribution/ltp/git_test/ltp/lib/tst_res.c:301: undefined reference to `TCID'
/mnt/tests/kernel/distribution/ltp/git_test/ltp/lib/tst_res.c:317: undefined reference to `TCID'
../../../lib/libltp.a(tst_res.o):/mnt/tests/kernel/distribution/ltp/git_test/ltp/lib/tst_res.c:370: more undefined references to `TCID' follow
collect2: error: ld returned 1 exit status
make: *** [check_for_unshare] Error 1

that's because commit 18f7be7eb used LTP lib function tst_resm(), using printf() instead can avoid it.

Signed-off-by: Zhouping Liu <zliu@redhat.com>
Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
/external/ltp/lib/tst_kvercmp.c
18f7be7eb088990ce86b1e5b4f06e00fb07560fc 16-Jul-2013 Wanlong Gao <gaowanlong@cn.fujitsu.com> lib: let tst_kvercmp2() contains major kernel version

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
/external/ltp/lib/tst_kvercmp.c
ef73cc93a9fd39134ea8e213fdf6f1be4e5004a5 09-Jul-2013 Wanlong Gao <gaowanlong@cn.fujitsu.com> lib: add tst_kvercmp2 to compare specific vendor extra kernel versions

We can now test specific verdor kernel versions in
test cases like:

static struct tst_kern_exv exv[] = {
{"RHEL6", "234"},
{"SLES10", "0.91"},
{NULL, NULL}
};

...

if (tst_kvercmp2(2, 6, 25, exv) < 0)
...
...

Thank you for Cyril's suggestion.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Reviewed-by: Caspar Zhang <caspar@casparzhang.com>
Reviewed-by: Jan Stancek <jstancek@redhat.com>
/external/ltp/lib/tst_kvercmp.c
354ebb48db8e66a853a58379a4808d5dcd1ceac3 07-Dec-2012 Wanlong Gao <gaowanlong@cn.fujitsu.com> cleanup code indent

Cleanup the code indent using:

find . -name *.c -exec Lindent {} \;

It's really a big change, but can fix almost all of
the indent problem in C code, although we can't
ensure all of the changes are right, but the error
changes are really few.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
/external/ltp/lib/tst_kvercmp.c
4548c6cf9bcdd96d8303caa4130ab638b61f8a30 19-Oct-2012 Wanlong Gao <gaowanlong@cn.fujitsu.com> Update FSF address

find . -type f -exec sed -i 's/675 Mass Ave, Cambridge, MA 02139, USA/51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA/g' {} \;
find . -type f -exec sed -i 's/59 Temple Place, Suite 330, Boston, MA 02111-1307 USA/51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA/g' {} \;

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
/external/ltp/lib/tst_kvercmp.c
ec6edca7aa42b6affd989ef91b5897f96795e40f 18-Oct-2012 Chris Dearman <chris@mips.com> Add missing newline at end of file

This is a scripted change done using the following command:

find . -type d -name .git -prune -o \
-type f \! -name \*\~ \! -name .\#\* \
\! -name \*.gz \! -name \*.pdf \! -name \*.patch -print0 | \
xargs -0 sed -i -e '$a\'

Signed-off-by: Chris Dearman <chris@mips.com>
/external/ltp/lib/tst_kvercmp.c
1e6f5a673655551de5734ff31ef48cd63b604e6d 19-Dec-2010 Garrett Cooper <yanegomi@gmail.com> Resolving all compile errors via a script

This may leave dupe calls to tst_exit in main, but those are easier
to deal (and much less) than no-compile scenarios.

As a side-effect, fix all trailing whitespace issues.

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
/external/ltp/lib/tst_kvercmp.c
45a8ba0302fa0632410b2f100f92701651dd7a0f 20-Jul-2009 vapier <vapier> trim trailing whitespace
/external/ltp/lib/tst_kvercmp.c
784a360e5a0bef99356962c0aedf784750e7bc27 03-Oct-2005 robbiew <robbiew> Applied patch from David Marlin:
I am working with LTP from a current CVS checkout. I am using Red Hat
Enterprise Linux AS release 3 (Taroon Update 5), kernel-2.4.21-32.EL,
and gcc-3.2.3.

When building, LTP I receive the following error message:

gcc -Wall -O2 -I../include -Wall -c -o tst_kvercmp.o tst_kvercmp.c
tst_kvercmp.c:44:22: macro "strsep" requires 2 arguments, but only 1 given
tst_kvercmp.c: In function `get_kver':
tst_kvercmp.c:44: error: 'strsep' redeclared as different kind of symbol
/usr/include/string.h:310: error: previous declaration of 'strsep' was here
tst_kvercmp.c:44: warning: unused variable `strsep'


In /usr/include/string.h I find:

#ifdef __USE_BSD
/* Return the next DELIM-delimited token from *STRINGP,
terminating it with a '\0', and update *STRINGP to point past it. */
extern char *strsep (char **__restrict __stringp,
__const char *__restrict __delim) __THROW;
#endif


In lib/tst_kvercmp.c I find:

extern char *strsep(); /* shut up some compilers */


From the CVS log it appears that this was added "to provide
compatibility of LTP with Solaris, HP-UX and AIX". If not needed for
Linux, it seems we could make this include conditional, i.e.,
!defined(linux).

Attached is a patch I used to work around this error.

Note: this error does not occur if I remove optimization (-O2) from the
CFLAGS.


Thank you,

d.marlin
/external/ltp/lib/tst_kvercmp.c
e6508f8343333b4fe0696cf354e5f0cd7a2289b6 04-Jan-2005 mridge <mridge> Porting changes to provide compatability of LTP with Solaris, HP-UX and AIX
/external/ltp/lib/tst_kvercmp.c
88e7b183e5584538b89721580ee81aa49bc731f4 13-Mar-2003 robbiew <robbiew> Applied Andreas Jaeger's patch:
<<<<<<<<<<<<<<<
Building current CVS I encountered a number of warning - some of them
show real bugs in the testsuite:

tst_kvercmp.c:51: warning: implicit declaration of function `atoi'
dummy.c:34: warning: implicit declaration of function `exit'
mmap2.c:101: warning: implicit declaration of function `memset'
mmap3.c:101: warning: implicit declaration of function `memset'
shm_test.c:290: warning: return type defaults to `int'
shm_test.c:217: warning: unsigned int format, pointer arg (arg 4)
shm_test.c:225: warning: unsigned int format, pointer arg (arg 4)
shm_test.c:385: warning: int format, long unsigned int arg (arg 3)
pthcli.c:58: warning: return type defaults to `int'
pthcli.c:70: warning: implicit declaration of function `writen'
pthcli.c:77: warning: implicit declaration of function `readline'
pthcli.c:95: warning: return type defaults to `int'
pthcli.c:105: warning: implicit declaration of function `exit'
pthcli.c:143: warning: passing arg 1 of `close' makes integer from pointer without a cast
pthcli.c:152: warning: passing arg 1 of `close' makes integer from pointer without a cast
pthserv.c:74: warning: implicit declaration of function `readline'
pthserv.c:87: warning: implicit declaration of function `writen'
pthserv.c:99: warning: return type defaults to `int'
pthserv.c:111: warning: implicit declaration of function `exit'
pthserv.c:174: warning: implicit declaration of function `close'

Please apply the appended patch,

Andreas
>>>>>>>>>>>>>>>
/external/ltp/lib/tst_kvercmp.c
878713c10f7c8226c6adfdb97e73d1312c88673b 03-Mar-2003 plars <plars> what was I smoking?
/external/ltp/lib/tst_kvercmp.c
255c352ff39a8de19b461646699d585ea2cabd88 03-Mar-2003 plars <plars> rename tst_kver to tst_kvercmp
/external/ltp/lib/tst_kvercmp.c