From 34b37c355aed28aae86c6bfb79bd4bf7c9f65911 Mon Sep 17 00:00:00 2001 From: Andreas Hasenack Date: Tue, 17 Oct 2023 10:12:39 -0300 Subject: [PATCH] global replace for /tmp/ files to /var/lib/ubuntu-advantage --- features/apt_messages.feature | 2 +- features/attached_commands.feature | 16 ++++++++-------- features/attached_enable.feature | 2 +- features/attached_status.feature | 4 ++-- features/i18n.feature | 6 +++--- features/motd_messages.feature | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/features/apt_messages.feature b/features/apt_messages.feature index 98569f7401..4790e3e909 100644 --- a/features/apt_messages.feature +++ b/features/apt_messages.feature @@ -653,7 +653,7 @@ Feature: APT Messages """ "*Your Ubuntu Pro subscription has EXPIRED*\nRenew your service at https://ubuntu.com/pro/dashboard" """ - When I create the file `/tmp/machine-token-overlay.json` with the following: + When I create the file `/var/lib/ubuntu-advantage/machine-token-overlay.json` with the following: """ { "machineTokenInfo": { diff --git a/features/attached_commands.feature b/features/attached_commands.feature index f619e80abf..6dabcaac29 100644 --- a/features/attached_commands.feature +++ b/features/attached_commands.feature @@ -318,7 +318,7 @@ Feature: Command behaviour when attached to an Ubuntu Pro subscription @uses.config.machine_type.lxd-container Scenario Outline: Attached status in a ubuntu machine with feature overrides Given a `` machine with ubuntu-advantage-tools installed - When I create the file `/tmp/machine-token-overlay.json` with the following: + When I create the file `/var/lib/ubuntu-advantage/machine-token-overlay.json` with the following: """ { "machineTokenInfo": { @@ -336,7 +336,7 @@ Feature: Command behaviour when attached to an Ubuntu Pro subscription And I append the following on uaclient config: """ features: - machine_token_overlay: "/tmp/machine-token-overlay.json" + machine_token_overlay: "/var/lib/ubuntu-advantage/machine-token-overlay.json" disable_auto_attach: true other: false """ @@ -352,7 +352,7 @@ Feature: Command behaviour when attached to an Ubuntu Pro subscription """ FEATURES disable_auto_attach: True - machine_token_overlay: /tmp/machine-token-overlay.json + machine_token_overlay: /var/lib/ubuntu-advantage/machine-token-overlay.json other: False """ When I run `pro status --all` as non-root @@ -366,7 +366,7 @@ Feature: Command behaviour when attached to an Ubuntu Pro subscription """ FEATURES disable_auto_attach: True - machine_token_overlay: /tmp/machine-token-overlay.json + machine_token_overlay: /var/lib/ubuntu-advantage/machine-token-overlay.json other: False """ When I run `pro detach --assume-yes` with sudo @@ -782,7 +782,7 @@ Feature: Command behaviour when attached to an Ubuntu Pro subscription Then I verify that `activityInfo.activityToken` value has been updated on the contract And I verify that `activityInfo.activityID` value has been updated on the contract # We are keeping this test to guarantee that the activityPingInterval is also updated - When I create the file `/tmp/machine-token-overlay.json` with the following: + When I create the file `/var/lib/ubuntu-advantage/machine-token-overlay.json` with the following: """ { "machineTokenInfo": { @@ -793,7 +793,7 @@ Feature: Command behaviour when attached to an Ubuntu Pro subscription } } """ - And I create the file `/tmp/response-overlay.json` with the following: + And I create the file `/var/lib/ubuntu-advantage/response-overlay.json` with the following: """ { "https://contracts.canonical.com/v1/contracts/testCID/machine-activity/testMID": [ @@ -810,8 +810,8 @@ Feature: Command behaviour when attached to an Ubuntu Pro subscription And I append the following on uaclient config: """ features: - machine_token_overlay: "/tmp/machine-token-overlay.json" - serviceclient_url_responses: "/tmp/response-overlay.json" + machine_token_overlay: "/var/lib/ubuntu-advantage/machine-token-overlay.json" + serviceclient_url_responses: "/var/lib/ubuntu-advantage/response-overlay.json" """ When I delete the file `/var/lib/ubuntu-advantage/jobs-status.json` And I run `python3 /usr/lib/ubuntu-advantage/timer.py` with sudo diff --git a/features/attached_enable.feature b/features/attached_enable.feature index 6002838576..a9f1209e1f 100644 --- a/features/attached_enable.feature +++ b/features/attached_enable.feature @@ -94,7 +94,7 @@ Feature: Enable command behaviour when attached to an Ubuntu Pro subscription One moment, checking your subscription first Ubuntu Pro: ESM Infra is not available for Ubuntu .* """ - When I create the file `/tmp/machine-token-overlay.json` with the following: + When I create the file `/var/lib/ubuntu-advantage/machine-token-overlay.json` with the following: """ { "machineTokenInfo": { diff --git a/features/attached_status.feature b/features/attached_status.feature index ae962593c8..c5b9876adb 100644 --- a/features/attached_status.feature +++ b/features/attached_status.feature @@ -11,7 +11,7 @@ Feature: Attached status When I run `pro status --format yaml` as non-root Then stdout is a yaml matching the `ua_status` schema - When I create the file `/tmp/machine-token-overlay.json` with the following: + When I create the file `/var/lib/ubuntu-advantage/machine-token-overlay.json` with the following: """ { "machineTokenInfo": { @@ -24,7 +24,7 @@ Feature: Attached status And I append the following on uaclient config: """ features: - machine_token_overlay: "/tmp/machine-token-overlay.json" + machine_token_overlay: "/var/lib/ubuntu-advantage/machine-token-overlay.json" """ And I run `pro status` with sudo Then stdout contains substring: diff --git a/features/i18n.feature b/features/i18n.feature index 6fb938ab1a..71a6650456 100644 --- a/features/i18n.feature +++ b/features/i18n.feature @@ -126,7 +126,7 @@ Feature: Pro supports multiple languages Then stdout is a json matching the `ua_status` schema When I run `pro status --format yaml` as non-root Then stdout is a yaml matching the `ua_status` schema - When I create the file `/tmp/machine-token-overlay.json` with the following: + When I create the file `/var/lib/ubuntu-advantage/machine-token-overlay.json` with the following: """ { "machineTokenInfo": { @@ -139,7 +139,7 @@ Feature: Pro supports multiple languages And I append the following on uaclient config: """ features: - machine_token_overlay: "/tmp/machine-token-overlay.json" + machine_token_overlay: "/var/lib/ubuntu-advantage/machine-token-overlay.json" """ And I run `pro status` with sudo Then stdout contains substring: @@ -163,7 +163,7 @@ Feature: Pro supports multiple languages """ {\"_schema_version\": \"v1\", \"data\": {\"attributes\": {\"installed_version\": \".*\"}, \"meta\": {\"environment_vars\": \[]}, \"type\": \"Version\"}, \"errors\": \[], \"result\": \"success\", \"version\": \".*\", \"warnings\": \[]} """ - When I run `UA_LOG_FILE=/tmp/some_file OTHER_ENVVAR=not_there pro api u.pro.version.v1` with sudo + When I run `UA_LOG_FILE=/var/lib/ubuntu-advantage/some_file OTHER_ENVVAR=not_there pro api u.pro.version.v1` with sudo Then stdout matches regexp: """ {\"_schema_version\": \"v1\", \"data\": {\"attributes\": {\"installed_version\": \".*\"}, \"meta\": {\"environment_vars\": \[{\"name\": \"UA_LOG_FILE\", \"value\": \"\/tmp\/some_file\"}]}, \"type\": \"Version\"}, \"errors\": \[], \"result\": \"success\", \"version\": \".*\", \"warnings\": \[]} diff --git a/features/motd_messages.feature b/features/motd_messages.feature index 98020e6404..14a0a7096e 100644 --- a/features/motd_messages.feature +++ b/features/motd_messages.feature @@ -125,7 +125,7 @@ Feature: MOTD Messages Renew your service at https:\/\/ubuntu.com\/pro\/dashboard """ - When I create the file `/tmp/machine-token-overlay.json` with the following: + When I create the file `/var/lib/ubuntu-advantage/machine-token-overlay.json` with the following: """ { "machineTokenInfo": {