Changed the parameter for the network ping test
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Gregory Ballantine 2022-08-17 18:03:48 -04:00
parent 6fdc52b320
commit 9cd88d923d
2 changed files with 7 additions and 7 deletions

View File

@ -4,12 +4,12 @@ use std::{fs,process};
use crate::text;
// ping a host
pub fn ping_host(host: &str, count: &u16) {
println!("Pinging host {}, {} times.", host, count);
pub fn ping_host(address: &str, count: &u16) {
println!("Pinging host {}, {} times.", address, count);
// run the ping command
let output = process::Command::new("ping")
.arg(host)
.arg(address)
.arg(format!("-c {}", count))
.output()
.expect("Failed to execute command");

View File

@ -102,8 +102,8 @@ enum NetCommands {
// ping subcommand
#[clap(name = "ping", about = "Ping a host to determine network latency.")]
Ping {
#[clap(short = 't', long, default_value_t = String::from("8.8.8.8"))]
host: String,
#[clap(short = 'a', long, default_value_t = String::from("8.8.8.8"))]
address: String,
#[clap(short = 'c', long, default_value_t = 30)]
count: u16,
},
@ -155,10 +155,10 @@ fn main() {
}
Commands::Net(args) => match &args.net_commands {
NetCommands::Ping { host, count } => {
NetCommands::Ping { address, count } => {
for i in 0..cli.loopcount {
println!("Test run number {}.", i + 1);
benchmarks::network::ping_host(host, count);
benchmarks::network::ping_host(address, count);
}
},
NetCommands::Bandwidth { download, output } => {