summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSebastian Holmin <sebastian.holmin@mullvad.net>2024-07-22 15:33:38 +0200
committerSebastian Holmin <sebastian.holmin@mullvad.net>2024-08-16 11:19:07 +0200
commit4c0648d8843706f3c5add5464bc4e9de89e86666 (patch)
tree3c93531ae65a184dfbe816d79ee24d3d84942f8f
parent4c137b49c33890193356d17cc085888bd74e7442 (diff)
downloadmullvadvpn-4c0648d8843706f3c5add5464bc4e9de89e86666.tar.xz
mullvadvpn-4c0648d8843706f3c5add5464bc4e9de89e86666.zip
Improve logs and reduce verbosity
Co-authored-by: Markus Pettersson <markus.pettersson@mullvad.net>
-rw-r--r--test/scripts/ssh-setup.sh3
-rw-r--r--test/test-manager/src/network_monitor.rs4
-rw-r--r--test/test-manager/src/run_tests.rs2
-rw-r--r--test/test-manager/src/tests/account.rs2
-rw-r--r--test/test-manager/src/tests/helpers.rs6
-rw-r--r--test/test-manager/src/vm/mod.rs4
-rw-r--r--test/test-manager/src/vm/provision.rs27
7 files changed, 26 insertions, 22 deletions
diff --git a/test/scripts/ssh-setup.sh b/test/scripts/ssh-setup.sh
index 41131169e0..714756f45e 100644
--- a/test/scripts/ssh-setup.sh
+++ b/test/scripts/ssh-setup.sh
@@ -17,7 +17,7 @@ echo "Copying test-runner to $RUNNER_DIR"
mkdir -p "$RUNNER_DIR"
for file in test-runner connection-checker $APP_PACKAGE $PREVIOUS_APP $UI_RUNNER; do
- echo "Moving $file to $RUNNER_DIR"
+ echo "Moving $SCRIPT_DIR/$file to $RUNNER_DIR"
cp -f "$SCRIPT_DIR/$file" "$RUNNER_DIR"
done
@@ -106,6 +106,7 @@ fi
setup_systemd
function install_packages_apt {
+ echo "Installing required apt packages"
apt update
apt install -yf xvfb wireguard-tools curl
curl -fsSL https://get.docker.com | sh
diff --git a/test/test-manager/src/network_monitor.rs b/test/test-manager/src/network_monitor.rs
index 1a5ef5e463..28bcce23c1 100644
--- a/test/test-manager/src/network_monitor.rs
+++ b/test/test-manager/src/network_monitor.rs
@@ -98,7 +98,7 @@ impl Codec {
payload = seg.payload().to_vec();
}
IpHeaderProtocols::Icmp => {}
- proto => log::debug!("ignoring v4 packet, transport/protocol type {proto}"),
+ proto => log::warn!("ignoring v4 packet, transport/protocol type {proto}"),
}
Some(ParsedPacket {
@@ -140,7 +140,7 @@ impl Codec {
payload = seg.payload().to_vec();
}
IpHeaderProtocols::Icmpv6 => {}
- proto => log::debug!("ignoring v6 packet, transport/protocol type {proto}"),
+ proto => log::warn!("ignoring v6 packet, transport/protocol type {proto}"),
}
Some(ParsedPacket {
diff --git a/test/test-manager/src/run_tests.rs b/test/test-manager/src/run_tests.rs
index 04f72d575a..9b6bc7d721 100644
--- a/test/test-manager/src/run_tests.rs
+++ b/test/test-manager/src/run_tests.rs
@@ -30,7 +30,7 @@ pub async fn run(
let pty_path = instance.get_pty();
- log::info!("Connecting to {pty_path}");
+ log::debug!("Connecting to {pty_path}");
let serial_stream =
tokio_serial::SerialStream::open(&tokio_serial::new(pty_path, BAUD)).unwrap();
diff --git a/test/test-manager/src/tests/account.rs b/test/test-manager/src/tests/account.rs
index 7b1f83cfac..d0271a007f 100644
--- a/test/test-manager/src/tests/account.rs
+++ b/test/test-manager/src/tests/account.rs
@@ -289,7 +289,7 @@ async fn get_current_wireguard_key(
/// Remove all devices on the current account
pub async fn clear_devices(device_client: &DevicesProxy) -> anyhow::Result<()> {
- log::info!("Removing all devices for account");
+ log::debug!("Removing all devices for account");
for dev in list_devices_with_retries(device_client).await?.into_iter() {
if let Err(error) = device_client
diff --git a/test/test-manager/src/tests/helpers.rs b/test/test-manager/src/tests/helpers.rs
index cde1176781..5dba49665c 100644
--- a/test/test-manager/src/tests/helpers.rs
+++ b/test/test-manager/src/tests/helpers.rs
@@ -306,6 +306,7 @@ pub fn get_interface_index(interface: &str) -> anyhow::Result<std::ffi::c_uint>
pub async fn login_with_retries(
mullvad_client: &mut MullvadProxyClient,
) -> Result<(), mullvad_management_interface::Error> {
+ log::debug!("Logging in/generating device");
loop {
match mullvad_client
.login_account(TEST_CONFIG.account_number.clone())
@@ -339,6 +340,7 @@ pub async fn ensure_logged_in(
if mullvad_client.get_device().await?.is_logged_in() {
return Ok(());
}
+ log::info!("Current device not logged in. Clearing devices and logging in.");
// We are apparently not logged in already.. Try to log in.
login_with_retries(mullvad_client).await
}
@@ -375,7 +377,7 @@ pub async fn connect_and_wait(
}
pub async fn disconnect_and_wait(mullvad_client: &mut MullvadProxyClient) -> Result<(), Error> {
- log::info!("Disconnecting");
+ log::debug!("Disconnecting");
mullvad_client.disconnect_tunnel().await?;
wait_for_tunnel_state(mullvad_client.clone(), |state| {
@@ -383,7 +385,7 @@ pub async fn disconnect_and_wait(mullvad_client: &mut MullvadProxyClient) -> Res
})
.await?;
- log::info!("Disconnected");
+ log::debug!("Disconnected");
Ok(())
}
diff --git a/test/test-manager/src/vm/mod.rs b/test/test-manager/src/vm/mod.rs
index 49c09da6f9..591aa095c2 100644
--- a/test/test-manager/src/vm/mod.rs
+++ b/test/test-manager/src/vm/mod.rs
@@ -37,7 +37,7 @@ pub async fn set_config(config: &mut ConfigFile, vm_name: &str, vm_config: VmCon
pub async fn run(config: &Config, name: &str) -> Result<Box<dyn VmInstance>> {
let vm_conf = get_vm_config(config, name)?;
- log::info!("Starting \"{name}\"");
+ log::info!("Starting VM \"{name}\"");
let instance = match vm_conf.vm_type {
VmType::Qemu => Box::new(
@@ -55,7 +55,7 @@ pub async fn run(config: &Config, name: &str) -> Result<Box<dyn VmInstance>> {
VmType::Tart => return Err(anyhow::anyhow!("Failed to run Tart VM on a non-macOS host")),
};
- log::info!("Started instance of \"{name}\" vm");
+ log::debug!("Started instance of \"{name}\" vm");
Ok(instance)
}
diff --git a/test/test-manager/src/vm/provision.rs b/test/test-manager/src/vm/provision.rs
index e5786b54d7..143f023fa4 100644
--- a/test/test-manager/src/vm/provision.rs
+++ b/test/test-manager/src/vm/provision.rs
@@ -107,27 +107,28 @@ fn blocking_ssh(
// Transfer a test runner
let source = local_runner_dir.join("test-runner");
- ssh_send_file(&session, &source, temp_dir).context("Failed to send test runner to remote")?;
+ ssh_send_file(&session, &source, temp_dir)
+ .with_context(|| format!("Failed to send '{source:?}' to remote"))?;
// Transfer connection-checker
let source = local_runner_dir.join("connection-checker");
ssh_send_file(&session, &source, temp_dir)
- .context("Failed to send connection-checker to remote")?;
+ .with_context(|| format!("Failed to send '{source:?}' to remote"))?;
// Transfer app packages
- ssh_send_file(&session, &local_app_manifest.app_package_path, temp_dir)
- .context("Failed to send current app package to remote")?;
- if let Some(app_package_to_upgrade_from_path) =
- &local_app_manifest.app_package_to_upgrade_from_path
- {
- ssh_send_file(&session, app_package_to_upgrade_from_path, temp_dir)
- .context("Failed to send previous app package to remote")?;
+ let source = &local_app_manifest.app_package_path;
+ ssh_send_file(&session, source, temp_dir)
+ .with_context(|| format!("Failed to send '{source:?}' to remote"))?;
+
+ if let Some(source) = &local_app_manifest.app_package_to_upgrade_from_path {
+ ssh_send_file(&session, source, temp_dir)
+ .with_context(|| format!("Failed to send '{source:?}' to remote"))?;
} else {
- log::warn!("No previous app to send to remote")
+ log::warn!("No previous app package to upgrade from to send to remote")
}
- if let Some(gui_package_path) = &local_app_manifest.gui_package_path {
- ssh_send_file(&session, gui_package_path, temp_dir)
- .context("Failed to send gui_package_path to remote")?;
+ if let Some(source) = &local_app_manifest.gui_package_path {
+ ssh_send_file(&session, source, temp_dir)
+ .with_context(|| format!("Failed to send '{source:?}' to remote"))?;
} else {
log::warn!("No UI e2e test to send to remote")
}