Skip to content

Commit

Permalink
[nozzle] be more explicit on function naming (part 2)
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Jan 19, 2018
1 parent 4ee5fb7 commit 58dc341
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions libnozzle/tests/nozzle_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ static int check_knet_mtu_ipv6(void)
#ifdef KNET_BSD
"ifconfig %s | grep -q %s", nozzle->name, testipv6_1);
#endif
err = execute_shell_command(verifycmd, &error_string);
err = execute_bin_sh_command(verifycmd, &error_string);
if (error_string) {
printf("Error string: %s\n", error_string);
free(error_string);
Expand All @@ -471,7 +471,7 @@ static int check_knet_mtu_ipv6(void)
goto out_clean;
}

err = execute_shell_command(verifycmd, &error_string);
err = execute_bin_sh_command(verifycmd, &error_string);
if (error_string) {
printf("Error string: %s\n", error_string);
free(error_string);
Expand Down Expand Up @@ -509,7 +509,7 @@ static int check_knet_mtu_ipv6(void)
#ifdef KNET_BSD
"ifconfig %s | grep -q %s", nozzle->name, testipv6_2);
#endif
err = execute_shell_command(verifycmd, &error_string);
err = execute_bin_sh_command(verifycmd, &error_string);
if (error_string) {
printf("Error string: %s\n", error_string);
free(error_string);
Expand Down Expand Up @@ -540,7 +540,7 @@ static int check_knet_mtu_ipv6(void)
#ifdef KNET_BSD
"ifconfig %s | grep -q %s", nozzle->name, testipv6_1);
#endif
err = execute_shell_command(verifycmd, &error_string);
err = execute_bin_sh_command(verifycmd, &error_string);
if (error_string) {
printf("Error string: %s\n", error_string);
free(error_string);
Expand All @@ -560,7 +560,7 @@ static int check_knet_mtu_ipv6(void)
#ifdef KNET_BSD
"ifconfig %s | grep -q %s", nozzle->name, testipv6_2);
#endif
err = execute_shell_command(verifycmd, &error_string);
err = execute_bin_sh_command(verifycmd, &error_string);
if (error_string) {
printf("Error string: %s\n", error_string);
free(error_string);
Expand Down Expand Up @@ -705,19 +705,19 @@ static int check_knet_mac(void)
return err;
}

static int check_nozzle_execute_shell_command(void)
static int check_nozzle_execute_bin_sh_command(void)
{
int err = 0;
char command[4096];
char *error_string = NULL;

memset(command, 0, sizeof(command));

printf("Testing execute_shell_command\n");
printf("Testing execute_bin_sh_command\n");

printf("command true\n");

err = execute_shell_command("true", &error_string);
err = execute_bin_sh_command("true", &error_string);
if (error_string) {
printf("Error string: %s\n", error_string);
free(error_string);
Expand All @@ -732,7 +732,7 @@ static int check_nozzle_execute_shell_command(void)

printf("command false\n");

err = execute_shell_command("false", &error_string);
err = execute_bin_sh_command("false", &error_string);
if (error_string) {
printf("Error string: %s\n", error_string);
free(error_string);
Expand All @@ -746,7 +746,7 @@ static int check_nozzle_execute_shell_command(void)

printf("command that outputs to stdout (enforcing redirect)\n");

err = execute_shell_command("grep -h 2>&1", &error_string);
err = execute_bin_sh_command("grep -h 2>&1", &error_string);
if (error_string) {
printf("Error string: %s\n", error_string);
free(error_string);
Expand All @@ -759,7 +759,7 @@ static int check_nozzle_execute_shell_command(void)
}

printf("command that outputs to stderr\n");
err = execute_shell_command("grep -h", &error_string);
err = execute_bin_sh_command("grep -h", &error_string);
if (error_string) {
printf("Error string: %s\n", error_string);
free(error_string);
Expand All @@ -772,7 +772,7 @@ static int check_nozzle_execute_shell_command(void)
}

printf("empty command\n");
err = execute_shell_command(NULL, &error_string);
err = execute_bin_sh_command(NULL, &error_string);
if (error_string) {
printf("Error string: %s\n", error_string);
free(error_string);
Expand All @@ -785,7 +785,7 @@ static int check_nozzle_execute_shell_command(void)
}

printf("empty error\n");
err = execute_shell_command("true", NULL);
err = execute_bin_sh_command("true", NULL);
if (!err) {
printf("Check EINVAL filter for no error_string!\n");
err = -1;
Expand Down Expand Up @@ -846,7 +846,7 @@ static int check_knet_up_down(void)
#ifdef KNET_BSD
"ifconfig %s | grep -q UP", nozzle->name);
#endif
err = execute_shell_command(verifycmd, &error_string);
err = execute_bin_sh_command(verifycmd, &error_string);
if (error_string) {
printf("Error string: %s\n", error_string);
free(error_string);
Expand Down Expand Up @@ -885,7 +885,7 @@ static int check_knet_up_down(void)
#ifdef KNET_BSD
"ifconfig %s | grep -q UP", nozzle->name);
#endif
err = execute_shell_command(verifycmd, &error_string);
err = execute_bin_sh_command(verifycmd, &error_string);
if (error_string) {
printf("Error string: %s\n", error_string);
free(error_string);
Expand Down Expand Up @@ -1231,7 +1231,7 @@ static int check_knet_set_del_ip(void)
#ifdef KNET_BSD
"ifconfig %s | grep -q %s", nozzle->name, testipv4_1);
#endif
err = execute_shell_command(verifycmd, &error_string);
err = execute_bin_sh_command(verifycmd, &error_string);
if (error_string) {
printf("Error string: %s\n", error_string);
free(error_string);
Expand Down Expand Up @@ -1315,7 +1315,7 @@ static int check_knet_set_del_ip(void)
#ifdef KNET_BSD
"ifconfig %s | grep -q %s", nozzle->name, testipv4_1);
#endif
err = execute_shell_command(verifycmd, &error_string);
err = execute_bin_sh_command(verifycmd, &error_string);
if (error_string) {
printf("Error string: %s\n", error_string);
free(error_string);
Expand Down Expand Up @@ -1349,7 +1349,7 @@ static int check_knet_set_del_ip(void)
#ifdef KNET_BSD
"ifconfig %s | grep -q %s", nozzle->name, testipv6_1);
#endif
err = execute_shell_command(verifycmd, &error_string);
err = execute_bin_sh_command(verifycmd, &error_string);
if (error_string) {
printf("Error string: %s\n", error_string);
free(error_string);
Expand Down Expand Up @@ -1383,7 +1383,7 @@ static int check_knet_set_del_ip(void)
#ifdef KNET_BSD
"ifconfig %s | grep -q %s", nozzle->name, testipv6_1);
#endif
err = execute_shell_command(verifycmd, &error_string);
err = execute_bin_sh_command(verifycmd, &error_string);
if (error_string) {
printf("Error string: %s\n", error_string);
free(error_string);
Expand Down Expand Up @@ -1491,7 +1491,7 @@ int main(void)
if (check_knet_mac() < 0)
return -1;

if (check_nozzle_execute_shell_command() < 0)
if (check_nozzle_execute_bin_sh_command() < 0)
return -1;

if (check_knet_up_down() < 0)
Expand Down

0 comments on commit 58dc341

Please sign in to comment.