Example #1
0
int
main(int argc, char **argv)
{
int	result = 0;
char	*home, buf[1024];

	/* Unlink any existing password file before running this test */
	
	sprintf(buf, "%s/passwd", get_datadir());
    if(!is_valid_posix_path(buf))
        exit(1);
	if (strcmp(buf, "/etc/passwd") != 0)
		unlink(buf);

	result += test1();
	result += test2();
	result += test3();
	result += test4();
	result += test5();

    /* Add the default user back so other tests can use it */
    admin_add_user("admin", "mariadb");

	exit(result);
}
Example #2
0
int
main(int argc, char **argv)
{
int	result = 0;
char	*home, buf[1024];

	/* Unlink any existing password file before running this test */
	if ((home = getenv("MAXSCALE_HOME")) == NULL || strlen(home) >= 1024)
		home =  "/usr/local/skysql";
	sprintf(buf, "%s/etc/passwd", home);
    if(!is_valid_posix_path(buf))
        exit(1);
	if (strcmp(buf, "/etc/passwd") != 0)
		unlink(buf);

	result += test1();
	result += test2();
	result += test3();
	result += test4();
	result += test5();

    /* Add the default user back so other tests can use it */
    admin_add_user("admin", "skysql");

	exit(result);
}