Re: [PATCH] openvz: Add simple testcase for config file parsing function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/26/2011 12:06 PM, Matthias Bolte wrote:
> This testcase passes before the regression is added in f0443765, fails
> after that commit and passes again after the regression was fixed.
> ---
>  src/openvz/openvz_conf.c   |    2 +-
>  src/openvz/openvz_conf.h   |    1 +
>  tests/Makefile.am          |   18 +++++++++
>  tests/openvzutilstest.c    |   91 ++++++++++++++++++++++++++++++++++++++++++++
>  tests/openvzutilstest.conf |   41 ++++++++++++++++++++
>  5 files changed, 152 insertions(+), 1 deletions(-)
>  create mode 100644 tests/openvzutilstest.c
>  create mode 100644 tests/openvzutilstest.conf

More tests are always good.

> 
> diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
> index 3e4844a..3dc6b37 100644
> --- a/src/openvz/openvz_conf.c
> +++ b/src/openvz/openvz_conf.c
> @@ -645,7 +645,7 @@ openvzWriteVPSConfigParam(int vpsid, const char *param, const char *value)
>   *
>   * Returns <0 on error, 0 if not found, 1 if found.
>   */
> -static int
> +int
>  openvzReadConfigParam(const char *conf_file, const char *param, char **value)

Will this work with './configure --with-driver-modules', or do we also
need to add it to some libvirt_xxx.syms somewhere?

[Speaking of --with-driver-modules, it's not working for me at the
moment, so that's something we should probably try to address before
0.9.2 if possible]

> +#else
> +
> +int main(void)
> +{
> +    return 77; /* means 'test skipped' for automake */

s/77/EXIT_AM_SKIP/ from testutils.h, to avoid a magic number.

ACK with that nit fixed.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]