/* libguestfs generated file
* WARNING: THIS FILE IS GENERATED BY 'src/generator.ml'.
* ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
*
* Copyright (C) 2009 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include "guestfs.h"
static guestfs_h *g;
static int suppress_error = 0;
static void print_error (guestfs_h *g, void *data, const char *msg)
{
if (!suppress_error)
fprintf (stderr, "%s\n", msg);
}
static void print_strings (char * const * const argv)
{
int argc;
for (argc = 0; argv[argc] != NULL; ++argc)
printf ("\t%s\n", argv[argc]);
}
static int test_mount_0 (void)
{
/* InitEmpty for mount (0) */
{
int r;
suppress_error = 0;
r = guestfs_umount_all (g);
if (r == -1)
return -1;
}
{
int r;
suppress_error = 0;
r = guestfs_lvm_remove_all (g);
if (r == -1)
return -1;
}
/* TestOutput for mount (0) */
{
char *lines[] = {
",",
NULL
};
int r;
suppress_error = 0;
r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
if (r == -1)
return -1;
}
{
int r;
suppress_error = 0;
r = guestfs_mkfs (g, "ext2", "/dev/sda1");
if (r == -1)
return -1;
}
{
int r;
suppress_error = 0;
r = guestfs_mount (g, "/dev/sda1", "/");
if (r == -1)
return -1;
}
{
int r;
suppress_error = 0;
r = guestfs_write_file (g, "/new", "new file contents", 0);
if (r == -1)
return -1;
}
{
char *r;
suppress_error = 0;
r = guestfs_cat (g, "/new");
if (r == NULL)
|