diff -Nru ubuntu-advantage-tools-27.9~18.04.1/apt-hook/hook.cc ubuntu-advantage-tools-27.10.1~18.04.1/apt-hook/hook.cc --- ubuntu-advantage-tools-27.9~18.04.1/apt-hook/hook.cc 2022-04-01 13:27:46.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/apt-hook/hook.cc 2022-07-12 18:09:51.000000000 +0000 @@ -24,6 +24,7 @@ #include #include +#include #include #include #include diff -Nru ubuntu-advantage-tools-27.9~18.04.1/apt-hook/json-hook.cc ubuntu-advantage-tools-27.10.1~18.04.1/apt-hook/json-hook.cc --- ubuntu-advantage-tools-27.9~18.04.1/apt-hook/json-hook.cc 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/apt-hook/json-hook.cc 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,296 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "json-hook.hh" + +bool read_jsonrpc_request(std::istream &in, jsonrpc_request &req) { + std::string msg_line; + std::string empty_line; + getline(in, msg_line); + getline(in, empty_line); + json_object *msg = json_tokener_parse(msg_line.c_str()); + json_object *tmp; + bool has_key = false; + + has_key = json_object_object_get_ex(msg, "jsonrpc", &tmp); + if (!has_key) { + json_object_put(msg); + return false; + } + std::string msg_jsonrpc_version(json_object_get_string(tmp)); + if (msg_jsonrpc_version != "2.0") { + json_object_put(msg); + return false; + } + + has_key = json_object_object_get_ex(msg, "method", &tmp); + if (!has_key) { + json_object_put(msg); + return false; + } + std::string msg_method(json_object_get_string(tmp)); + req.method = msg_method; + + has_key = json_object_object_get_ex(msg, "params", &tmp); + if (!has_key) { + json_object_put(msg); + return false; + } + req.params = tmp; + + has_key = json_object_object_get_ex(msg, "id", &tmp); + if (has_key) { + req.id = json_object_get_int64(tmp); + req.notification = false; + } else { + req.notification = true; + } + + req.root_msg = msg; + + return true; +} + +bool string_ends_with(std::string str, std::string ends_with) { + if (str.length() >= ends_with.length()) { + int result = ends_with.compare(0, ends_with.length(), str, str.length() - ends_with.length(), ends_with.length()); + return result == 0; + } + return false; +} + +bool version_from_origin_and_archive_ends_with(json_object *version, std::string from_origin, std::string archive_ends_with) { + bool has_key = false; + json_object *origins; + has_key = json_object_object_get_ex(version, "origins", &origins); + if (!has_key) { + return false; + } + int64_t origins_length = json_object_array_length(origins); + + for (int64_t i = 0; i < origins_length; i++) { + json_object *origin = json_object_array_get_idx(origins, i); + + json_object *tmp; + has_key = json_object_object_get_ex(origin, "origin", &tmp); + if (!has_key) { + continue; + } + std::string origin_origin(json_object_get_string(tmp)); + has_key = json_object_object_get_ex(origin, "archive", &tmp); + if (!has_key) { + continue; + } + std::string origin_archive(json_object_get_string(tmp)); + + if (origin_origin == from_origin && string_ends_with(origin_archive, archive_ends_with)) { + return true; + } + } + + return false; +} + +bool count_security_packages_from_apt_stats_json(json_object *stats, security_package_counts &result) { + bool has_key = false; + result.standard = 0; + result.esm_infra = 0; + result.esm_apps = 0; + + json_object *packages; + has_key = json_object_object_get_ex(stats, "packages", &packages); + if (!has_key) { + return false; + } + int64_t packages_length = json_object_array_length(packages); + + for (int64_t i = 0; i < packages_length; i++) { + json_object *package = json_object_array_get_idx(packages, i); + + json_object *tmp; + has_key = json_object_object_get_ex(package, "mode", &tmp); + if (!has_key) { + continue; + } + std::string package_mode(json_object_get_string(tmp)); + + if (package_mode == "upgrade") { + json_object *versions; + has_key = json_object_object_get_ex(package, "versions", &versions); + if (!has_key) { + continue; + } + + json_object *install; + has_key = json_object_object_get_ex(versions, "install", &install); + if (!has_key) { + continue; + } + + if (version_from_origin_and_archive_ends_with(install, "UbuntuESMApps", "-apps-security")) { + result.esm_apps += 1; + } else if (version_from_origin_and_archive_ends_with(install, "UbuntuESM", "-infra-security")) { + result.esm_infra += 1; + } else if (version_from_origin_and_archive_ends_with(install, "Ubuntu", "-security")) { + result.standard += 1; + } + } + } + + return true; +} + +std::string create_count_message(security_package_counts &counts) { + std::vector count_msgs; + bool wrote_security = false; + + if (counts.standard + counts.esm_infra + counts.esm_apps == 0) { + return ""; + } + + if (counts.standard > 0) { + std::stringstream ss; + ss << counts.standard << " standard security update"; + if (counts.standard != 1) { + ss << "s"; + } + count_msgs.push_back(ss.str()); + wrote_security = true; + } + if (counts.esm_infra > 0) { + std::stringstream ss; + ss << counts.esm_infra << " esm-infra "; + if (!wrote_security) { + ss << "security "; + } + ss << "update"; + if (counts.esm_infra != 1) { + ss << "s"; + } + count_msgs.push_back(ss.str()); + wrote_security = true; + } + if (counts.esm_apps > 0) { + std::stringstream ss; + ss << counts.esm_apps << " esm-apps "; + if (!wrote_security) { + ss << "security "; + } + ss << "update"; + if (counts.esm_apps != 1) { + ss << "s"; + } + count_msgs.push_back(ss.str()); + } + + std::stringstream message_ss; + for (uint i = 0; i < count_msgs.size(); i++) { + if (count_msgs.size() == 3) { + if (i == 1) { + message_ss << ", "; + } else if (i == 2) { + message_ss << " and "; + } + } else if (count_msgs.size() == 2) { + if (i == 1) { + message_ss << " and "; + } + } + message_ss << count_msgs[i]; + } + + return message_ss.str(); +} + +int run() +{ + char *fd_c_str = getenv("APT_HOOK_SOCKET"); + if (fd_c_str == NULL) { + std::cerr << "ua-hook: missing socket fd" << std::endl; + return 0; + } + std::string fd_str(fd_c_str); + if (fd_str == "") { + std::cerr << "ua-hook: empty socket fd" << std::endl; + return 0; + } + int fd = stoi(fd_str); + __gnu_cxx::stdio_filebuf apt_socket_in(fd, std::ios::in); + __gnu_cxx::stdio_filebuf apt_socket_out(fd, std::ios::out); + std::istream socket_in(&apt_socket_in); + std::ostream socket_out(&apt_socket_out); + + bool success = false; + + // Read hello message, verify version, and get jsonrpc id + jsonrpc_request hello_req; + success = read_jsonrpc_request(socket_in, hello_req); + if (!success) { + std::cerr << "ua-hook: failed to read hello msg" << std::endl; + return 0; + } + if (hello_req.method != "org.debian.apt.hooks.hello" || hello_req.notification) { + std::cerr << "ua-hook: invalid hello msg" << std::endl; + return 0; + } + + json_object *hello_req_versions; + success = json_object_object_get_ex(hello_req.params, "versions", &hello_req_versions); + if (!success) { + std::cerr << "ua-hook: hello msg missing versions" << std::endl; + return 0; + } + int64_t hello_req_versions_length = json_object_array_length(hello_req_versions); + + bool supports_version_02 = false; + for (int64_t i = 0; i < hello_req_versions_length; i++) { + std::string version(json_object_get_string(json_object_array_get_idx(hello_req_versions, i))); + if (version == "0.2") { + supports_version_02 = true; + break; + } + } + if (!supports_version_02) { + std::cerr << "ua-hook: apt doesn't support json hook version 0.2" << std::endl; + return 0; + } + + // Write hello response with jsonrpc id + socket_out << "{\"jsonrpc\":\"2.0\",\"id\":" << hello_req.id << ",\"result\":{\"version\":\"0.2\"}\n\n"; + socket_out.flush(); + + json_object_put(hello_req.root_msg); + + jsonrpc_request stats_req; + success = read_jsonrpc_request(socket_in, stats_req); + if (!success) { + std::cerr << "ua-hook: failed to read hook msg" << std::endl; + return 0; + } + if (stats_req.method == "org.debian.apt.hooks.install.statistics") { + security_package_counts counts; + success = count_security_packages_from_apt_stats_json(stats_req.params, counts); + if (success) { + std::string message = create_count_message(counts); + if (message != "") { + std::cout << message << std::endl; + } + } + } + json_object_put(stats_req.root_msg); + + jsonrpc_request bye_req; + success = read_jsonrpc_request(socket_in, bye_req); + if (!success) { + std::cerr << "ua-hook: failed to read bye msg" << std::endl; + return 0; + } + json_object_put(bye_req.root_msg); + + return 0; +} diff -Nru ubuntu-advantage-tools-27.9~18.04.1/apt-hook/json-hook.hh ubuntu-advantage-tools-27.10.1~18.04.1/apt-hook/json-hook.hh --- ubuntu-advantage-tools-27.9~18.04.1/apt-hook/json-hook.hh 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/apt-hook/json-hook.hh 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,22 @@ +#include +#include + +struct jsonrpc_request { + bool notification; + int64_t id; + json_object *root_msg; + std::string method; + json_object *params; +}; +struct security_package_counts { + int64_t standard; + int64_t esm_infra; + int64_t esm_apps; +}; + +bool read_jsonrpc_request(std::istream &in, jsonrpc_request &req); +bool string_ends_with(std::string str, std::string ends_with); +bool version_from_origin_and_archive_ends_with(json_object *version, std::string from_origin, std::string archive_ends_with); +bool count_security_packages_from_apt_stats_json(json_object *stats, security_package_counts &result); +std::string create_count_message(security_package_counts &counts); +int run(); diff -Nru ubuntu-advantage-tools-27.9~18.04.1/apt-hook/json-hook-main.cc ubuntu-advantage-tools-27.10.1~18.04.1/apt-hook/json-hook-main.cc --- ubuntu-advantage-tools-27.9~18.04.1/apt-hook/json-hook-main.cc 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/apt-hook/json-hook-main.cc 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,8 @@ +#include "json-hook.hh" + +int main(int argc, char *argv[]) +{ + (void) argc; + (void) argv; + return run(); +} diff -Nru ubuntu-advantage-tools-27.9~18.04.1/apt-hook/json-hook-src/go.mod ubuntu-advantage-tools-27.10.1~18.04.1/apt-hook/json-hook-src/go.mod --- ubuntu-advantage-tools-27.9~18.04.1/apt-hook/json-hook-src/go.mod 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/apt-hook/json-hook-src/go.mod 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -module json-hook - -go 1.7 diff -Nru ubuntu-advantage-tools-27.9~18.04.1/apt-hook/json-hook-src/json-hook.go ubuntu-advantage-tools-27.10.1~18.04.1/apt-hook/json-hook-src/json-hook.go --- ubuntu-advantage-tools-27.9~18.04.1/apt-hook/json-hook-src/json-hook.go 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/apt-hook/json-hook-src/json-hook.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,243 +0,0 @@ -package main - -import ( - "bufio" - "encoding/json" - "fmt" - "io" - "net" - "os" - "strconv" -) - -type jsonRPCPackageVersion struct { - Id int `json:"id"` - Version string `json:"version"` - Architecture string `json:"architecture"` - Pin int `json:"pin"` - Origins []struct { - Archive string `json:"archive"` - Codename string `json:"codename"` - Version string `json:"version"` - Origin string `json:"origin"` - Label string `json:"label"` - Site string `json:"site"` - } `json:"origins"` -} -type jsonRPC struct { - JsonRPC string `json:"jsonrpc"` - Method string `json:"method"` - Params struct { - Command string `json:"command"` - UnknownPackages []string `json:"unknown-packages"` - Packages []struct { - Id int `json:"id"` - Name string `json:"name"` - Architecture string `json:"architecture"` - Mode string `json:"mode"` - Automatic bool `json:"automatic"` - Versions struct { - Candidate jsonRPCPackageVersion `json:"candidate"` - Install jsonRPCPackageVersion `json:"install"` - Current jsonRPCPackageVersion `json:"current"` - } `json:"versions"` - } `json:"packages"` - } `json:"params"` -} - -func updatesFromSource(count int, source string, first bool) string { - security := "" - if first { - security = "security " - } - updates := "updates" - if count == 1 { - updates = "update" - } - return fmt.Sprintf("%d %s %s%s", count, source, security, updates) -} - -func createUpdateMessage(standardSecurityCount int, esmInfraCount int, esmAppsCount int) string { - displayStandard := true - displayEsmInfra := true - displayEsmApps := true - if standardSecurityCount == 0 { - displayStandard = false - } - if esmInfraCount == 0 { - displayEsmInfra = false - } - if esmAppsCount == 0 { - displayEsmApps = false - } - - if !displayStandard && !displayEsmInfra && !displayEsmApps { - return "" - } - - esmInfraFirst := false - esmAppsFirst := false - if !displayStandard && displayEsmInfra { - esmInfraFirst = true - } else if !displayStandard && !displayEsmInfra && displayEsmApps { - esmAppsFirst = true - } - - standardUpdates := "" - afterStandard := "" - esmInfraUpdates := "" - afterInfra := "" - esmAppsUpdates := "" - - if displayStandard { - standardUpdates = updatesFromSource(standardSecurityCount, "standard", true) - if displayEsmInfra && displayEsmApps { - afterStandard = ", " - } else if displayEsmInfra || displayEsmApps { - afterStandard = " and " - } - } - if displayEsmInfra { - esmInfraUpdates = updatesFromSource(esmInfraCount, "esm-infra", esmInfraFirst) - if displayEsmApps { - afterInfra = " and " - } - } - if displayEsmApps { - esmAppsUpdates = updatesFromSource(esmAppsCount, "esm-apps", esmAppsFirst) - } - - return standardUpdates + afterStandard + esmInfraUpdates + afterInfra + esmAppsUpdates -} - -func fromOriginAndArchive(pkgVersion jsonRPCPackageVersion, origin string, archive string) bool { - for _, pkgOrigin := range pkgVersion.Origins { - if pkgOrigin.Origin == origin && pkgOrigin.Archive == archive { - return true - } - } - return false -} - -func distroFromPackageOrigin(rpc *jsonRPC) string { - for _, pkg := range rpc.Params.Packages { - for _, origin := range pkg.Versions.Candidate.Origins { - if origin.Codename != "" { - return origin.Codename - } - } - } - return "" -} - -func countSecurityUpdates(rpc *jsonRPC) (int, int, int) { - esmAppsCount := 0 - esmInfraCount := 0 - standardSecurityCount := 0 - distro := distroFromPackageOrigin(rpc) - for _, pkg := range rpc.Params.Packages { - if pkg.Mode == "upgrade" { - if fromOriginAndArchive(pkg.Versions.Install, "UbuntuESMApps", fmt.Sprintf("%s-apps-security", distro)) { - esmAppsCount++ - } else if fromOriginAndArchive(pkg.Versions.Install, "UbuntuESM", fmt.Sprintf("%s-infra-security", distro)) { - esmInfraCount++ - } else if fromOriginAndArchive(pkg.Versions.Install, "Ubuntu", fmt.Sprintf("%s-security", distro)) { - standardSecurityCount++ - } - } - } - return standardSecurityCount, esmInfraCount, esmAppsCount -} - -// readRpc reads a apt json rpc protocol 0.2 message as described in -// https://salsa.debian.org/apt-team/apt/blob/main/doc/json-hooks-protocol.md#wire-protocol -func readRpc(r *bufio.Reader) (*jsonRPC, error) { - line, err := r.ReadBytes('\n') - if err != nil && err != io.EOF { - return nil, fmt.Errorf("cannot read json-rpc: %v", err) - } - - var rpc jsonRPC - if err := json.Unmarshal(line, &rpc); err != nil { - return nil, err - } - // empty \n - emptyNL, _, err := r.ReadLine() - if err != nil { - return nil, err - } - if string(emptyNL) != "" { - return nil, fmt.Errorf("unexpected line: %q (empty)", emptyNL) - } - - return &rpc, nil -} - -func printEsmUpgrades() error { - sockFd := os.Getenv("APT_HOOK_SOCKET") - if sockFd == "" { - return fmt.Errorf("cannot find APT_HOOK_SOCKET env") - } - - fd, err := strconv.Atoi(sockFd) - if err != nil { - return fmt.Errorf("expected APT_HOOK_SOCKET to be a decimal integer, found %q", sockFd) - } - - f := os.NewFile(uintptr(fd), "apt-hook-socket") - if f == nil { - return fmt.Errorf("cannot open file descriptor %v", fd) - } - defer f.Close() - - conn, err := net.FileConn(f) - if err != nil { - return fmt.Errorf("cannot connect to %v: %v", fd, err) - } - defer conn.Close() - - r := bufio.NewReader(conn) - - // handshake - rpc, err := readRpc(r) - if err != nil { - return err - } - if rpc.Method != "org.debian.apt.hooks.hello" { - return fmt.Errorf("expected 'hello' method, got: %v", rpc.Method) - } - if _, err := conn.Write([]byte(`{"jsonrpc":"2.0","id":0,"result":{"version":"0.2"}}` + "\n\n")); err != nil { - return err - } - - // payload - rpc, err = readRpc(r) - if err != nil { - return err - } - if rpc.Method == "org.debian.apt.hooks.install.statistics" { - standardSecurityCount, esmInfraCount, esmAppsCount := countSecurityUpdates(rpc) - msg := createUpdateMessage(standardSecurityCount, esmInfraCount, esmAppsCount) - if msg != "" { - fmt.Println(msg) - } - } - - // bye - rpc, err = readRpc(r) - if err != nil { - return err - } - if rpc.Method != "org.debian.apt.hooks.bye" { - return fmt.Errorf("expected 'bye' method, got: %v", rpc.Method) - } - - return nil -} - -func main() { - err := printEsmUpgrades() - if err != nil { - println(err.Error()) - } -} diff -Nru ubuntu-advantage-tools-27.9~18.04.1/apt-hook/json-hook-src/json-hook_test.go ubuntu-advantage-tools-27.10.1~18.04.1/apt-hook/json-hook-src/json-hook_test.go --- ubuntu-advantage-tools-27.9~18.04.1/apt-hook/json-hook-src/json-hook_test.go 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/apt-hook/json-hook-src/json-hook_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,410 +0,0 @@ -package main - -import ( - "encoding/json" - "fmt" - "testing" -) - -func TestCreateUpdateMessages(t *testing.T) { - type params struct { - standardSecurityCount int - esmInfraCount int - esmAppsCount int - expectedMessage string - } - testParamsList := []params{ - {0, 0, 0, ""}, - {0, 0, 1, "1 esm-apps security update"}, - {0, 0, 2, "2 esm-apps security updates"}, - {0, 1, 0, "1 esm-infra security update"}, - {0, 1, 1, "1 esm-infra security update and 1 esm-apps update"}, - {0, 1, 2, "1 esm-infra security update and 2 esm-apps updates"}, - {0, 2, 0, "2 esm-infra security updates"}, - {0, 2, 1, "2 esm-infra security updates and 1 esm-apps update"}, - {0, 2, 2, "2 esm-infra security updates and 2 esm-apps updates"}, - {1, 0, 0, "1 standard security update"}, - {1, 0, 1, "1 standard security update and 1 esm-apps update"}, - {1, 0, 2, "1 standard security update and 2 esm-apps updates"}, - {1, 1, 0, "1 standard security update and 1 esm-infra update"}, - {1, 1, 1, "1 standard security update, 1 esm-infra update and 1 esm-apps update"}, - {1, 1, 2, "1 standard security update, 1 esm-infra update and 2 esm-apps updates"}, - {1, 2, 0, "1 standard security update and 2 esm-infra updates"}, - {1, 2, 1, "1 standard security update, 2 esm-infra updates and 1 esm-apps update"}, - {1, 2, 2, "1 standard security update, 2 esm-infra updates and 2 esm-apps updates"}, - {2, 0, 0, "2 standard security updates"}, - {2, 0, 1, "2 standard security updates and 1 esm-apps update"}, - {2, 0, 2, "2 standard security updates and 2 esm-apps updates"}, - {2, 1, 0, "2 standard security updates and 1 esm-infra update"}, - {2, 1, 1, "2 standard security updates, 1 esm-infra update and 1 esm-apps update"}, - {2, 1, 2, "2 standard security updates, 1 esm-infra update and 2 esm-apps updates"}, - {2, 2, 0, "2 standard security updates and 2 esm-infra updates"}, - {2, 2, 1, "2 standard security updates, 2 esm-infra updates and 1 esm-apps update"}, - {2, 2, 2, "2 standard security updates, 2 esm-infra updates and 2 esm-apps updates"}, - } - - for i, testParams := range testParamsList { - t.Run(fmt.Sprintf("Case %d", i), func(t *testing.T) { - actual := createUpdateMessage(testParams.standardSecurityCount, testParams.esmInfraCount, testParams.esmAppsCount) - if actual != testParams.expectedMessage { - t.Logf("expected: \"%s\", got: \"%s\"", testParams.expectedMessage, actual) - t.Fail() - } - }) - } -} - -func TestCountSecurityUpdates(t *testing.T) { - type params struct { - rpc string - expectedStandardSecurityCount int - expectedEsmInfraCount int - expectedEsmAppsCount int - } - testParamsList := []params{ - {mockJson, 1, 2, 3}, - } - - for i, testParams := range testParamsList { - t.Run(fmt.Sprintf("Case %d", i), func(t *testing.T) { - rpc := &jsonRPC{} - if err := json.Unmarshal([]byte(mockJson), rpc); err != nil { - t.Error(err) - } - - actualStandard, actualInfra, actualApps := countSecurityUpdates(rpc) - if actualStandard != testParams.expectedStandardSecurityCount { - t.Logf("expected: %d, got: %d", testParams.expectedStandardSecurityCount, actualStandard) - t.Fail() - } - if actualInfra != testParams.expectedEsmInfraCount { - t.Logf("expected: %d, got: %d", testParams.expectedEsmInfraCount, actualInfra) - t.Fail() - } - if actualApps != testParams.expectedEsmAppsCount { - t.Logf("expected: %d, got: %d", testParams.expectedEsmAppsCount, actualApps) - t.Fail() - } - }) - } -} - -const mockJson = ` -{ - "jsonrpc": "2.0", - "method": "org.debian.apt.hooks.install.statistics", - "params": { - "command": "install", - "search-terms": [ - "~U" - ], - "unknown-packages": [], - "packages": [ - { - "id": 418, - "name": "base-files", - "architecture": "amd64", - "mode": "upgrade", - "automatic": true, - "versions": { - "candidate": { - "id": 86, - "version": "11ubuntu19", - "architecture": "amd64", - "pin": 500, - "origins": [ - { - "archive": "focal-apps-security", - "codename": "focal", - "version": "20.04", - "origin": "UbuntuESMApps", - "label": "Ubuntu", - "site": "" - } - ] - }, - "install": { - "id": 86, - "version": "11ubuntu19", - "architecture": "amd64", - "pin": 500, - "origins": [ - { - "archive": "focal-apps-security", - "codename": "focal", - "version": "20.04", - "origin": "UbuntuESMApps", - "label": "Ubuntu", - "site": "" - } - ] - }, - "current": { - "id": 95463, - "version": "11ubuntu18", - "architecture": "amd64", - "pin": 100, - "origins": [] - } - } - }, - { - "id": 1085, - "name": "elfutils", - "architecture": "amd64", - "mode": "upgrade", - "automatic": true, - "versions": { - "candidate": { - "id": 371, - "version": "0.183-8", - "architecture": "amd64", - "pin": 500, - "origins": [ - { - "archive": "focal-apps-security", - "codename": "focal", - "version": "20.04", - "origin": "UbuntuESMApps", - "label": "Ubuntu", - "site": "" - } - ] - }, - "install": { - "id": 371, - "version": "0.183-8", - "architecture": "amd64", - "pin": 500, - "origins": [ - { - "archive": "focal-apps-security", - "codename": "focal", - "version": "20.04", - "origin": "UbuntuESMApps", - "label": "Ubuntu", - "site": "" - } - ] - }, - "current": { - "id": 95472, - "version": "0.183-6", - "architecture": "amd64", - "pin": 100, - "origins": [] - } - } - }, - { - "id": 24709, - "name": "fdroidserver", - "architecture": "amd64", - "mode": "upgrade", - "automatic": false, - "versions": { - "candidate": { - "id": 14186, - "version": "2.0-1", - "architecture": "all", - "pin": 500, - "origins": [ - { - "archive": "focal-infra-security", - "codename": "focal", - "version": "20.04", - "origin": "UbuntuESM", - "label": "Ubuntu", - "site": "" - }, - { - "archive": "focal", - "codename": "focal", - "version": "20.04", - "origin": "Ubuntu", - "label": "Ubuntu", - "site": "" - } - ] - }, - "install": { - "id": 14186, - "version": "2.0-1", - "architecture": "all", - "pin": 500, - "origins": [ - { - "archive": "focal-infra-security", - "codename": "focal", - "version": "20.04", - "origin": "UbuntuESM", - "label": "Ubuntu", - "site": "" - }, - { - "archive": "focal", - "codename": "focal", - "version": "20.04", - "origin": "Ubuntu", - "label": "Ubuntu", - "site": "" - } - ] - }, - "current": { - "id": 95474, - "version": "1.1.9-1", - "architecture": "all", - "pin": 100, - "origins": [] - } - } - }, - { - "id": 238, - "name": "gdb", - "architecture": "amd64", - "mode": "upgrade", - "automatic": true, - "versions": { - "candidate": { - "id": 705, - "version": "10.1-2ubuntu2", - "architecture": "amd64", - "pin": 500, - "origins": [ - { - "archive": "focal-infra-security", - "codename": "focal", - "version": "20.04", - "origin": "UbuntuESM", - "label": "Ubuntu", - "site": "" - } - ] - }, - "install": { - "id": 705, - "version": "10.1-2ubuntu2", - "architecture": "amd64", - "pin": 500, - "origins": [ - { - "archive": "focal-infra-security", - "codename": "focal", - "version": "20.04", - "origin": "UbuntuESM", - "label": "Ubuntu", - "site": "" - } - ] - }, - "current": { - "id": 95475, - "version": "10.1-2ubuntu1", - "architecture": "amd64", - "pin": 100, - "origins": [] - } - } - }, - { - "id": 126271, - "name": "google-chrome-stable", - "architecture": "amd64", - "mode": "upgrade", - "automatic": true, - "versions": { - "candidate": { - "id": 95416, - "version": "90.0.4430.85-1", - "architecture": "amd64", - "pin": 500, - "origins": [ - { - "archive": "focal-apps-security", - "codename": "focal", - "version": "1.0", - "origin": "UbuntuESMApps", - "label": "Google", - "site": "dl.google.com" - } - ] - }, - "install": { - "id": 95416, - "version": "90.0.4430.85-1", - "architecture": "amd64", - "pin": 500, - "origins": [ - { - "archive": "focal-apps-security", - "codename": "focal", - "version": "1.0", - "origin": "UbuntuESMApps", - "label": "Google", - "site": "dl.google.com" - } - ] - }, - "current": { - "id": 95477, - "version": "90.0.4430.72-1", - "architecture": "amd64", - "pin": 100, - "origins": [] - } - } - }, - { - "id": 1499, - "name": "libasm1", - "architecture": "amd64", - "mode": "upgrade", - "automatic": true, - "versions": { - "candidate": { - "id": 1763, - "version": "0.183-8", - "architecture": "amd64", - "pin": 500, - "origins": [ - { - "archive": "focal-security", - "codename": "focal", - "version": "20.04", - "origin": "Ubuntu", - "label": "Ubuntu", - "site": "" - } - ] - }, - "install": { - "id": 1763, - "version": "0.183-8", - "architecture": "amd64", - "pin": 500, - "origins": [ - { - "archive": "focal-security", - "codename": "focal", - "version": "20.04", - "origin": "Ubuntu", - "label": "Ubuntu", - "site": "" - } - ] - }, - "current": { - "id": 95482, - "version": "0.183-6", - "architecture": "amd64", - "pin": 100, - "origins": [] - } - } - } - ] - } -} -` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/apt-hook/json-hook.test.cc ubuntu-advantage-tools-27.10.1~18.04.1/apt-hook/json-hook.test.cc --- ubuntu-advantage-tools-27.9~18.04.1/apt-hook/json-hook.test.cc 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/apt-hook/json-hook.test.cc 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,379 @@ +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE Main +#include + +#include "json-hook.hh" + +BOOST_AUTO_TEST_SUITE(JSON_Hook) + +BOOST_AUTO_TEST_SUITE(Count_Message) + +void count_message_test(int standard_count, int infra_count, int apps_count, std::string expected_message) { + security_package_counts counts; + counts.standard = standard_count; + counts.esm_infra = infra_count; + counts.esm_apps = apps_count; + std::string message = create_count_message(counts); + BOOST_CHECK(message == expected_message); +} + +BOOST_AUTO_TEST_CASE(Test1) { count_message_test(0, 0, 0, ""); } +BOOST_AUTO_TEST_CASE(Test2) { count_message_test(0, 0, 1, "1 esm-apps security update"); } +BOOST_AUTO_TEST_CASE(Test3) { count_message_test(0, 0, 2, "2 esm-apps security updates"); } +BOOST_AUTO_TEST_CASE(Test4) { count_message_test(0, 1, 0, "1 esm-infra security update"); } +BOOST_AUTO_TEST_CASE(Test5) { count_message_test(0, 1, 1, "1 esm-infra security update and 1 esm-apps update"); } +BOOST_AUTO_TEST_CASE(Test6) { count_message_test(0, 1, 2, "1 esm-infra security update and 2 esm-apps updates"); } +BOOST_AUTO_TEST_CASE(Test7) { count_message_test(0, 2, 0, "2 esm-infra security updates"); } +BOOST_AUTO_TEST_CASE(Test8) { count_message_test(0, 2, 1, "2 esm-infra security updates and 1 esm-apps update"); } +BOOST_AUTO_TEST_CASE(Test9) { count_message_test(0, 2, 2, "2 esm-infra security updates and 2 esm-apps updates"); } +BOOST_AUTO_TEST_CASE(Test10) { count_message_test(1, 0, 0, "1 standard security update"); } +BOOST_AUTO_TEST_CASE(Test11) { count_message_test(1, 0, 1, "1 standard security update and 1 esm-apps update"); } +BOOST_AUTO_TEST_CASE(Test12) { count_message_test(1, 0, 2, "1 standard security update and 2 esm-apps updates"); } +BOOST_AUTO_TEST_CASE(Test13) { count_message_test(1, 1, 0, "1 standard security update and 1 esm-infra update"); } +BOOST_AUTO_TEST_CASE(Test14) { count_message_test(1, 1, 1, "1 standard security update, 1 esm-infra update and 1 esm-apps update"); } +BOOST_AUTO_TEST_CASE(Test15) { count_message_test(1, 1, 2, "1 standard security update, 1 esm-infra update and 2 esm-apps updates"); } +BOOST_AUTO_TEST_CASE(Test16) { count_message_test(1, 2, 0, "1 standard security update and 2 esm-infra updates"); } +BOOST_AUTO_TEST_CASE(Test17) { count_message_test(1, 2, 1, "1 standard security update, 2 esm-infra updates and 1 esm-apps update"); } +BOOST_AUTO_TEST_CASE(Test18) { count_message_test(1, 2, 2, "1 standard security update, 2 esm-infra updates and 2 esm-apps updates"); } +BOOST_AUTO_TEST_CASE(Test19) { count_message_test(2, 0, 0, "2 standard security updates"); } +BOOST_AUTO_TEST_CASE(Test20) { count_message_test(2, 0, 1, "2 standard security updates and 1 esm-apps update"); } +BOOST_AUTO_TEST_CASE(Test21) { count_message_test(2, 0, 2, "2 standard security updates and 2 esm-apps updates"); } +BOOST_AUTO_TEST_CASE(Test22) { count_message_test(2, 1, 0, "2 standard security updates and 1 esm-infra update"); } +BOOST_AUTO_TEST_CASE(Test23) { count_message_test(2, 1, 1, "2 standard security updates, 1 esm-infra update and 1 esm-apps update"); } +BOOST_AUTO_TEST_CASE(Test24) { count_message_test(2, 1, 2, "2 standard security updates, 1 esm-infra update and 2 esm-apps updates"); } +BOOST_AUTO_TEST_CASE(Test25) { count_message_test(2, 2, 0, "2 standard security updates and 2 esm-infra updates"); } +BOOST_AUTO_TEST_CASE(Test26) { count_message_test(2, 2, 1, "2 standard security updates, 2 esm-infra updates and 1 esm-apps update"); } +BOOST_AUTO_TEST_CASE(Test27) { count_message_test(2, 2, 2, "2 standard security updates, 2 esm-infra updates and 2 esm-apps updates"); } + +BOOST_AUTO_TEST_SUITE_END() + +BOOST_AUTO_TEST_SUITE(Count_Security_Updates) + +std::string test_json = R"( + { + "command": "install", + "search-terms": [ + "~U" + ], + "unknown-packages": [], + "packages": [ + { + "id": 418, + "name": "base-files", + "architecture": "amd64", + "mode": "upgrade", + "automatic": true, + "versions": { + "candidate": { + "id": 86, + "version": "11ubuntu19", + "architecture": "amd64", + "pin": 500, + "origins": [ + { + "archive": "focal-apps-security", + "codename": "focal", + "version": "20.04", + "origin": "UbuntuESMApps", + "label": "Ubuntu", + "site": "" + } + ] + }, + "install": { + "id": 86, + "version": "11ubuntu19", + "architecture": "amd64", + "pin": 500, + "origins": [ + { + "archive": "focal-apps-security", + "codename": "focal", + "version": "20.04", + "origin": "UbuntuESMApps", + "label": "Ubuntu", + "site": "" + } + ] + }, + "current": { + "id": 95463, + "version": "11ubuntu18", + "architecture": "amd64", + "pin": 100, + "origins": [] + } + } + }, + { + "id": 1085, + "name": "elfutils", + "architecture": "amd64", + "mode": "upgrade", + "automatic": true, + "versions": { + "candidate": { + "id": 371, + "version": "0.183-8", + "architecture": "amd64", + "pin": 500, + "origins": [ + { + "archive": "focal-apps-security", + "codename": "focal", + "version": "20.04", + "origin": "UbuntuESMApps", + "label": "Ubuntu", + "site": "" + } + ] + }, + "install": { + "id": 371, + "version": "0.183-8", + "architecture": "amd64", + "pin": 500, + "origins": [ + { + "archive": "focal-apps-security", + "codename": "focal", + "version": "20.04", + "origin": "UbuntuESMApps", + "label": "Ubuntu", + "site": "" + } + ] + }, + "current": { + "id": 95472, + "version": "0.183-6", + "architecture": "amd64", + "pin": 100, + "origins": [] + } + } + }, + { + "id": 24709, + "name": "fdroidserver", + "architecture": "amd64", + "mode": "upgrade", + "automatic": false, + "versions": { + "candidate": { + "id": 14186, + "version": "2.0-1", + "architecture": "all", + "pin": 500, + "origins": [ + { + "archive": "focal-infra-security", + "codename": "focal", + "version": "20.04", + "origin": "UbuntuESM", + "label": "Ubuntu", + "site": "" + }, + { + "archive": "focal", + "codename": "focal", + "version": "20.04", + "origin": "Ubuntu", + "label": "Ubuntu", + "site": "" + } + ] + }, + "install": { + "id": 14186, + "version": "2.0-1", + "architecture": "all", + "pin": 500, + "origins": [ + { + "archive": "focal-infra-security", + "codename": "focal", + "version": "20.04", + "origin": "UbuntuESM", + "label": "Ubuntu", + "site": "" + }, + { + "archive": "focal", + "codename": "focal", + "version": "20.04", + "origin": "Ubuntu", + "label": "Ubuntu", + "site": "" + } + ] + }, + "current": { + "id": 95474, + "version": "1.1.9-1", + "architecture": "all", + "pin": 100, + "origins": [] + } + } + }, + { + "id": 238, + "name": "gdb", + "architecture": "amd64", + "mode": "upgrade", + "automatic": true, + "versions": { + "candidate": { + "id": 705, + "version": "10.1-2ubuntu2", + "architecture": "amd64", + "pin": 500, + "origins": [ + { + "archive": "focal-infra-security", + "codename": "focal", + "version": "20.04", + "origin": "UbuntuESM", + "label": "Ubuntu", + "site": "" + } + ] + }, + "install": { + "id": 705, + "version": "10.1-2ubuntu2", + "architecture": "amd64", + "pin": 500, + "origins": [ + { + "archive": "focal-infra-security", + "codename": "focal", + "version": "20.04", + "origin": "UbuntuESM", + "label": "Ubuntu", + "site": "" + } + ] + }, + "current": { + "id": 95475, + "version": "10.1-2ubuntu1", + "architecture": "amd64", + "pin": 100, + "origins": [] + } + } + }, + { + "id": 126271, + "name": "google-chrome-stable", + "architecture": "amd64", + "mode": "upgrade", + "automatic": true, + "versions": { + "candidate": { + "id": 95416, + "version": "90.0.4430.85-1", + "architecture": "amd64", + "pin": 500, + "origins": [ + { + "archive": "focal-apps-security", + "codename": "focal", + "version": "1.0", + "origin": "UbuntuESMApps", + "label": "Google", + "site": "dl.google.com" + } + ] + }, + "install": { + "id": 95416, + "version": "90.0.4430.85-1", + "architecture": "amd64", + "pin": 500, + "origins": [ + { + "archive": "focal-apps-security", + "codename": "focal", + "version": "1.0", + "origin": "UbuntuESMApps", + "label": "Google", + "site": "dl.google.com" + } + ] + }, + "current": { + "id": 95477, + "version": "90.0.4430.72-1", + "architecture": "amd64", + "pin": 100, + "origins": [] + } + } + }, + { + "id": 1499, + "name": "libasm1", + "architecture": "amd64", + "mode": "upgrade", + "automatic": true, + "versions": { + "candidate": { + "id": 1763, + "version": "0.183-8", + "architecture": "amd64", + "pin": 500, + "origins": [ + { + "archive": "focal-security", + "codename": "focal", + "version": "20.04", + "origin": "Ubuntu", + "label": "Ubuntu", + "site": "" + } + ] + }, + "install": { + "id": 1763, + "version": "0.183-8", + "architecture": "amd64", + "pin": 500, + "origins": [ + { + "archive": "focal-security", + "codename": "focal", + "version": "20.04", + "origin": "Ubuntu", + "label": "Ubuntu", + "site": "" + } + ] + }, + "current": { + "id": 95482, + "version": "0.183-6", + "architecture": "amd64", + "pin": 100, + "origins": [] + } + } + } + ] + } +)"; + +BOOST_AUTO_TEST_CASE(Test1) { + security_package_counts counts; + json_object *stats = json_tokener_parse(test_json.c_str()); + count_security_packages_from_apt_stats_json(stats, counts); + BOOST_CHECK(counts.standard == 1); + BOOST_CHECK(counts.esm_infra == 2); + BOOST_CHECK(counts.esm_apps == 3); +} + +BOOST_AUTO_TEST_SUITE_END() + +BOOST_AUTO_TEST_SUITE_END() diff -Nru ubuntu-advantage-tools-27.9~18.04.1/apt-hook/Makefile ubuntu-advantage-tools-27.10.1~18.04.1/apt-hook/Makefile --- ubuntu-advantage-tools-27.9~18.04.1/apt-hook/Makefile 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/apt-hook/Makefile 2022-07-12 18:09:51.000000000 +0000 @@ -1,21 +1,3 @@ -# the go hook steps will be skipped if this is a nonempty string -SKIP_GO_HOOK = "" - -GO_BIN = $(shell which go) -# Try go-1.14 and go-1.10 if not in path -ifeq ($(GO_BIN),) - ifneq ($(wildcard /usr/lib/go-1.14/bin/go),) - GO_BIN = /usr/lib/go-1.14/bin/go - else ifneq ($(wildcard /usr/lib/go-1.10/bin/go),) - GO_BIN = /usr/lib/go-1.10/bin/go - endif -endif - -# If still not found then just don't build the go hook -ifeq ($(GO_BIN),) - SKIP_GO_HOOK = "1" -endif - all: build build: hook ubuntu-advantage.pot json-hook @@ -26,16 +8,21 @@ hook: hook.cc $(CXX) -Wall -Wextra -pedantic -std=c++11 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -g -o hook hook.cc -lapt-pkg $(LDLIBS) -json-hook: - [ $(SKIP_GO_HOOK) ] || (cd json-hook-src && GOCACHE=/tmp/ $(GO_BIN) build -buildmode=pie -ldflags -extldflags=-z,relro json-hook.go) +json-hook: json-hook.cc + $(CXX) -Wall -Wextra -pedantic -std=c++11 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -g -o json-hook json-hook-main.cc json-hook.cc -ljson-c $(LDLIBS) -install: hook json-hook +test: + $(CXX) -Wall -Wextra -pedantic -std=c++11 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -g -o json-hook-test json-hook.cc json-hook.test.cc -ljson-c -lboost_unit_test_framework $(LDLIBS) + ./json-hook-test + +install-conf: install -D -m 644 20apt-esm-hook.conf $(DESTDIR)/etc/apt/apt.conf.d/20apt-esm-hook.conf + +install: hook json-hook install -D -m 755 hook $(DESTDIR)/usr/lib/ubuntu-advantage/apt-esm-hook - [ $(SKIP_GO_HOOK) ] || install -D -m 755 json-hook-src/json-hook $(DESTDIR)/usr/lib/ubuntu-advantage/apt-esm-json-hook + install -D -m 755 json-hook $(DESTDIR)/usr/lib/ubuntu-advantage/apt-esm-json-hook clean: - rm -f hook ubuntu-advantage.pot json-hook-src/json-hook + rm -f hook json-hook json-hook-test ubuntu-advantage.pot -test: - [ $(SKIP_GO_HOOK) ] || (cd json-hook-src && GOCACHE=/tmp/ $(GO_BIN) test) +.PHONY: test diff -Nru ubuntu-advantage-tools-27.9~18.04.1/contributing-docs/howtoguides/how_to_release_a_new_version_of_ua.md ubuntu-advantage-tools-27.10.1~18.04.1/contributing-docs/howtoguides/how_to_release_a_new_version_of_ua.md --- ubuntu-advantage-tools-27.9~18.04.1/contributing-docs/howtoguides/how_to_release_a_new_version_of_ua.md 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/contributing-docs/howtoguides/how_to_release_a_new_version_of_ua.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,262 +0,0 @@ -# Ubuntu Advantage Client Releases - -## Supported Ubuntu Releases - -See the table under "Support Matrix for the client" in the [readme](./README.md). - -## Release versioning schemes - -Below are the versioning schemes used for publishing debs: - -| Build target | Version Format | -| --------------------------------------------------------------------------------- | ------------------------------------------ | -| [Daily PPA](https://code.launchpad.net/~canonical-server/+recipe/ua-client-daily) | `XX.YY-~g~ubuntu22.04.1` | -| Staging PPA | `XX.YY~22.04.1~rc1` | -| Stable PPA | `XX.YY~22.04.1~stableppa1` | -| Archive release | `XX.YY~22.04.1` | -| Archive bugfix release | `XX.YY.Z~22.04.1` | - -## Supported upgrade paths on same upstream version - -Regardless of source, the latest available "upstream version" (e.g. 27.4) will always be installed, because the upstream version comes first followed by a tilde in all version formats. - -This table demonstrates upgrade paths between sources for one particular upstream version. - -| Upgrade path | Version diff example | -| ------------------------------- | ----------------------------------------------------------------------- | -| Staging to Next Staging rev | `31.4~22.04.1~rc1` ➜ `31.4~22.04.1~rc2` | -| Staging to Stable | `31.4~22.04.1~rc2` ➜ `31.4~22.04.1~stableppa1` | -| Stable to Next Stable rev | `31.4~22.04.1~stableppa1` ➜ `31.4~22.04.1~stableppa2` | -| Stable to Archive | `31.4~22.04.1~stableppa2` ➜ `31.4~22.04.1` | -| LTS Archive to Next LTS Archive | `31.4~22.04.1` ➜ `31.4~24.04.1` | -| Archive to Daily | `31.4~24.04.1` ➜ `31.4-1500~g75fa134~ubuntu24.04.1` | -| Daily to Next Daily | `31.4-1500~g75fa134~ubuntu24.04.1` ➜ `31.4-1501~g3836375~ubuntu24.04.1` | - -## Process - - -### Background - -The release process for ubuntu-advantage-tools has three overarching steps/goals. - -1. Release to our team infrastructure. This includes Github and the `ua-client` PPAs. -2. Release to the latest ubuntu devel release. -3. Release to the supported ubuntu past releases via [SRU](https://wiki.ubuntu.com/StableReleaseUpdates) using the [ubuntu-advantage-tools specific SRU process](https://wiki.ubuntu.com/UbuntuAdvantageToolsUpdates). - -Generally speaking, these steps happen in order, but there is some overlap. Also we may backtrack if issues are found part way through the process. - -An average release should take somewhere between 10 and 14 calendar days if things go smoothly, starting at the decision to release and ending at the new version being available in all supported ubuntu releases. Note that it is not 2 weeks of full time work. Most of the time is spent waiting for review or sitting in proposed. - -### Prerequisites - -If this is your first time releasing ubuntu-advantage-tools, you'll need to do the following before getting started: - -* Add the team helper scripts to your PATH: [uss-tableflip](https://github.com/canonical/uss-tableflip). -* If you don't yet have a gpg key set up, follow the instructions - [here](https://help.launchpad.net/YourAccount/ImportingYourPGPKey) to create a key, - publish it to `hkp://keyserver.ubuntu.com`, and import it into Launchpad. -* Before you run `sbuild-it` for the first time, you'll need to set up a chroot for each Ubuntu release. - Run the following to set up chroots with dependencies pre-installed for each release: - ```bash - apt-get install sbuild-launchpad-chroot - bash ./tools/setup_sbuild.sh # This will give you usage information on how to call it with the correct parameters - ``` -* You must have launchpad already properly configured in your system in order to upload packages to the PPAs. Follow [this guide](https://help.launchpad.net/Packaging/PPA/Uploading) to get set up. - -### I. Preliminary/staging release to team infrastructure -1. Create a release PR - - a. Move the desired commits from our `main` branch onto the desired release branch - - * This step is currently not well defined. We currently are using `release-27` for all `27.X` releases and have been cherry-picking/rebasing all commits from `main` into this branch for a release. - - b Create a new entry in the `debian/changelog` file: - - * You can do that by running ` dch --newversion ` - * Remember to update the release from `UNRELEASED` to the ubuntu/devel release. Edit the version to look like: `27.2~21.10.1`, with the appropriate ua and ubuntu/devel version numbers. - * Populate `debian/changelog` with the commits you have cherry-picked - * You can do that by running `git log .. | log2dch` - * This will generate a list of commits that could be included in the changelog. - * You don't need to include all of the commits generated. Remember that the changelog should - be read by the user to understand the new features/modifications in the package. If you - think a commit will not add that much to the user experience, you can drop it from the - changelog - * To structure the changelog you can use the other entries as example. But we basically try to - keep this order: debian changes, new features/modifications, testing. Within each section, bullet points should be alphabetized. - - c. Create a PR on github into the release branch. Ask in the UA channel on mattermost for review. - - d. When reviewing the release PR, please use the following guidelines when reviewing the new changelog entry: - - * Is the version correctly updated ? We must ensure that the new version on the changelog is - correct and it also targets the latest Ubuntu release at the moment. - * Is the entry useful for the user ? The changelog entries should be user focused, meaning - that we should only add entries that we think users will care about (i.e. we don't need - entries when fixing a test, as this doesn't provide meaningful information to the user) - * Is this entry redundant ? Sometimes we may have changes that affect separate modules of the - code. We should have an entry only for the module that was most affected by it - * Is the changelog entry unique ? We need to verify that the changelog entry is not already - reflected in an earlier version of the changelog. If it is, we need not only to remove but double - check the process we are using to cherry-pick the commits - * Is this entry actually reflected on the code ? Sometimes, we can have changelog entries - that are not reflected in the code anymore. This can happen during development when we are - still unsure about the behavior of a feature or when we fix a bug that removes the code - that was added. We must verify each changelog entry that is added to be sure of their - presence in the product. - -2. After the release PR is merged, tag the head of the release branch with the version number, e.g. `27.1`. Push this tag to Github. - -3. Build the package for all Ubuntu releases and upload to `ppa:ua-client/staging` - - a. Clone the repository in a clean directory and switch to the release branch - * *WARNING* Build the package in a clean environment. The reason for that is because the package - will contain everything that it is present in the folder. If you are storing credentials or - other sensible development information in your folder, they will be uploaded too when we send - the package to the ppa. A clean environment is the safest way to perform this. - - b. Edit the changelog: - * List yourself as the author of this release. - * Edit the version number to look like: `27.2~20.04.1~rc1` (`~.~rc`) - * Edit the ubuntu release name. Start with the ubuntu/devel release (e.g. `impish`). - * `git commit -m "throwaway"` Do **not** push this commit! - - c. `build-package` - * This script will generate all the package artifacts in the parent directory as `../out`. - - d. `sbuild-it ../out/.dsc` - * If this succeeds move on. If this fails, debug and fix before continuing. - - e. Repeat 3.b through 3.d for all supported Ubuntu Releases - * PS: remember to also change the version number on the changelog. For example, suppose - the new version is `1.1~20.04.1~rc1`. If you want to test Bionic now, change it to - `1.1~18.04.1~rc1`. - - f. For each release, dput to the staging PPA: - * `dput ppa:ua-client/staging ../out/_source.changes` - * After each `dput` wait for the "Accepted" email from Launchpad before moving on. - -### II. Release to Ubuntu (devel and SRU) - -> Note: `impish` is used throughout as a reference to the current devel release. This will change. - -1. Prepare SRU Launchpad bugs. - - a. We do this even before a succesful merge into ubuntu/devel because the context added to these bugs is useful for the Server Team reviewer. - - b. Create a new bug on Launchpad for ubuntu-advantage-tools and use the format defined [here](https://wiki.ubuntu.com/UbuntuAdvantageToolsUpdates#SRU_Template) for the description. - * The title should be in the format `[SRU] ubuntu-advantage-tools (27.1 -> 27.2) Xenial, Bionic, Focal, Hirsute`, substituting version numbers and release names as necessary. - - c. For each Launchpad bug fixed by this release (which should all be referenced in our changelog), add the SRU template to the description and fill out each section. - * Leave the original description in the bug at the bottom under the header `[Original Description]`. - * For the testing steps, include steps to reproduce the bug. Then include instructions for adding `ppa:ua-client/staging`, and steps to verify the bug is no longer present. - -2. Set up the Merge Proposal (MP) for ubuntu/devel - - a. `git-ubuntu clone ubuntu-advantage-tools; cd ubuntu-advantage-tools` - - b. `git remote add upstream git@github.com:canonical/ubuntu-advantage-client.git` - - c. `git fetch upstream` - - d. `git rebase --onto pkg/ubuntu/devel ` - * e.g. `git rebase --onto pkg/ubuntu/devel 27.0.2 27.1` - * You may need to resolve conflicts, but hopefully these will be minimal. - * You'll end up in a detached state - - e. `git checkout -B upload--impish` - * This creates a new local branch name based on your detached branch - - f. Make sure the changelog version contains the release version in the name (For example, `27.1~21.10.1`) - - g. `git push upload--impish` - - h. On Launchpad, create a merge proposal for this version which targets `ubuntu/devel` - * For an example, see the [27.0.2 merge proposal](https://code.launchpad.net/~chad.smith/ubuntu/+source/ubuntu-advantage-tools/+git/ubuntu-advantage-tools/+merge/402459) - * Add 2 review slots for `canonical-server` and `canonical-server-core-reviewers` -3. Set up the MP for past Ubuntu releases based on the ubuntu/devel PR - - a. Create a PR for each target series based off your local `release-${UA_VERSION}-impish` branch: - * If you've followed the instructions precisely so far, you can just run `bash tools/create-lp-release-branches.sh`. - - b. Create merge proposals for each SRU target release @ `https://code.launchpad.net/~/ubuntu/+source/ubuntu-advantage-tools/+git/ubuntu-advantage-tools/`. Make sure each MP targets your `upload-${UA_VERSION}-impish` branch (the branch you are MP-ing into ubuntu/devel). - - c. Add both `canonical-server` and `canonical-server-core-reviewers` as review slots on each MP. - -4. Server Team Review - - a. Ask in ~Server for a review of your MPs. Include a link to the primary MP into ubuntu/devel and mention the other MPs are only changelog MPs for the SRUs into past releases. - - b. If they request changes, create a PR into the release branch on github and ask UAClient team for review. After that is merged, cherry-pick the commit into your `upload--` branch and push to launchpad. You'll also need to rebase the other `upload--` branches and force push them to launchpad. Then notify the Server Team member that you have addressed their requests. - * Some issues may just be filed for addressing in the future if they are not urgent or pertinent to this release. - * Unless the changes are very minor, or only testing related, you should upload a new release candidate version to `ppa:ua-client/staging` as descibed in I.3. - * After the release is finished, any commits that were merged directly into the release branch in this way should be brought back into `main` via a single PR. - - c. Once review is complete and approved, confirm that Ubuntu Server approver will be tagging the PR with the appropriate `upload/` tag so git-ubuntu will import rich commit history. - - d. At this point the Server Team member should **not** upload the version to the devel release. - * If they do, then any changes to the code after this point will require a bump in the patch version of the release. - - e. Ask Ubuntu Server approver if they also have upload rights to the proposed queue. If they do, request that they upload ubuntu-advantage-tools for all releases. If they do not, ask in ~Server channel for a Ubuntu Server team member with upload rights for an upload review of the MP for the proposed queue. - - f. Once upload review is complete and approved, confirm that Ubuntu Server approver will upload ua-tools via dput to the `-proposed` queue. - - g. Check the [-proposed release queue](https://launchpad.net/ubuntu/xenial/+queue?queue_state=1&queue_text=ubuntu-advantage-tools) for presence of ua-tools in unapproved state for each supported release. Note: libera chat #ubuntu-release IRC channel has a bot that reports queued uploads of any package in a message like "Unapproved: ubuntu-advantage-tools .. version". - -5. SRU Review - - a. Once unapproved ua-tools package is listed in the pending queue for each target release, [ping appropriate daily SRU vanguard for review of ua-tools into -proposed](https://wiki.ubuntu.com/StableReleaseUpdates#Publishing)via the libera.chat #ubuntu-release channel - - b. As soon as the SRU vanguard approves the packages, a bot in #ubuntu-release will announce that ubuntu-advantage-tools is accepted into the applicable -proposed pockets, or the [Xenial -proposed release rejection queue](https://launchpad.net/ubuntu/xenial/+queue?queue_state=4&queue_text=ubuntu-advantage-tools) will contain a reason for rejections. Double check the SRU process bug for any actionable review feedback. - - c. Once accepted into `-proposed` by an SRU vanguard [ubuntu-advantage-tools shows up in the pending_sru page](https://people.canonical.com/~ubuntu-archive/pending-sru.html), check `rmadison ubuntu-advantage-tools | grep -proposed` to see if the upload exists in -proposed yet. - - d. Confirm availability in -proposed pocket via - ```bash - cat > setup_proposed.sh <` and saving the output. - - g. After all tests have passed, tarball all of the output files and upload them to the SRU bug with a message that looks like this: - ``` - We have run the full ubuntu-advantage-tools integration test suite against the version in -proposed. The results are attached. All tests passed (or call out specific explained failures). - - You can verify the correct version was used by checking the output of the first test in each file, which prints the version number. - - I am marking the verification done for this SRU. - ``` - Change the tags on the bug from `verification-needed` to `verification-done` (including the verification tags for each release). - - h. For any other related Launchpad bugs that are fixed in this release. Perform the verification steps necessary for those bugs and mark them `verification-done` as needed. This will likely involve following the test steps, but instead of adding the staging PPA, enabling -proposed. - - i. Once all SRU bugs are tagged as `verification*-done`, all SRU-bugs should be listed as green in [the pending_sru page](https://people.canonical.com/~ubuntu-archive/pending-sru.html). - - j. After the pending sru page says that ubuntu-advantage-tools has been in proposed for 7 days, it is now time to ping the [current SRU vanguard](https://wiki.ubuntu.com/StableReleaseUpdates#Publishing) for acceptance of ubuntu-advantage-tools into -updates. - - k. Ping the Ubuntu Server team member who approved the version in step `II.4` to now upload to the devel release. - - l. Check `rmadison ubuntu-advantage-tools` for updated version in devel release - - m. Confirm availability in -updates pocket via `lxc launch ubuntu-daily: dev-i; lxc exec dev-i -- apt update; lxc exec dev-i -- apt-cache policy ubuntu-advantage-tools` - -### III. Github Repository Post-release Update - -1. Ensure the version tag is correct on github. The `version` git tag should point to the commit that was released as that version to ubuntu -updates. If changes were made in response to feedback during the release process, the tag may have to be moved. -2. Bring in any changes that were made to the release branch into `main` via PR (e.g. Changelog edits). - -## Cloud Images Update - -After the release process is finished, CPC must be informed. They will be responsible to update the cloud images using the package from the pockets it was released to (whether it is the `stable` PPA or the`-updates` pocket). diff -Nru ubuntu-advantage-tools-27.9~18.04.1/contributing-docs/references/terminology.md ubuntu-advantage-tools-27.10.1~18.04.1/contributing-docs/references/terminology.md --- ubuntu-advantage-tools-27.9~18.04.1/contributing-docs/references/terminology.md 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/contributing-docs/references/terminology.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# Terminology - -The following vocabulary is used to describe different aspects of the work -Ubuntu Advantage Client performs: - -| Term | Meaning | -| -------- | -------- | -| UA Client | The python command line client represented in this ubuntu-advantage-client repository. It is installed on each Ubuntu machine and is the entry-point to enable any Ubuntu Advantage commercial service on an Ubuntu machine. | -| Contract Server | The backend service exposing a REST API to which UA Client authenticates in order to obtain contract and commercial service information and manage which support services are active on a machine.| -| Entitlement/Service | An Ubuntu Advantage commercial support service such as FIPS, ESM, Livepatch, CIS-Audit to which a contract may be entitled | -| Affordance | Service-specific list of applicable architectures and Ubuntu series on which a service can run | -| Directives | Service-specific configuration values which are applied to a service when enabling that service | -| Obligations | Service-specific policies that must be instrumented for support of a service. Example: `enableByDefault: true` means that any attached machine **MUST** enable a service on attach | diff -Nru ubuntu-advantage-tools-27.9~18.04.1/CONTRIBUTING.md ubuntu-advantage-tools-27.10.1~18.04.1/CONTRIBUTING.md --- ubuntu-advantage-tools-27.9~18.04.1/CONTRIBUTING.md 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/CONTRIBUTING.md 2022-07-12 18:09:51.000000000 +0000 @@ -2,483 +2,27 @@ ## Developer Documentation -### Reference - -* [Terminology](./contributing-docs/references/terminology.md) - -## Architecture -Ubuntu Advantage client, hereafter "UA client", is a python3-based command line -utility. It provides a CLI to attach, detach, enable, -disable and check status of support related services. - -The package `ubuntu-advantage-tools` also provides a C++ APT hook which helps -advertise ESM service and available packages in MOTD and during various apt -commands. - -The `ubuntu-advantage-pro` package delivers auto-attach functionality via init -scripts and systemd services for various cloud platforms. - -By default, Ubuntu machines are deployed in an unattached state. A machine can -get manually or automatically attached to a specific contract by interacting -with the Contract Server REST API. Any change in state of services or machine -attach results in additional interactions with the Contract Server API to -validate such operations. - -### Attaching a machine -Each Ubuntu SSO account holder has access to one or more contracts. To attach -a machine to an Ubuntu Advantage contract: - -* Obtain a contract token from your Ubuntu SSO account at https://ubuntu.com/advantage. -* Run `sudo ua attach ` on the machine - - Ubuntu Pro images for AWS, Azure and GCP perform an auto-attach without tokens -* UA Client reads config from /etc/ubuntu-advantage/uaclient.conf to obtain - the contract_url (default: https://contracts.canonical.com) -* UA Client POSTs to the Contract Server API @ - /api/v1/context/machines/token providing the \ -* The Contract Server responds with a JSON blob containing an unique machine - token, service credentials, affordances, directives and obligations to allow - enabling and disabling Ubuntu Advantage services -* UA client writes the machine token API response to the root-readonly - /var/lib/ubuntu-advantage/private/machine-token.json -* UA client auto-enables any services defined with - `obligations:{enableByDefault: true}` - -#### Attaching with --attach-config -Running `ua attach` with the `--attach-config` may be better suited to certain scenarios. - -When using `--attach-config` the token must be passed in the file rather than on the command line. This is useful in situations where it is preferred to keep the secret token in a file. - -Optionally, the attach config file can be used to override the services that are automatically enabled as a part of the attach process. - -An attach config file looks like this: -```yaml -token: YOUR_TOKEN_HERE # required -enable_services: # optional list of service names to auto-enable - - esm-infra - - esm-apps - - cis -``` - -And can be passed on the cli like this: -```shell -sudo ua attach --attach-config /path/to/file.yaml -``` - -### Enabling a service -Each service controlled by UA client will have a python module in -uaclient/entitlements/\*.py which handles setup and teardown of services when -enabled or disabled. - -If a contract entitles a machine to a service, `root` user can enable the -service with `ua enable `. If a service can be disabled -`ua disable ` will be permitted. - -The goal of the UA client is to remain simple and flexible and let the -contracts backend drive dynamic changes in contract offerings and constraints. -In pursuit of that goal, the UA client obtains most of it's service constraints -from a machine token that it obtains from the Contract Server API. - -The UA Client is simple in that it relies on the machine token on the attached -machine to describe whether a service is applicable for an environment and what -configuration is required to properly enable that service. - -Any interactions with the Contract server API are defined as UAContractClient -class methods in [uaclient/contract.py](uaclient/contract.py). - -### Timer jobs -UA client sets up a systemd timer to run jobs that need to be executed recurrently. -The timer itself ticks every 6 hours on average, and decides which jobs need -to be executed based on their _intervals_. - -Jobs are executed by the timer script if: -- The script has not yet run successfully, or -- Their interval since last successful run is already exceeded. - -There is a random delay applied to the timer, to desynchronize job execution time -on machines spun at the same time, avoiding multiple synchronized calls to the -same service. - -Current jobs being checked and executed are: - -| Job | Description | Interval | -| --- | ----------- | -------- | -| update_messaging | Update MOTD and APT messages | 6 hours | -| update_status | Update UA status | 12 hours | -| metering | (Only when attached to UA services) Pings Canonical servers for contract metering | 4 hours | - -- The `update_messaging` job makes sure that the MOTD and APT messages match the -available/enabled services on the system, showing information about available -packages or security updates. See [MOTD messages](./docs/howtoguides/update_motd_messages.md). -- The `update_status` job makes sure the `ua status` command will have the latest -information even when executed by a non-root user, updating the -`/var/lib/ubuntu-advantage/status.json` file. - -The timer intervals can be changed using the `ua config set` command. -```bash -# Make the update_status job run hourly -$ sudo ua config set update_status_timer=3600 -``` -Setting an interval to zero disables the job. -```bash -# Disable the update_status job -$ sudo ua config set update_status_timer=0 -``` - -## Directory layout -The following describes the intent of UA client related directories: - - -| File/Directory | Intent | -| -------- | -------- | -| ./tools | Helpful scripts used to publish, release or test various aspects of UA client | -| ./features/ | Behave BDD integration tests for UA Client -| ./uaclient/ | collection of python modules which will be packaged into ubuntu-advantage-tools package to deliver the UA Client CLI | -| uaclient.entitlements | Service-specific \*Entitlement class definitions which perform enable, disable, status, and entitlement operations etc. All classes derive from base.py:UAEntitlement and many derive from repo.py:RepoEntitlement | -| ./uaclient/cli.py | The entry-point for the command-line client -| ./uaclient/clouds/ | Cloud-platform detection logic used in Ubuntu Pro to determine if a given should be auto-attached to a contract | -| uaclient.contract | Module for interacting with the Contract Server API | -| ./demo | Various stale developer scripts for setting up one-off demo environments. (Not needed often) -| ./apt-hook/ | the C++ apt-hook delivering MOTD and apt command notifications about UA support services | -| ./apt-conf.d/ | apt config files delivered to /etc/apt/apt-conf.d to automatically allow unattended upgrades of ESM security-related components. If apt proxy settings are configured, an additional apt config file will be placed here to configure the apt proxy. | -| /etc/ubuntu-advantage/uaclient.conf | Configuration file for the UA client.| -| /var/lib/ubuntu-advantage/private | `root` read-only directory containing Contract API responses, machine-tokens and service credentials | -| /var/log/ubuntu-advantage.log | `root` read-only log of ubuntu-advantage operations | - - -## Collecting logs -The `ua collect-logs` command creates a tarball with all relevant data for debugging possible problems with UA. It puts together: -- The UA Client configuration file (the default is `/etc/ubuntu-advantage/uaclient.conf`) -- The UA Client log files (the default is `/var/log/ubuntu-advantage*`) -- The files in `/etc/apt/sources.list.d/*` related to UA -- Output of `systemctl status` for the UA Client related services -- Status of the timer jobs, `canonical-livepatch`, and the systemd timers -- Output of `cloud-id`, `dmesg` and `journalctl` - -Sensitive data is redacted from all files included in the tarball. As of now, the command must be run as root. - -Running the command creates a `ua_logs.tar.gz` file in the current directory. -The output file path/name can be changed using the `-o` option. - -## Testing - -All unit and lint tests are run using `tox`. We also use `tox-pip-version` to specify an older pip version as a workaround: we have some required dependencies that can't meet the strict compatibility checks of current pip versions. - -First, install `tox` and `tox-pip-version` - you'll only have to do this once. - -```shell -make testdeps -``` - -Then you can run the unit and lint tests: - -```shell -tox -``` - -The client also includes built-in dep8 tests. These are run as follows: - -```shell -autopkgtest -U --shell-fail . -- lxd ubuntu:xenial -``` - -### Integration Tests - -ubuntu-advantage-client uses [behave](https://behave.readthedocs.io) -for its integration testing. - -The integration test definitions are stored in the `features/` -directory and consist of two parts: `.feature` files that define the -tests we want to run, and `.py` files which implement the underlying -logic for those tests. - -By default, integration tests will do the folowing on a given cloud platform: - * Launch an instance running latest daily image of the target Ubuntu release - * Add the Ubuntu advantage client daily build PPA: [ppa:ua-client/daily](https://code.launchpad.net/~ua-client/+archive/ubuntu/daily) - * Install the appropriate ubuntu-advantage-tools and ubuntu-advantage-pro deb - * Run the integration tests on that instance. - -The testing can be overridden to run using a local copy of the ubuntu-advantage-client source code instead of the daily PPA by providing the following environment variable to the behave test runner: -```UACLIENT_BEHAVE_BUILD_PR=1``` - -> Note that, by default, we cache the source even when `UACLIENT_BEHAVE_BUILD_PR=1`. This means that if you change the python code locally and want to run the behave tests against your new version, you need to either delete the cache (`rm /tmp/pr_source.tar.gz`) or also set `UACLIENT_BEHAVE_CACHE_SOURCE=0`. - -To run the tests, you can use `tox`: - -```shell -tox -e behave-lxd-20.04 -``` - -or, if you just want to run a specific file, or a test within a file: - -```shell -tox -e behave-lxd-20.04 features/unattached_commands.feature -tox -e behave-lxd-20.04 features/unattached_commands.feature:55 -``` - -As can be seen, this will run behave tests only for release 20.04 (Focal Fossa). We are currently -supporting 5 distinct releases: - -* 22.04 (Jammy Jellyfish) -* 21.10 (Impish Indri) -* 20.04 (Focal Fossa) -* 18.04 (Bionic Beaver) -* 16.04 (Xenial Xerus) - -Therefore, to change which release to run the behave tests against, just change the release version -on the behave command. - -Furthermore, when developing/debugging a new scenario: - - 1. Add a `@wip` tag decorator on the scenario - 2. To only run @wip scenarios run: `tox -e behave-lxd-20.04 -- -w` - 3. If you want to use a debugger: - 1. Add ipdb to integration-requirements.txt - 2. Add ipdb.set_trace() in the code block you wish to debug - -(If you're getting started with behave, we recommend at least reading -through [the behave -tutorial](https://behave.readthedocs.io/en/latest/tutorial.html) to get -an idea of how it works, and how tests are written.) - -#### Iterating Locally +Developer documentation for the Ubuntu Advantage Client project. The topics cover +from the architecture of the project to how you should test any code changes. -To make running the tests repeatedly less time-intensive, our behave -testing setup has support for reusing images between runs via two -configuration options (provided in environment variables), -`UACLIENT_BEHAVE_IMAGE_CLEAN` and `UACLIENT_BEHAVE_REUSE_IMAGE`. +### How to Guides -To avoid the test framework cleaning up the image it creates, you can -run it like this: +* [How to build UA](./dev-docs/howtoguides/building.md) +* [How to run the code formatting tools](./dev-docs/howtoguides/code_formatting.md) +* [How to run the tests](./dev-docs/howtoguides/testing.md) +* [How to release a new version of UA](./dev-docs/howtoguides/how_to_release_a_new_version_of_ua.md) -```sh -UACLIENT_BEHAVE_IMAGE_CLEAN=0 tox -e behave -``` - -which will emit a line like this above the test summary: - -``` -Image cleanup disabled, not deleting: behave-image-1572443113978755 -``` - -You can then reuse that image by plugging its name into your next test -run, like so: - -```sh -UACLIENT_BEHAVE_REUSE_IMAGE=behave-image-1572443113978755 tox -e behave -``` - -If you've done this correctly, you should see something like -`reuse_image = behave-image-1572443113978755` in the "Config options" -output, and test execution should start immediately (without the usual -image build step). - -(Note that this handling is specific to our behave tests as it's -performed in `features/environment.py`, so don't expect to find -documentation about it outside of this codebase.) - -For development purposes there is `reuse_container` option. -If you would like to run behave tests in an existing container -you need to add `-D reuse_container=container_name`: - -```sh -tox -e behave -D reuse_container=container_name -``` - -#### Optimizing total run time of integration tests with snapshots -When `UACLIENT_BEHAVE_SNAPSHOT_STRATEGY=1` we create a snapshot of an instance -with ubuntu-advantage-tools installed and restore from that snapshot for all tests. -This adds an upfront cost that is amortized across several test scenarios. - -Based on some rough testing in July 2021, these are the situations -when you should set UACLIENT_BEHAVE_SNAPSHOT_STRATEGY=1 - -> At time of writing, starting a lxd.vm instance from a local snapshot takes -> longer than starting a fresh lxd.vm instance and installing ua. - -| machine_type | condition | -| ------------- | ------------------ | -| lxd.container | num_scenarios > 7 | -| lxd.vm | never | -| gcp | num_scenarios > 5 | -| azure | num_scenarios > 14 | -| aws | num_scenarios > 11 | - -#### Integration testing on EC2 -The following tox environments allow for testing focal on EC2: - -``` - # To test ubuntu-pro-images - tox -e behave-awspro-20.04 - # To test Canonical cloud images (non-ubuntu-pro) - tox -e behave-awsgeneric-20.04 -``` - -To run the test for a different release, just update the release version string. For example, -to run AWS pro xenial tests, you can run: - -``` -tox -e behave-awspro-16.04 -``` - -In order to run EC2 tests the following environment variables are required: - - UACLIENT_BEHAVE_AWS_ACCESS_KEY_ID - - UACLIENT_BEHAVE_AWS_SECRET_ACCESS_KEY - - -To specifically run non-ubuntu pro tests using canonical cloud-images an -additional token obtained from https://ubuntu.com/advantage needs to be set: - - UACLIENT_BEHAVE_CONTRACT_TOKEN= - -By default, the public AMIs for Ubuntu Pro testing used for each Ubuntu -release are defined in features/aws-ids.yaml. These ami-ids are determined by -running `./tools/refresh-aws-pro-ids`. - -Integration tests will read features/aws-ids.yaml to determine which default -AMI id to use for each supported Ubuntu release. - -To update `features/aws-ids.yaml`, run `./tools/refresh-aws-pro-ids` and put up -a pull request against this repo to updated that content from the ua-contracts -marketplace definitions. - -* To manually run EC2 integration tests using packages from `ppa:ua-client/daily` provide the following environment vars: - -```sh -UACLIENT_BEHAVE_AWS_ACCESS_KEY_ID= UACLIENT_BEHAVE_AWS_SECRET_KEY= tox -e behave-awspro-20.04 -``` - -* To manually run EC2 integration tests with a specific AMI Id provide the -following environment variable to launch your specfic AMI instead of building -a daily ubuntu-advantage-tools image. -```sh -UACLIENT_BEHAVE_REUSE_IMAGE=your-custom-ami tox -e behave-awspro-20.04 -``` - -#### Integration testing on Azure -The following tox environments allow for testing focal on Azure: - -``` - # To test ubuntu-pro-images - tox -e behave-azurepro-20.04 - # To test Canonical cloud images (non-ubuntu-pro) - tox -e behave-azuregeneric-20.04 -``` - -To run the test for a different release, just update the release version string. For example, -to run Azure pro xenial tests, you can run: - -``` -tox -e behave-azurepro-16.04 -``` - -In order to run Azure tests the following environment variables are required: - - UACLIENT_BEHAVE_AZ_CLIENT_ID - - UACLIENT_BEHAVE_AZ_CLIENT_SECRET - - UACLIENT_BEHAVE_AZ_SUBSCRIPTION_ID - - UACLIENT_BEHAVE_AZ_TENANT_ID - - -To specifically run non-ubuntu pro tests using canonical cloud-images an -additional token obtained from https://ubuntu.com/advantage needs to be set: - - UACLIENT_BEHAVE_CONTRACT_TOKEN= - -* To manually run Azure integration tests using packages from `ppa:ua-client/daily` provide the following environment vars: - -```sh -UACLIENT_BEHAVE_AZ_CLIENT_ID= UACLIENT_BEHAVE_AZ_CLIENT_SECRET= UACLIENT_BEHAVE_AZ_SUBSCRIPTION_ID= UACLIENT_BEHAVE_AZ_TENANT_ID= tox -e behave-azurepro-20.04 -``` - -* To manually run Azure integration tests with a specific Image Id provide the -following environment variable to launch your specfic Image Id instead of building -a daily ubuntu-advantage-tools image. -```sh -UACLIENT_BEHAVE_REUSE_IMAGE=your-custom-image-id tox -e behave-awspro-20.04 -``` - -## Building - -Packages ubuntu-advantage-tools and ubuntu-advantage-pro are created from the -debian/control file in this repository. You can build the -packages the way you would normally build a Debian package: - - -```shell -dpkg-buildpackage -us -uc -``` - -**Note** It will build the packages with dependencies for the Ubuntu release on -which you are building, so it's best to build in a container or kvm for the -release you are targeting. - -OR, if you want to build for a target release other than the release -you're on: - -### using sbuild -[configure sbuild](https://wiki.ubuntu.com/SimpleSbuild) and -use that for the build: - -Setup some chroots for sbuild with this script -```shell -bash ./tools/setup_sbuild.sh -``` - -```shell -debuild -S -sbuild --dist= ../ubuntu-advantage-tools_*.dsc -# emulating different architectures in sbuild-launchpad-chroot -sbuild-launchpad-chroot create --architecture="riscv64" "--name=focal-riscv64" "--series=focal -``` - -> Note: Every so often, it is recommended to update your chroots. -> ```bash -> # to update a single chroot -> sudo sbuild-launchpad-chroot update -n ua-xenial-amd64 -> # this script can be used to update all chroots -> sudo PATTERN=\* sh /usr/share/doc/sbuild/examples/sbuild-debian-developer-setup-update-all -> ``` - -### Setting up an lxc development container -```shell -lxc launch ubuntu-daily:xenial dev-x -c user.user-data="$(cat tools/ua-dev-cloud-config.yaml)" -lxc exec dev-x bash -``` - -### Setting up a kvm development environment with multipass -**Note:** There is a sample procedure documented in tools/multipass.md as well. -```shell -multipass launch daily:focal -n dev-f --cloud-init tools/ua-dev-cloud-config.yaml -multipass connect dev-f -``` - -## Code Formatting - -The `ubuntu-advantage-client` code base is formatted using -[black](https://github.com/psf/black), and imports are sorted with -[isort](https://github.com/PyCQA/isort). When making changes, you -should ensure that your code is blackened and isorted, or it will -be rejected by CI. -Formatting the whole codebase is as simple as running: - -```shell -black uaclient/ -isort uaclient/ -``` - -To make it easier to avoid committing incorrectly formatted code, this -repo includes configuration for [pre-commit](https://pre-commit.com/) -which will stop you from committing any code that isn't blackened. To -install the project's pre-commit hook, install `pre-commit` and run: - -```shell -pre-commit install -``` - -(To install `black` and `pre-commit` at the appropriate versions for -the project, you should install them via `dev-requirements.txt`.) - -## Daily Builds - -On Launchpad, there is a [daily build recipe](https://code.launchpad.net/~canonical-server/+recipe/ua-client-daily), -which will build the client and place it in the [ua-client-daily PPA](https://code.launchpad.net/~ua-client/+archive/ubuntu/daily). +### Reference -## Releasing ubuntu-advantage-tools -See [How to release a new version of UA](./contributing-docs/howtoguides/how_to_release_a_new_version_of_ua.md) +* [Terminology](./contributing-docs/references/terminology.md) +* [Architecture](./docs/references/architecture.md) +* [What happens during attach](./docs/references/what_happens_during_attach.md) +* [Enabling a service](./docs/references/enabling_a_service.md) +* [Directory layout](./docs/references/directory_layout.md) +* [Terminology](./dev-docs/references/terminology.md) +* [Architecture](./dev-docs/references/architecture.md) +* [What happens during attach](./dev-docs/references/what_happens_during_attach.md) +* [Enabling a service](./dev-docs/references/enabling_a_service.md) +* [Directory layout](./dev-docs/references/directory_layout.md) +* [Daily Builds](./dev-docs/references/daily_builds.md) +* [Version String Formatting](./contributing-docs/references/version_string_formatting.md) diff -Nru ubuntu-advantage-tools-27.9~18.04.1/debian/changelog ubuntu-advantage-tools-27.10.1~18.04.1/debian/changelog --- ubuntu-advantage-tools-27.9~18.04.1/debian/changelog 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/debian/changelog 2022-07-12 18:09:51.000000000 +0000 @@ -1,8 +1,37 @@ -ubuntu-advantage-tools (27.9~18.04.1) bionic; urgency=medium +ubuntu-advantage-tools (27.10.1~18.04.1) bionic; urgency=medium - * Backport new upstream release: (LP: #1973099) to bionic + * Backport new upstream release: (LP: #1980990) to bionic - -- Grant Orndorff Wed, 18 May 2022 15:44:17 -0400 + -- Lucas Moura Tue, 12 Jul 2022 15:09:51 -0300 + +ubuntu-advantage-tools (27.10.1~22.10.1) kinetic; urgency=medium + + * apt-hook: Fix missing import warning when compiling + + -- Lucas Moura Tue, 09 Aug 2022 14:03:14 -0300 + +ubuntu-advantage-tools (27.10~22.10.1) kinetic; urgency=medium + + * d/control: + - Drop golang dependencies + * d/rules: + - Only install APT hooks on LTS series + * New upstream release 27.10 (LP: #1980990) + - apt-hook: replace golang with cpp for json-hook + - cli + + properly sort services for detach/attach (GH: #1831) + + collect-logs include rotated log files + + display UA features directly on status + - daemon: do not try enabling daemon during auto-attach (LP: #1980865) + - fix: + + update ua portal url when asking for attach + + add --dry-run option + - gcp-pro: better error message for metadata endpoint error + - requests: Add default timeout for web requests + - timer: log when job start running + - security-status: include download size of package updates + + -- Lucas Moura Fri, 01 Jul 2022 11:51:13 -0300 ubuntu-advantage-tools (27.9~22.10.1) kinetic; urgency=medium diff -Nru ubuntu-advantage-tools-27.9~18.04.1/debian/control ubuntu-advantage-tools-27.10.1~18.04.1/debian/control --- ubuntu-advantage-tools-27.9~18.04.1/debian/control 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/debian/control 2022-07-12 18:09:51.000000000 +0000 @@ -14,13 +14,9 @@ debhelper (>= 13.3) | dh-systemd, gettext, git, -# We need golang>=1.14 to support riscv64 builds for Focal+ -# We always want to prefer the golang-go package, because it is not pinned to a certain version, so it is first. -# On Focal, golang-go is at 1.13 but golang-1.14-go is available, so that is second. -# Xenial and Bionic don't need to support riscv64, but do need to support our tests which require >=1.7. -# golang-1.10-go is available on both Xenial and Bionic, so that is third. - golang-go (>= 2:1.14~) [!powerpc] | golang-1.14-go [!powerpc] | golang-1.10-go [!powerpc !riscv64], libapt-pkg-dev, + libjson-c-dev, + libboost-test-dev, po-debconf, python3 (>= 3.4), python3-flake8, diff -Nru ubuntu-advantage-tools-27.9~18.04.1/debian/rules ubuntu-advantage-tools-27.10.1~18.04.1/debian/rules --- ubuntu-advantage-tools-27.9~18.04.1/debian/rules 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/debian/rules 2022-07-12 18:09:51.000000000 +0000 @@ -4,6 +4,7 @@ include /usr/share/dpkg/pkg-info.mk include /etc/os-release + # see https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/1840091/comments/3 # Bionic and Xenial each have older versions of distro-info that don't support @@ -32,7 +33,10 @@ override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) +# Hooks will only be delivered on LTS instances +ifeq (LTS,$(findstring LTS,$(VERSION))) make -C apt-hook test +endif python3 -m pytest python3 -m flake8 uaclient endif @@ -59,7 +63,15 @@ override_dh_auto_install: dh_auto_install --destdir=debian/ubuntu-advantage-tools flist=$$(find $(CURDIR)/debian/ -type f -name version.py) && sed -i 's,@@PACKAGED_VERSION@@,$(DEB_VERSION),' $${flist:-did-not-find-version-py-for-replacement} + + # We install the conf file even on non-LTS version to avoid issues on upgrade scenarios + make -C apt-hook DESTDIR=$(CURDIR)/debian/ubuntu-advantage-tools install-conf + +# Hooks will only be delivered on LTS instances +ifeq (LTS,$(findstring LTS,$(VERSION))) make -C apt-hook DESTDIR=$(CURDIR)/debian/ubuntu-advantage-tools install +endif + # We want to guarantee that we are not shipping any conftest files find $(CURDIR)/debian/ubuntu-advantage-tools -type f -name conftest.py -delete diff -Nru ubuntu-advantage-tools-27.9~18.04.1/debian/ubuntu-advantage-tools.postinst ubuntu-advantage-tools-27.10.1~18.04.1/debian/ubuntu-advantage-tools.postinst --- ubuntu-advantage-tools-27.9~18.04.1/debian/ubuntu-advantage-tools.postinst 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/debian/ubuntu-advantage-tools.postinst 2022-07-12 18:09:51.000000000 +0000 @@ -54,7 +54,6 @@ REBOOT_CMD_MARKER_FILE="/var/lib/ubuntu-advantage/marker-reboot-cmds-required" OLD_LICENSE_CHECK_MARKER_FILE="/var/lib/ubuntu-advantage/marker-license-check" -MACHINE_TOKEN_FILE="/var/lib/ubuntu-advantage/private/machine-token.json" # Rename apt config files for ua services removing ubuntu release names redact_ubuntu_release_from_ua_apt_filenames() { diff -Nru ubuntu-advantage-tools-27.9~18.04.1/dev-docs/howtoguides/building.md ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/howtoguides/building.md --- ubuntu-advantage-tools-27.9~18.04.1/dev-docs/howtoguides/building.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/howtoguides/building.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,56 @@ +# Building + +Packages ubuntu-advantage-tools and ubuntu-advantage-pro are created from the +debian/control file in this repository. You can build the +packages the way you would normally build a Debian package: + + +```shell +dpkg-buildpackage -us -uc +``` + +> **Note** +> It will build the packages with dependencies for the Ubuntu release on +> which you are building, so it's best to build in a container or kvm for the +> release you are targeting. + +OR, if you want to build for a target release other than the release +you're on: + +## using sbuild +[configure sbuild](https://wiki.ubuntu.com/SimpleSbuild) and +use that for the build: + +Setup some chroots for sbuild with this script +```shell +bash ./tools/setup_sbuild.sh +``` + +```shell +debuild -S +sbuild --dist= ../ubuntu-advantage-tools_*.dsc +# emulating different architectures in sbuild-launchpad-chroot +sbuild-launchpad-chroot create --architecture="riscv64" "--name=focal-riscv64" "--series=focal +``` + +> **Note** +> Every so often, it is recommended to update your chroots. +> ```bash +> # to update a single chroot +> sudo sbuild-launchpad-chroot update -n ua-xenial-amd64 +> # this script can be used to update all chroots +> sudo PATTERN=\* sh /usr/share/doc/sbuild/examples/sbuild-debian-developer-setup-update-all +> ``` + +## Setting up an lxc development container +```shell +lxc launch ubuntu-daily:xenial dev-x -c user.user-data="$(cat tools/ua-dev-cloud-config.yaml)" +lxc exec dev-x bash +``` + +## Setting up a kvm development environment with multipass +**Note:** There is a sample procedure documented in tools/multipass.md as well. +```shell +multipass launch daily:focal -n dev-f --cloud-init tools/ua-dev-cloud-config.yaml +multipass connect dev-f +``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/dev-docs/howtoguides/code_formatting.md ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/howtoguides/code_formatting.md --- ubuntu-advantage-tools-27.9~18.04.1/dev-docs/howtoguides/code_formatting.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/howtoguides/code_formatting.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,25 @@ +# Code Formatting + +The `ubuntu-advantage-client` code base is formatted using +[black](https://github.com/psf/black), and imports are sorted with +[isort](https://github.com/PyCQA/isort). When making changes, you +should ensure that your code is blackened and isorted, or it will +be rejected by CI. +Formatting the whole codebase is as simple as running: + +```shell +black uaclient/ +isort uaclient/ +``` + +To make it easier to avoid committing incorrectly formatted code, this +repo includes configuration for [pre-commit](https://pre-commit.com/) +which will stop you from committing any code that isn't blackened. To +install the project's pre-commit hook, install `pre-commit` and run: + +```shell +pre-commit install +``` + +(To install `black` and `pre-commit` at the appropriate versions for +the project, you should install them via `dev-requirements.txt`.) diff -Nru ubuntu-advantage-tools-27.9~18.04.1/dev-docs/howtoguides/how_to_release_a_new_version_of_ua.md ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/howtoguides/how_to_release_a_new_version_of_ua.md --- ubuntu-advantage-tools-27.9~18.04.1/dev-docs/howtoguides/how_to_release_a_new_version_of_ua.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/howtoguides/how_to_release_a_new_version_of_ua.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,203 @@ +# Ubuntu Advantage Client Releases + +## Background + +The release process for ubuntu-advantage-tools has three overarching steps/goals. + +1. Release to our team infrastructure. This includes Github and the `ua-client` PPAs. +2. Release to the latest ubuntu devel release. +3. Release to the supported ubuntu past releases via [SRU](https://wiki.ubuntu.com/StableReleaseUpdates) using the [ubuntu-advantage-tools specific SRU process](https://wiki.ubuntu.com/UbuntuAdvantageToolsUpdates). + +Generally speaking, these steps happen in order, but there is some overlap. Also we may backtrack if issues are found part way through the process. + +An average release should take somewhere between 10 and 14 calendar days if things go smoothly, starting at the decision to release and ending at the new version being available in all supported ubuntu releases. Note that it is not 2 weeks of full time work. Most of the time is spent waiting for review or sitting in proposed. + +## Prerequisites + +If this is your first time releasing ubuntu-advantage-tools, you'll need to do the following before getting started: + +* Add the team helper scripts to your PATH: [uss-tableflip](https://github.com/canonical/uss-tableflip). +* If you don't yet have a gpg key set up, follow the instructions + [here](https://help.launchpad.net/YourAccount/ImportingYourPGPKey) to create a key, + publish it to `hkp://keyserver.ubuntu.com`, and import it into Launchpad. +* Before you run `sbuild-it` for the first time, you'll need to set up a chroot for each Ubuntu release. + Run the following to set up chroots with dependencies pre-installed for each release: + ```bash + apt-get install sbuild-launchpad-chroot + bash ./tools/setup_sbuild.sh # This will give you usage information on how to call it with the correct parameters + ``` +* You must have launchpad already properly configured in your system in order to upload packages to the PPAs. Follow [this guide](https://help.launchpad.net/Packaging/PPA/Uploading) to get set up. + +## I. Preliminary/staging release to team infrastructure +1. Create a release PR + + a. Move the desired commits from our `main` branch onto the desired release branch + + * This step is currently not well defined. We currently are using `release-27` for all `27.X` releases and have been cherry-picking/rebasing all commits from `main` into this branch for a release. + + b Create a new entry in the `debian/changelog` file: + + * You can do that by running `dch --newversion ` + * Remember to update the release from `UNRELEASED` to the ubuntu/devel release. Edit the version to look like: `27.2~21.10.1`, with the appropriate ua and ubuntu/devel version numbers. + * Populate `debian/changelog` with the commits you have cherry-picked + * You can do that by running `git log .. | log2dch` + * This will generate a list of commits that could be included in the changelog. + * You don't need to include all of the commits generated. Remember that the changelog should + be read by the user to understand the new features/modifications in the package. If you + think a commit will not add that much to the user experience, you can drop it from the + changelog + * To structure the changelog you can use the other entries as example. But we basically try to + keep this order: debian changes, new features/modifications, testing. Within each section, bullet points should be alphabetized. + + c. Create a PR on github into the release branch. Ask in the UA channel on mattermost for review. + + d. When reviewing the release PR, please use the following guidelines when reviewing the new changelog entry: + + * Is the version correctly updated ? We must ensure that the new version on the changelog is + correct and it also targets the latest Ubuntu release at the moment. + * Is the entry useful for the user ? The changelog entries should be user focused, meaning + that we should only add entries that we think users will care about (i.e. we don't need + entries when fixing a test, as this doesn't provide meaningful information to the user) + * Is this entry redundant ? Sometimes we may have changes that affect separate modules of the + code. We should have an entry only for the module that was most affected by it + * Is the changelog entry unique ? We need to verify that the changelog entry is not already + reflected in an earlier version of the changelog. If it is, we need not only to remove but double + check the process we are using to cherry-pick the commits + * Is this entry actually reflected on the code ? Sometimes, we can have changelog entries + that are not reflected in the code anymore. This can happen during development when we are + still unsure about the behavior of a feature or when we fix a bug that removes the code + that was added. We must verify each changelog entry that is added to be sure of their + presence in the product. + +2. After the release PR is merged, tag the head of the release branch with the version number, e.g. `27.1`. Push this tag to Github. + +3. Build the package for all Ubuntu releases and upload to `ppa:ua-client/staging` + + a. Clone the repository in a clean directory and switch to the release branch + * *WARNING* Build the package in a clean environment. The reason is that the package + will contain everything that it is present in the folder. If you are storing credentials or + other sensible development information in your folder, they will be uploaded too when we send + the package to the ppa. A clean environment is the safest way to perform this. + + b. Edit the changelog: + * List yourself as the author of this release. + * Edit the version number to look like: `27.2~20.04.1~rc1` (`~.~rc`) + * Edit the ubuntu release name. Start with the ubuntu/devel release. + * `git add debian/changelog && git commit -m "throwaway"` Do **not** push this commit! + + c. `build-package` + * This script will generate all the package artifacts in the parent directory as `../out`. + + d. `sbuild-it ../out/.dsc` + * If this succeeds move on. If this fails, debug and fix before continuing. + + e. Repeat 3.b through 3.d for all supported Ubuntu Releases + * PS: remember to also change the version number on the changelog. For example, suppose + the new version is `1.1~20.04.1~rc1`. If you want to test Bionic now, change it to + `1.1~18.04.1~rc1`. + + f. For each release, dput to the staging PPA: + * `dput ppa:ua-client/staging ../out/_source.changes` + * After each `dput` wait for the "Accepted" email from Launchpad before moving on. + +## II. Release to Ubuntu (devel and SRU) + +> Note: `kinetic` is used throughout as a reference to the current devel release. This will change. + +1. Prepare SRU Launchpad bugs. + + a. We do this even before a succesful merge into ubuntu/devel because the context added to these bugs is useful for the Server Team reviewer. + + b. Create a new bug on Launchpad for ubuntu-advantage-tools and use the format defined [here](https://wiki.ubuntu.com/UbuntuAdvantageToolsUpdates#SRU_Template) for the description. + * The title should be in the format `[SRU] ubuntu-advantage-tools (27.1 -> 27.2) Xenial, Bionic, Focal, Jammy`, substituting version numbers and release names as necessary. + + c. For each Launchpad bug fixed by this release (which should all be referenced in our changelog), add the SRU template to the description and fill out each section. + * Leave the original description in the bug at the bottom under the header `[Original Description]`. + * For the testing steps, include steps to reproduce the bug. Then include instructions for adding `ppa:ua-client/staging`, and steps to verify the bug is no longer present. + +2. Set up the Merge Proposal (MP) for ubuntu/devel + + a. `git-ubuntu clone ubuntu-advantage-tools; cd ubuntu-advantage-tools` + + b. `git remote add upstream git@github.com:canonical/ubuntu-advantage-client.git` + + c. `git fetch upstream` + + d. `git rebase --onto pkg/ubuntu/devel ` + * e.g. `git rebase --onto pkg/ubuntu/devel 27.0.2 27.1` + * You may need to resolve conflicts, but hopefully these will be minimal. + * You'll end up in a detached state + + e. `git checkout -B upload--kinetic` + * This creates a new local branch name based on your detached branch + + f. Make sure the changelog version contains the release version in the name (For example, `27.1~22.10.1`) + + g. `git push upload--kinetic` + + h. On Launchpad, create a merge proposal for this version which targets `ubuntu/devel` + * For an example, see the [27.9 merge proposal](https://code.launchpad.net/~orndorffgrant/ubuntu/+source/ubuntu-advantage-tools/+git/ubuntu-advantage-tools/+merge/422906) + * Add 2 review slots for `canonical-server-reporter` and `canonical-server-core-reviewers` + +4. Server Team Review and Pre-SRU Review + + a. Ask the assigned ubuntu-advantage-tools reviewer/sponsor from Server team for a review of your MPs (If you don't know who that is, ask in ~Server). Include a link to the MP into ubuntu/devel and to the SRU bug. + + b. If they request changes, create a PR into the release branch on github and ask UAClient team for review. After that is merged, cherry-pick the commit into your `upload--` branch and push to launchpad. Then notify the Server Team member that you have addressed their requests. + * Some issues may just be filed for addressing in the future if they are not urgent or pertinent to this release. + * Unless the changes are very minor, or only testing related, you should upload a new release candidate version to `ppa:ua-client/staging` as descibed in I.3. + * After the release is finished, any commits that were merged directly into the release branch in this way should be brought back into `main` via a single PR. + + c. Once review is complete and approved, the Server Team member should **not** upload the version to the devel release. + * If they do, then any changes to the code after this point will require a bump in the patch version of the release. + + d. Now ask the SRU team for a pre-SRU review of the same MP. Mention that the exact same code will be released to all stable Ubuntu releases. + * Follow instructions in `II.4.b` if they request any changes. + + e. Once the SRU team member gives a pre-SRU approval, create the branches for each stable release. They should be named `upload--`. + * If you've followed the instructions precisely so far, you can just run `bash tools/create-lp-release-branches.sh`. + + f. Ask Server team member sponsor to upload to devel, and then the SRU proposed queue using the stable release branches you just created. + * Ask them to tag the PR with the appropriate `upload/` tag so git-ubuntu will import rich commit history. + * If they do not have upload rights to the proposed queue, ask in ~Server channel for a Ubuntu Server team member with upload rights for an upload review of the MP for the proposed queue. + + g. Check the [-proposed release queue](https://launchpad.net/ubuntu/xenial/+queue?queue_state=1&queue_text=ubuntu-advantage-tools) for presence of ubuntu-advantage-tools in unapproved state for each supported release. Note: libera chat #ubuntu-release IRC channel has a bot that reports queued uploads of any package in a message like "Unapproved: ubuntu-advantage-tools .. version". + + h. Tell the SRU team member who performed the pre-SRU review that the packages are in the -proposed release queue. They will need to actually approve the package to move into -proposed. + +5. -proposed verification and release to -updates + + a. As soon as the SRU vanguard approves the packages, a bot in #ubuntu-release will announce that ubuntu-advantage-tools is accepted into the applicable -proposed pockets, or the [Xenial -proposed release rejection queue](https://launchpad.net/ubuntu/xenial/+queue?queue_state=4&queue_text=ubuntu-advantage-tools) will contain a reason for rejections. Double check the SRU process bug for any actionable review feedback. + * Once accepted into `-proposed` by an SRU vanguard [ubuntu-advantage-tools shows up in the pending_sru page](https://people.canonical.com/~ubuntu-archive/pending-sru.html), check `rmadison ubuntu-advantage-tools | grep -proposed` to see if the upload exists in -proposed yet. + * Also actually check that the packages are accessible in a container by [enabling proposed](https://wiki.ubuntu.com/Testing/EnableProposed) and updating the package. + + b. With the package in proposed, perform the steps from `I.3` above but use a `~stableppaX` suffix instead of `~rcX` in the version name, and upload to `ppa:ua-client/stable` instead of staging. + + c. Perform the [Ubuntu-advantage-client SRU verification steps](https://wiki.ubuntu.com/UbuntuAdvantageToolsUpdates). This typically involves running all behave targets with `UACLIENT_BEHAVE_ENABLE_PROPOSED=1 UACLIENT_BEHAVE_CHECK_VERSION=` and saving the output. + * There may also be one-time test scripts added in the `sru/` directory for this release + + d. After all tests have passed, tarball all of the output files and upload them to the SRU bug with a message that looks like this: + ``` + We have run the full ubuntu-advantage-tools integration test suite against the version in -proposed. The results are attached. All tests passed. + + You can verify the correct version was used by checking the output of the first test in each file, which prints the version number. + + I am marking the verification done for this SRU. + ``` + Change the tags on the bug from `verification-needed` to `verification-done` (including the verification tags for each ubuntu release). + + e. For any other related Launchpad bugs that are fixed in this release. Perform the verification steps necessary for those bugs and mark them `verification-done` as needed. This will likely involve following the test steps, but instead of adding the staging PPA, enabling -proposed. + + f. Once all SRU bugs are tagged as `verification*-done`, all SRU-bugs should be listed as green in [the pending_sru page](https://people.canonical.com/~ubuntu-archive/pending-sru.html). + + g. After the pending sru page says that ubuntu-advantage-tools has been in proposed for 7 days, it is now time to ping the [current SRU vanguard](https://wiki.ubuntu.com/StableReleaseUpdates#Publishing) for acceptance of ubuntu-advantage-tools into -updates. + + h. Check `rmadison ubuntu-advantage-tools` for updated version in -updates + * Also actually check that the packages are accessible in a container and updating the package. + +## III. Post-release Updates + +1. Ensure the version tag is correct on github. The `version` git tag should point to the commit that was released as that version to ubuntu -updates. If changes were made in response to feedback during the release process, the tag may have to be moved. +2. Bring in any changes that were made to the release branch into `main` via PR (e.g. Changelog edits). +3. Move any scripts added in `sru/` to a new folder in `sru/_archive` for the release. +4. Tell CPC that there is a new version of `ubuntu-advantage-tools` in -updates for all series. diff -Nru ubuntu-advantage-tools-27.9~18.04.1/dev-docs/howtoguides/testing.md ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/howtoguides/testing.md --- ubuntu-advantage-tools-27.9~18.04.1/dev-docs/howtoguides/testing.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/howtoguides/testing.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,252 @@ +# Testing +All unit and lint tests are run using `tox`, with different versions of Python with specific constraints. We also use `tox-setuptools-version` to specify the correct setuptools version based on what is present in each release, and `tox-pyenv` to recognize the different local [pyenv interpreters](https://github.com/pyenv/pyenv). + +First, run the script to install and configure `pyenv`, and the `tox` dependencies: + +```shell +./tools/setup_pyenv.sh +``` + +After that you need to [set up your shell environment](https://github.com/pyenv/pyenv#set-up-your-shell-environment-for-pyenv), according to the pyenv documentation. +The guide has quick snippets to configure `bash`, `zsh` and `fish` shells. + +Refresh your terminal to make sure pyenv is working. Then you can run the unit and lint tests: + +```shell +tox +``` + +The client also includes built-in dep8 tests. These are run as follows: + +```shell +autopkgtest -U --shell-fail . -- lxd ubuntu:xenial +``` + +## Integration Tests + +ubuntu-advantage-client uses [behave](https://behave.readthedocs.io) +for its integration testing. + +The integration test definitions are stored in the `features/` +directory and consist of two parts: `.feature` files that define the +tests we want to run, and `.py` files which implement the underlying +logic for those tests. + +By default, integration tests will do the following on a given cloud platform: + * Launch an instance running latest daily image of the target Ubuntu release + * Add the Ubuntu advantage client daily build PPA: [ppa:ua-client/daily](https://code.launchpad.net/~ua-client/+archive/ubuntu/daily) + * Install the appropriate ubuntu-advantage-tools and ubuntu-advantage-pro deb + * Run the integration tests on that instance. + +The testing can be overridden to run using a local copy of the ubuntu-advantage-client source code instead of the daily PPA by providing the following environment variable to the behave test runner: +```UACLIENT_BEHAVE_BUILD_PR=1``` + +> Note that, by default, we cache the source even when `UACLIENT_BEHAVE_BUILD_PR=1`. This means that if you change the python code locally and want to run the behave tests against your new version, you need to either delete the cache (`rm /tmp/uaclient_behave`) or also set `UACLIENT_BEHAVE_CACHE_SOURCE=0`. + +To run the tests, you can use `tox`: + +```shell +tox -e behave-lxd-20.04 +``` + +or, if you just want to run a specific file, or a test within a file: + +```shell +tox -e behave-lxd-20.04 features/unattached_commands.feature +tox -e behave-lxd-20.04 features/unattached_commands.feature:55 +``` + +As can be seen, this will run behave tests only for release 20.04 (Focal Fossa). We are currently +supporting 5 distinct releases: + +* 22.04 (Jammy Jellyfish) +* 21.10 (Impish Indri) +* 20.04 (Focal Fossa) +* 18.04 (Bionic Beaver) +* 16.04 (Xenial Xerus) + +Therefore, to change which release to run the behave tests against, just change the release version +on the behave command. + +Furthermore, when developing/debugging a new scenario: + + 1. Add a `@wip` tag decorator on the scenario + 2. To only run @wip scenarios run: `tox -e behave-lxd-20.04 -- -w` + 3. If you want to use a debugger: + 1. Add ipdb to integration-requirements.txt + 2. Add ipdb.set_trace() in the code block you wish to debug + +(If you're getting started with behave, we recommend at least reading +through [the behave +tutorial](https://behave.readthedocs.io/en/latest/tutorial.html) to get +an idea of how it works, and how tests are written.) + +## Iterating Locally + +To make running the tests repeatedly less time-intensive, our behave +testing setup has support for reusing images between runs via two +configuration options (provided in environment variables), +`UACLIENT_BEHAVE_IMAGE_CLEAN` and `UACLIENT_BEHAVE_REUSE_IMAGE`. + +To avoid the test framework cleaning up the image it creates, you can +run it like this: + +```sh +UACLIENT_BEHAVE_IMAGE_CLEAN=0 tox -e behave +``` + +which will emit a line like this above the test summary: + +``` +Image cleanup disabled, not deleting: behave-image-1572443113978755 +``` + +You can then reuse that image by plugging its name into your next test +run, like so: + +```sh +UACLIENT_BEHAVE_REUSE_IMAGE=behave-image-1572443113978755 tox -e behave +``` + +If you've done this correctly, you should see something like +`reuse_image = behave-image-1572443113978755` in the "Config options" +output, and test execution should start immediately (without the usual +image build step). + +(Note that this handling is specific to our behave tests as it's +performed in `features/environment.py`, so don't expect to find +documentation about it outside of this codebase.) + +For development purposes there is `reuse_container` option. +If you would like to run behave tests in an existing container +you need to add `-D reuse_container=container_name`: + +```sh +tox -e behave -D reuse_container=container_name +``` + +## Optimizing total run time of integration tests with snapshots +When `UACLIENT_BEHAVE_SNAPSHOT_STRATEGY=1` we create a snapshot of an instance +with ubuntu-advantage-tools installed and restore from that snapshot for all tests. +This adds an upfront cost that is amortized across several test scenarios. + +Based on some rough testing in July 2021, these are the situations +when you should set UACLIENT_BEHAVE_SNAPSHOT_STRATEGY=1 + +> At time of writing, starting a lxd.vm instance from a local snapshot takes +> longer than starting a fresh lxd.vm instance and installing ua. + +| machine_type | condition | +| ------------- | ------------------ | +| lxd.container | num_scenarios > 7 | +| lxd.vm | never | +| gcp | num_scenarios > 5 | +| azure | num_scenarios > 14 | +| aws | num_scenarios > 11 | + +## Integration testing on EC2 +The following tox environments allow for testing focal on EC2: + +``` + # To test ubuntu-pro-images + tox -e behave-awspro-20.04 + # To test Canonical cloud images (non-ubuntu-pro) + tox -e behave-awsgeneric-20.04 +``` + +To run the test for a different release, just update the release version string. For example, +to run AWS pro xenial tests, you can run: + +``` +tox -e behave-awspro-16.04 +``` + +In order to run EC2 tests, please set up the [pycloudlib toml +file](https://github.com/canonical/pycloudlib/blob/main/pycloudlib.toml.template) with +the required EC2 credentials. + +To specifically run non-ubuntu pro tests using canonical cloud-images an +additional token obtained from https://ubuntu.com/advantage needs to be set: + - UACLIENT_BEHAVE_CONTRACT_TOKEN= + +By default, the public AMIs for Ubuntu Pro testing used for each Ubuntu +release are defined in features/aws-ids.yaml. These ami-ids are determined by +running `./tools/refresh-aws-pro-ids`. + +Integration tests will read features/aws-ids.yaml to determine which default +AMI id to use for each supported Ubuntu release. + +To update `features/aws-ids.yaml`, run `./tools/refresh-aws-pro-ids` and put up +a pull request against this repo to updated that content from the ua-contracts +marketplace definitions. + +* To manually run EC2 integration tests with a specific AMI Id provide the +following environment variable to launch your specific AMI instead of building +a daily ubuntu-advantage-tools image. +```sh +UACLIENT_BEHAVE_REUSE_IMAGE=your-custom-ami tox -e behave-awspro-20.04 +``` + +## Integration testing on Azure +The following tox environments allow for testing focal on Azure: + +``` + # To test ubuntu-pro-images + tox -e behave-azurepro-20.04 + # To test Canonical cloud images (non-ubuntu-pro) + tox -e behave-azuregeneric-20.04 +``` + +To run the test for a different release, just update the release version string. For example, +to run Azure pro xenial tests, you can run: + +``` +tox -e behave-azurepro-16.04 +``` + +In order to run Azure tests, please set up the [pycloudlib toml +file](https://github.com/canonical/pycloudlib/blob/main/pycloudlib.toml.template) with +the required Azure credentials. + +To specifically run non-ubuntu pro tests using canonical cloud-images an +additional token obtained from https://ubuntu.com/advantage needs to be set: + - UACLIENT_BEHAVE_CONTRACT_TOKEN= + +* To manually run Azure integration tests with a specific Image Id provide the +following environment variable to launch your specific Image Id instead of building +a daily ubuntu-advantage-tools image. +```sh +UACLIENT_BEHAVE_REUSE_IMAGE=your-custom-image-id tox -e behave-azurepro-20.04 +``` + +## Integration testing on GCP +The following tox environments allow for testing focal on GCP: + +``` + # To test ubuntu-pro-images + tox -e behave-gcppro-20.04 + # To test Canonical cloud images (non-ubuntu-pro) + tox -e behave-gcpgeneric-20.04 +``` + +To run the test for a different release, just update the release version string. For example, +to run GCP pro xenial tests, you can run: + +``` +tox -e behave-gcppro-16.04 +``` + +In order to run GCP tests, please set up the [pycloudlib toml +file](https://github.com/canonical/pycloudlib/blob/main/pycloudlib.toml.template) with +the required GCP credentials. + +To specifically run non-ubuntu pro tests using canonical cloud-images an +additional token obtained from https://ubuntu.com/advantage needs to be set: + - UACLIENT_BEHAVE_CONTRACT_TOKEN= + +* To manually run GCP integration tests with a specific Image Id provide the +following environment variable to launch your specific Image Id instead of building +a daily ubuntu-advantage-tools image. +```sh +UACLIENT_BEHAVE_REUSE_IMAGE=your-custom-image-id tox -e behave-gcppro-20.04 +``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/dev-docs/references/architecture.md ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/references/architecture.md --- ubuntu-advantage-tools-27.9~18.04.1/dev-docs/references/architecture.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/references/architecture.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,18 @@ +# Architecture + +Ubuntu Advantage client, hereafter "UA client", is a python3-based command line +utility. It provides a CLI to attach, detach, enable, +disable and check status of support related services. + +The package `ubuntu-advantage-tools` also provides a C++ APT hook which helps +advertise ESM service and available packages in MOTD and during various apt +commands. + +The `ubuntu-advantage-pro` package delivers auto-attach functionality via init +scripts and systemd services for various cloud platforms. + +By default, Ubuntu machines are deployed in an unattached state. A machine can +get manually or automatically attached to a specific contract by interacting +with the Contract Server REST API. Any change in state of services or machine +attach results in additional interactions with the Contract Server API to +validate such operations. diff -Nru ubuntu-advantage-tools-27.9~18.04.1/dev-docs/references/daily_builds.md ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/references/daily_builds.md --- ubuntu-advantage-tools-27.9~18.04.1/dev-docs/references/daily_builds.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/references/daily_builds.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,4 @@ +# Daily Builds + +On Launchpad, there is a [daily build recipe](https://code.launchpad.net/~canonical-server/+recipe/ua-client-daily), +which will build the client and place it in the [ua-client-daily PPA](https://code.launchpad.net/~ua-client/+archive/ubuntu/daily). diff -Nru ubuntu-advantage-tools-27.9~18.04.1/dev-docs/references/directory_layout.md ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/references/directory_layout.md --- ubuntu-advantage-tools-27.9~18.04.1/dev-docs/references/directory_layout.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/references/directory_layout.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,20 @@ +# Directory layout + +The following describes the intent of UA client related directories: + +| File/Directory | Intent | +| -------- | -------- | +| ./tools | Helpful scripts used to publish, release or test various aspects of UA client | +| ./features/ | Behave BDD integration tests for UA Client +| ./uaclient/ | collection of python modules which will be packaged into ubuntu-advantage-tools package to deliver the UA Client CLI | +| uaclient.entitlements | Service-specific \*Entitlement class definitions which perform enable, disable, status, and entitlement operations etc. All classes derive from base.py:UAEntitlement and many derive from repo.py:RepoEntitlement | +| ./uaclient/cli.py | The entry-point for the command-line client +| ./uaclient/clouds/ | Cloud-platform detection logic used in Ubuntu Pro to determine if a given should be auto-attached to a contract | +| uaclient.contract | Module for interacting with the Contract Server API | +| uaclient.messages | Module that contains the messages delivered by UA to the user | +| uaclient.security | Module that hold the logic used to run `ua fix` commands | +| ./apt-hook/ | the C++ apt-hook delivering MOTD and apt command notifications about UA support services | +| ./apt-conf.d/ | apt config files delivered to /etc/apt/apt-conf.d to automatically allow unattended upgrades of ESM security-related components. If apt proxy settings are configured, an additional apt config file will be placed here to configure the apt proxy. | +| /etc/ubuntu-advantage/uaclient.conf | Configuration file for the UA client.| +| /var/lib/ubuntu-advantage/private | `root` read-only directory containing Contract API responses, machine-tokens and service credentials | +| /var/log/ubuntu-advantage.log | `root` read-only log of ubuntu-advantage operations | diff -Nru ubuntu-advantage-tools-27.9~18.04.1/dev-docs/references/enabling_a_service.md ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/references/enabling_a_service.md --- ubuntu-advantage-tools-27.9~18.04.1/dev-docs/references/enabling_a_service.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/references/enabling_a_service.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,21 @@ +# Enabling a service + +Each service controlled by UA client will have a python module in +uaclient/entitlements/\*.py which handles setup and teardown of services when +enabled or disabled. + +If a contract entitles a machine to a service, `root` user can enable the +service with `ua enable `. If a service can be disabled +`ua disable ` will be permitted. + +The goal of the UA client is to remain simple and flexible and let the +contracts backend drive dynamic changes in contract offerings and constraints. +In pursuit of that goal, the UA client obtains most of it's service constraints +from a machine token that it obtains from the Contract Server API. + +The UA Client is simple in that it relies on the machine token on the attached +machine to describe whether a service is applicable for an environment and what +configuration is required to properly enable that service. + +Any interactions with the Contract server API are defined as UAContractClient +class methods in [uaclient/contract.py](../../uaclient/contract.py). diff -Nru ubuntu-advantage-tools-27.9~18.04.1/dev-docs/references/terminology.md ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/references/terminology.md --- ubuntu-advantage-tools-27.9~18.04.1/dev-docs/references/terminology.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/references/terminology.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,13 @@ +# Terminology + +The following vocabulary is used to describe different aspects of the work +Ubuntu Advantage Client performs: + +| Term | Meaning | +| -------- | -------- | +| UA Client | The python command line client represented in this ubuntu-advantage-client repository. It is installed on each Ubuntu machine and is the entry-point to enable any Ubuntu Advantage commercial service on an Ubuntu machine. | +| Contract Server | The backend service exposing a REST API to which UA Client authenticates in order to obtain contract and commercial service information and manage which support services are active on a machine.| +| Entitlement/Service | An Ubuntu Advantage commercial support service such as FIPS, ESM, Livepatch, CIS-Audit to which a contract may be entitled | +| Affordance | Service-specific list of applicable architectures and Ubuntu series on which a service can run | +| Directives | Service-specific configuration values which are applied to a service when enabling that service | +| Obligations | Service-specific policies that must be instrumented for support of a service. Example: `enableByDefault: true` means that any attached machine **MUST** enable a service on attach | diff -Nru ubuntu-advantage-tools-27.9~18.04.1/dev-docs/references/version_string_formatting.md ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/references/version_string_formatting.md --- ubuntu-advantage-tools-27.9~18.04.1/dev-docs/references/version_string_formatting.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/references/version_string_formatting.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,27 @@ +# Version string formatting + +Below are the versioning schemes used for publishing debs: + +| Build target | Version Format | +| --------------------------------------------------------------------------------- | ------------------------------------------ | +| [Daily PPA](https://code.launchpad.net/~canonical-server/+recipe/ua-client-daily) | `XX.YY-~g~ubuntu22.04.1` | +| Staging PPA | `XX.YY~22.04.1~rc1` | +| Stable PPA | `XX.YY~22.04.1~stableppa1` | +| Archive release | `XX.YY~22.04.1` | +| Archive bugfix release | `XX.YY.Z~22.04.1` | + +## Supported upgrade paths on same upstream version + +Regardless of source, the latest available "upstream version" (e.g. 27.4) will always be installed, because the upstream version comes first followed by a tilde in all version formats. + +This table demonstrates upgrade paths between sources for one particular upstream version. + +| Upgrade path | Version diff example | +| ------------------------------- | ----------------------------------------------------------------------- | +| Staging to Next Staging rev | `31.4~22.04.1~rc1` ➜ `31.4~22.04.1~rc2` | +| Staging to Stable | `31.4~22.04.1~rc2` ➜ `31.4~22.04.1~stableppa1` | +| Stable to Next Stable rev | `31.4~22.04.1~stableppa1` ➜ `31.4~22.04.1~stableppa2` | +| Stable to Archive | `31.4~22.04.1~stableppa2` ➜ `31.4~22.04.1` | +| LTS Archive to Next LTS Archive | `31.4~22.04.1` ➜ `31.4~24.04.1` | +| Archive to Daily | `31.4~24.04.1` ➜ `31.4-1500~g75fa134~ubuntu24.04.1` | +| Daily to Next Daily | `31.4-1500~g75fa134~ubuntu24.04.1` ➜ `31.4-1501~g3836375~ubuntu24.04.1` | diff -Nru ubuntu-advantage-tools-27.9~18.04.1/dev-docs/references/what_happens_during_attach.md ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/references/what_happens_during_attach.md --- ubuntu-advantage-tools-27.9~18.04.1/dev-docs/references/what_happens_during_attach.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/dev-docs/references/what_happens_during_attach.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,14 @@ +### What happens during attach +After running the command `ua attach TOKEN`, UA will perform the following steps: + +* read the config from /etc/ubuntu-advantage/uaclient.conf to obtain + the contract\_url (default: https://contracts.canonical.com) +* POSTs to the Contract Server API @ + /api/v1/context/machines/token providing the \ +* The Contract Server responds with a JSON blob containing an unique machine + token, service credentials, affordances, directives and obligations to allow + enabling and disabling Ubuntu Advantage services +* UA client writes the machine token API response to the root-readonly + /var/lib/ubuntu-advantage/private/machine-token.json +* UA client auto-enables any services defined with + `obligations:{enableByDefault: true}` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/dev-requirements.txt ubuntu-advantage-tools-27.10.1~18.04.1/dev-requirements.txt --- ubuntu-advantage-tools-27.9~18.04.1/dev-requirements.txt 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/dev-requirements.txt 2022-07-12 18:09:51.000000000 +0000 @@ -1,5 +1,6 @@ -# The black and isort versions are also in .pre-commit-config.yaml; make sure -# to update both together +# The black, isort and shellcheck-py versions are also in .pre-commit-config.yaml; +# make sure to update both together black==22.3.0 isort==5.8.0 pre-commit +shellcheck-py==0.8.0.4 diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/explanations/apt_messages.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/explanations/apt_messages.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/explanations/apt_messages.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/explanations/apt_messages.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,138 @@ +# UA related APT messages + +When running some APT commands, you might see Ubuntu Advantage (UA) related messages on +the output of those commands. Currently, we deliver those messages when +running either `apt-get upgrade` or `apt-get dist-upgrade` commands. The scenarios +where we deliver those messages are: + +* **ESM series with esm-infra service disabled**: When you are running a machine + with an ESM series, like Xenial, we advertise the `esm-infra` service if packages could + be upgraded by enabling the service: + + ``` + Reading package lists... Done + Building dependency tree + Reading state information... Done + Calculating upgrade... Done + The following package was automatically installed and is no longer required: + libfreetype6 + Use 'apt autoremove' to remove it. + + *The following packages could receive security updates with UA Infra: ESM service enabled: + libpam0g libpam-modules openssl ntfs-3g git-man libsystemd0 squashfs-tools git + openssh-sftp-server udev libpam-runtime isc-dhcp-common libx11-6 libudev1 apport + python3-apport systemd-sysv liblz4-1 libpam-systemd systemd libpam-modules-bin openssh-server + libx11-data openssh-client libxml2 curl isc-dhcp-client python3-problem-report + libcurl3-gnutls libssl1.0.0 + Learn more about UA Infra: ESM service for Ubuntu 16.04 at https://ubuntu.com/16-04 + ``` + + Note that the ESM message is located in the middle of the `apt-get` command output. Additionally, + if there are no packages to upgrade at the moment, we would instead deliver: + + ``` + Enable UA Infra: ESM to receive additional future security updates. + See https://ubuntu.com/16-04 or run: sudo ua status + ``` + + > **Note** + > If the user is using a LTS series instead, we will advertise `esm-apps`. + +* **esm package count**: If both ESM services are enabled on the system, + we deliver a package count related to each service near the end of the `apt-get` command: + + ``` + 1 standard security update, 29 esm-infra updates and 8 esm-apps updates + ``` + + We only deliver that message if the service is enabled and we did upgrade packages related + to it. For example, if we had no `esm-infra` package upgrades, the message would be: + + ``` + 1 standard security updates and 8 esm-apps updates + ``` + +* **expired contract**: If we detect that your contract is expired, we will deliver the following + message advertising `esm-infra` in the middle of the `apt` command: + + ``` + *Your UA Infra: ESM subscription has EXPIRED* + Enabling UA Infra: ESM service would provide security updates for following packages: + libpam0g libpam-modules openssl ntfs-3g git-man libsystemd0 squashfs-tools git + openssh-sftp-server udev libpam-runtime isc-dhcp-common libx11-6 libudev1 apport python3-apport + systemd-sysv liblz4-1 libpam-systemd systemd libpam-modules-bin openssh-server libx11-data + openssh-client libxml2 curl isc-dhcp-client python3-problem-report libcurl3-gnutls libssl1.0.0 + 30 esm-infra security update(s) NOT APPLIED. Renew your UA services at + https://ubuntu.com/advantage + ``` + + Note that if we don't have any package to upgrade related to `esm-infra`, we would deliver instead + the message: + + ``` + *Your UA Infra: ESM subscription has EXPIRED* + Enable UA Infra: ESM to receive additional future security updates. + See https://ubuntu.com/advantage or run: sudo ua status + ``` + +* **contract is about to expire**: Similarly, if we detect that your contract is about to expire, + we deliver the following message in the middle of the `apt-get` command: + + ``` + CAUTION: Your UA Infra: ESM service will expire in 14 days. + Renew UA subscription at https://ubuntu.com/advantage to ensure + continued security coverage for your applications. + ``` + +* **contract expired, but in grace period**: Additionally, if we detect that the contract is + expired, but still in the grace period, the following message will be seen in the middle + of the `apt-get` command: + + ``` + CAUTION: Your UA Infra: ESM service expired on 10 Sep 2021. + Renew UA subscription at https://ubuntu.com/advantage to ensure + continued security coverage for your applications. + Your grace period will expire in 8 days. + ``` + +> **Note** +> For contract expired messages, we only advertise `esm-infra`. + + +## How are the APT messages generated + +We have two distinct `apt` hooks that allow us to deliver those messages when you +are running `apt-get upgrade` or `apt-get dist-upgrade`, they are: + +* **apt-esm-hook**: Responsible for delivering the contract expired and ESM services + advertising. However, the messaging here is created by two distinct steps: + + 1. Our [update_messages](what_are_the_timer_jobs.md) timer job create templates for + the APT messages this hook will deliver. We cannot create the full message on the + timer job, because we need the accurate package names and count. That information + can only be obtained when running the `apt-get` command. + + > **Note** + > This templates will only be produced if some conditions are met. For example, + > we only produce expired contract templates if the contracts are indeed expired. + + 2. When you run either `apt-get upgrade` or `apt-get dist-upgrade`, the hook searches + for these templates and if they exist, they are populated with the right `apt` + content and delivered to the user. + +* **apt-esm-json-hook**: The json hook is responsible for delivering the package count + message we mentioned on the `esm package count` item. This hook is used because + to inject that message on the exact place we want, we need to use a specific apt` + [json hook](https://salsa.debian.org/apt-team/apt/-/blob/main/doc/json-hooks-protocol.md) + to communicate with. + + +> **Note** +> Those hooks are only delivered on LTS releases. This is because the hooks will +> not deliver useful messages on non-LTS due to lack of support for ESM services. + +## How are APT configured to deliver those messages + +We currently ship the package the `20apt-esm-hook.conf` configuration that +configures both the basic apt hooks to call our `apt-esm-hook` binary, and also +the `json` API of `apt` to call our `apt-esm-json-hook` binary. diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/explanations/how_to_interpret_the_security_status_command.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/explanations/how_to_interpret_the_security_status_command.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/explanations/how_to_interpret_the_security_status_command.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/explanations/how_to_interpret_the_security_status_command.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,103 @@ +# How to interpret the security-status command output + +The `security-status` command is used to get an overview +of the packages installed in your machine. Currently, +the command only support machine readable output: `json` or `yaml`. + +If you run the `ua security-status --format yaml` command on your +machine, you are expected to see the output following this structure: + +``` +_schema_version: '0.1' +summary: + num_esm_apps_packages: 0 + num_esm_apps_updates: 0 + num_esm_infra_packages: 1 + num_esm_infra_updates: 1 + num_main_packages: 70 + num_multiverse_packages: 10 + num_restricted_packages: 10 + num_third_party_packages: 0 + num_universe_packages: 9 + num_installed_packages: 100 + num_standard_security_updates: 0 + ua: + attached: true + enabled_services: + - esm-apps + - esm-infra + entitled_services: + - esm-apps + - esm-infra +packages: +- origin: esm.ubuntu.com + package: zlib1g + service_name: esm-infra + status: upgrade_available + version: 1:1.2.8.dfsg-2ubuntu4.3+esm1 + download_size: 123456 +``` + +Let's understand what each key mean on the output of the `ua security-status` command: + +* **`summary`**: The summary of the system related to Ubuntu Advantage (UA) and + the different package sources in the system: + + * **`num_installed_packages`**: The total number of installed packages in the system. + * **`num_esm_apps_packages`**: The number of packages installed from `esm-apps`. + * **`num_esm_apps_updates`**: The number of `esm-apps` package updates available to the system. + * **`num_esm_infra_packages`**: The number of packages installed from `esm-infra`. + * **`num_esm_infra_updates`**: The number of `esm-infra` package updates available to the system. + * **`num_main_packages`**: The number of packages installed from the `main` archive component. + * **`num_multiverse_packages**: The number of packages installed from the `multiverse` archive + component. + * **`num_restricted_packages`**: The number of packages installed from the `restricted` archive + component. + * **`num_third_party_packages`** : The number of packages installed from `third party` sources. + * **`num_universe_packages`**: The number of packages installed from the `universe` archive + component. + * **`num_unknown_packages`**: The number of packages installed from sources not known to `apt` + (installed locally through dpkg or packages without a remote reference). + * **`num_standard_security_updates`**: The number of standard security updates available to the system. + + It is worth mentioning here that the `_updates` fields are presenting the number of **security** + updates for **installed** packages. For example, let's assume your machine has a universe package that + has a security update from `esm-infra`. The count will be displayed as: + + ``` + num_esm_infra_packages: 0 + num_esm_infra_updates: 1 + num_universe_packages: 1 + ``` + + After upgrading the system, the count will turn to: + + ``` + num_esm_infra_packages: 1 + num_esm_infra_updates: 0 + num_universe_packages: 0 + ``` + + * **`ua`**: An object representing the state of UA on the system: + * **`attached`**: If the system is attached to a UA subscription. + * **`enabled_services`**: A list of services that are enabled on the system. If unattached, this + will always be an empty list. + * **`entitled_services`**: A list of services that are entitled on your UA subscription. If + unattached, this will always be an empty list. + +* **`packages`**: A list of security updates for packages installed in the system. + Every entry on the list will follow this structure: + + * **`origin`**: The host were the update comes from. + * **`package`**: The name of the package. + * **`service_name`**: The service that provides that package update. It can be either: `esm-infra`, + `esm-apps` or `standard-security`. + * **`status`**: The status for this update. It will be one of: + * **"upgrade_available"**: The package can be upgraded right now. + * **"pending_attach"**: The package needs a UA subscription attached to be upgraded. + * **"pending_enable"**: The machine is attached to a UA subscription, but the service required to + provide the upgrade is not enabled. + * **"upgrade_unavailable"**: The machine is attached, but the contract is not entitled to + the service which provides the upgrade. + * **`version`**: The update version. + * **`download_size`**: The number of bytes that would be downloaded in order to install the update. diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/explanations/motd_messages.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/explanations/motd_messages.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/explanations/motd_messages.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/explanations/motd_messages.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,115 @@ +# UA related messages on MOTD + +When UA is installed on the system, it delivers custom messages on [MOTD](https://wiki.debian.org/motd). +Those messages are generated directly by two different sources: + +* **python script**: The [update-notifier](https://wiki.ubuntu.com/UpdateNotifier) deliver a script + called `apt_check.py`. Considering UA related information, this script is responsible for: + + * inform the user about the status of one of the ESM services, `esm-apps` if the machine is a + LTS series or `esm-infra` if the series is on ESM mode. + * showing the number of `esm-infra` or `esm-apps` packages that can be upgraded in the machine + + For example, this is the output of the `apt_check.py` script on a LTS machine when both of + those services are enabled: + + ``` + UA Apps: Extended Security Maintenance (ESM) is enabled. + + 11 updates can be applied immediately. + 5 of these updates are UA Apps: ESM security updates. + 1 of these updates is a UA Infra: ESM security update. + 5 of these updates are standard security updates. + To see these additional updates run: apt list --upgradable + ``` + + Note that if we were running this on a ESM series, we would instead see `esm-infra` being + advertised: + + ``` + UA Infra: Extended Security Maintenance (ESM) is enabled. + + 11 updates can be applied immediately. + 5 of these updates are UA Apps: ESM security updates. + 1 of these updates is a UA Infra: ESM security update. + 5 of these updates are standard security updates. + To see these additional updates run: apt list --upgradable + ``` + + Now considering the scenario were one of those services is not enabled. For example, if + `esm-apps` was not enabled, the output will be: + + ``` + UA Apps: Extended Security Maintenance (ESM) is not enabled. + + 6 updates can be applied immediately. + 1 of these updates is a UA Infra: ESM security update. + 5 of these updates are standard security updates. + To see these additional updates run: apt list --upgradable + + 5 additional security updates can be applied with UA Apps: ESM + Learn more about enabling UA Infra: ESM service for Ubuntu 16.04 at + https://ubuntu.com/16-04 + ``` + + In the end of the output we can see the number of packages that could + be upgraded if that service was enabled. Note that we would deliver the same information + for `esm-infra` if the service was disabled and the series running on the machine is on ESM + state. + +* **UA timer jobs**: One of the timer jobs UA has is used to insert additional messages into MOTD. + Those messages will be always delivered before or after the content created by the python + script delivered by `update-notifier`. Those additional messages are generated when UA detect + some conditions on the machine. They are: + + * **subscription expired**: When the UA subscription is expired, UA will deliver the following + message after the `update-notifier` message: + + ``` + *Your UA Infra: ESM subscription has EXPIRED* + + 2 additional security updates could have been applied via UA Apps: ESM. + Renew your UA services at https://ubuntu.com/advantage + + Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. + ``` + + * **subscription about to expire**: When the UA subscription is about to expire, we deliver the + following message after the `update-notifier` message: + + ``` + CAUTION: Your UA Infra: ESM service will expire in 5 days. + Renew UA subscription at https://ubuntu.com/advantage to ensure + continued security coverage for your applications. + ``` + + * **subscription expired but within grace period**: When the UA subscription is expired, but is + still within the grace period, we deliver the following message after the `update-notifier` + script: + + ``` + CAUTION: Your UA Infra: ESM service expired on 10 Sep 2021. + Renew UA subscription at https://ubuntu.com/advantage to ensure + continued security coverage for your applications. + Your grace period will expire in 9 days. + ``` + + * **advertising esm-apps service**: When we detect that `esm-apps` is supported and not enabled + in the system, we advertise it using the following message that is delivered before the + `update-notifier` message: + + ``` + * Introducing Extended Security Maintenance for Applications. + Receive updates to over 30,000 software packages with your + Ubuntu Advantage subscription. Free for personal use + + https://ubuntu.com/16-04 + ``` + + Note that we could also advertise the `esm-infra` service instead. This will happen + if you use an ESM release. Additionally, the same can for the url we use to advertise the + esm service, we adapt it based on the series that is running on the machine. + + Additionally, all of those UA custom messages are delivered into + `/var/lib/ubuntu-advantage/messages`. We also add custom scripts into `/etc/update-motd.d` to + check if those messages exist and if they do, insert them on the full MOTD message. diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/explanations/status_columns.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/explanations/status_columns.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/explanations/status_columns.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/explanations/status_columns.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,75 @@ +# Status output explanation + +When running `ua status` we can observe two different types of outputs, attached vs unattached. +When unattached, users will see the status table containing only three columns: + +``` +SERVICE AVAILABLE DESCRIPTION +cc-eal no Common Criteria EAL2 Provisioning Packages +cis no Security compliance and audit tools +esm-infra yes UA Infra: Extended Security Maintenance (ESM) +fips no NIST-certified core packages +fips-updates no NIST-certified core packages with priority security updates +livepatch yes Canonical Livepatch service +``` + +Where: + +* **SERVICE**: is the name of service being offered +* **AVAILABLE**: if that service is available on that machine. To verify if a service is available, we + check the machine kernel version, architecture and Ubuntu release it is running. +* **DESCRIPTION**: A short description of the service. + +However, if we run the same command when attached, we have an output with 4 columns: + +``` +SERVICE ENTITLED STATUS DESCRIPTION +cis yes disabled Center for Internet Security Audit Tools +esm-apps yes enabled UA Apps: Extended Security Maintenance (ESM) +esm-infra yes enabled UA Infra: Extended Security Maintenance (ESM) +fips yes n/a NIST-certified core packages +fips-updates yes n/a NIST-certified core packages with priority security updates +livepatch yes n/a Canonical Livepatch service +``` + +Here we can notice that the column **AVAILABLE** no longer applies and we have new columns: + +* **ENTITLED**: If the user subscription allow that service to be enabled +* **STATUS**: The state of that service on the machine. + +It is possible that a service appears as available when running status unattached, but turns +out as not entitled. This happens because even if the service can be enabled on the machine, +if your UA subscription doesn't allow you to do that, UA cannot enable it. + +Additionally, the **STATUS** column allows for three possible states: + +* **enabled**: service is enabled in the machine +* **disabled**: service is not currently running +* **n/a**: This means non-applicable. This can happen if the service cannot be enabled on the machine + due to a non-contract restriction. For example, we cannot enable `livepatch` on a container. + +### Notices +Notices are information regarding the UA status which either require some kind of action from the user, or may impact the experience with UA. + +For example, let's say FIPS was just enabled, but the system wasn't rebooted yet (which is needed for booting into the FIPS Kernel), the output of `ua status` will contain: +```bash +NOTICES +FIPS support requires system reboot to complete configuration. +``` +After the system is rebooted, the notice will go away. + +Notices can always be resolved, and the way to resolve it should be explicit in the notice itself. + +### Features +Features are extra configuration values that can be set/unset in `uaclient.conf`. Most of those are meant for development/testing purposes, but some can be used in fome application flows. For example, to always have beta services with the same flow as the non-beta (for enable, status, etc), `uaclient.conf` may have: +``` +features: + allow_beta: True +``` +In this case, the output of `ua status` will contain: +```bash +FEATURES ++allow_beta +``` + +Keep in mind that any feature defined like this will be listed, even if it is invalid or typed the wrong way. Those appear on status for information/debugging purposes. diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/explanations/what_are_the_timer_jobs.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/explanations/what_are_the_timer_jobs.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/explanations/what_are_the_timer_jobs.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/explanations/what_are_the_timer_jobs.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,23 @@ +# Timer jobs + +UA client sets up a systemd timer to run jobs that need to be executed recurrently. Everytime the +timer runs, it decides which jobs need to be executed based on their intervals. When a job runs +successfully, its next run is determined by the interval defined for that job. + +## Current jobs + +The jobs that UA client runs periodically are: + +| Job | Description | Interval | +| --- | ----------- | -------- | +| update_messaging | Update MOTD and APT messages | 6 hours | +| update_status | Update UA status | 12 hours | +| metering | (Only when attached to UA services) Pings Canonical servers for contract metering | 4 hours | + +- The `update_messaging` job makes sure that the MOTD and APT messages match the +available/enabled services on the system, showing information about available +packages or security updates. +- The `update_status` job makes sure the `ua status` command will have the latest +information even when executed by a non-root user, updating the +`/var/lib/ubuntu-advantage/status.json` file. +- The `metering` will inform Canonical on which services are enable on the machine. diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/explanations/what_is_the_ubuntu_advantage_pro_package.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/explanations/what_is_the_ubuntu_advantage_pro_package.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/explanations/what_is_the_ubuntu_advantage_pro_package.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/explanations/what_is_the_ubuntu_advantage_pro_package.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,6 @@ +# What is the ubuntu-advantage-pro package? + +The ubuntu-advantage-pro package is used by [Ubuntu PRO](what_is_ubuntu_pro.md) machine to automate machine attach on boot. +Therefore, the only main difference between the ubuntu-advantage-pro and ubuntu-advantage-tools +package is that the pro package ships a systemd unit that runs the auto-attach command on first +boot. diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/explanations/what_is_ubuntu_pro.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/explanations/what_is_ubuntu_pro.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/explanations/what_is_ubuntu_pro.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/explanations/what_is_ubuntu_pro.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,15 @@ +# What is an Ubuntu PRO machine? + +Ubuntu PRO premium images are published to [AWS](https://ubuntu.com/aws/pro), [Azure](https://ubuntu.com/azure/pro) and [GCP](https://ubuntu.com/gcp/pro) which come with Ubuntu +Advantage support and services built in. On first boot, Ubuntu PRO images will automatically attach +to an Ubuntu Advantage support contract and enable necessary security and support out of the box so +that no extra setup is required to ensure a secure and supported Ubuntu machine. + +There are two primary flavors of Ubuntu PRO images in clouds: + +* Ubuntu PRO: Ubuntu LTS images with attached Ubuntu Advantage support with kernel Livepatch and +ESM security access already enabled. Ubuntu PRO images are entitled to enable any additional UA +services. +* Ubuntu PRO FIPS: Specialized Ubuntu PRO images for 16.04, 18.04 and 20.04 which come pre-enabled +with the cloud-optimized FIPS-certified kernel and all additional SSL and security hardening +enabled are available in [AWS Ubuntu PRO FIPS](https://ubuntu.com/aws/fips), [Azure Ubuntu PRO FIPS](https://ubuntu.com/azure/fips) and GCP Ubuntu PRO FIPS diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/explanations/what_refresh_does.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/explanations/what_refresh_does.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/explanations/what_refresh_does.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/explanations/what_refresh_does.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,13 @@ +# What refresh does + +When you run the `ua refresh` command on your machine, three distinct stages are performed: + +* **contract**: The contract information on the machine is refreshed. If we find any deltas + between the old contract and the new one, we process that delta and apply the changes + on the machine. If you need only this stage during refresh, run `ua refresh contract`. + +* **config**: If there is any config change made on `/etc/ubuntu-advantage/uaclient.conf`, those + changes will now be applied to the machine. If you need only this stage during refresh, run `ua refresh config`. + +* **MOTD and APT messages**: UA process new MOTD and APT messages and refresh the machine to use + them. If you need only this stage during refresh, run `ua refresh messages`. diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/explanations/why_trusty_is_no_longer_supported.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/explanations/why_trusty_is_no_longer_supported.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/explanations/why_trusty_is_no_longer_supported.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/explanations/why_trusty_is_no_longer_supported.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,7 @@ +# Why trusty is no longer supported + +On 14.04 (Trusty), the Ubuntu Advantange Client (UA) package is not receiving upstream updates +beyond version 19.6 plus any critical CVE maintenance related to this version. Version 19.6 already +has full-featured support of the applicable UA service offerings `esm-infra` and `livepatch`. In the +event that a CVE is discovered that affects the UA version on Trusty, a fix and backport will be +provided for those specific issues. diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/configure_proxies.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/configure_proxies.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/configure_proxies.md 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/configure_proxies.md 2022-07-12 18:09:51.000000000 +0000 @@ -1,17 +1,100 @@ # How to configure proxies -The UA Client can be configured to use an http/https proxy as needed for network requests. +The UA client can be configured to use an HTTP/HTTPS proxy as needed for network requests. It will +also honor the no\_proxy environment variable if set to avoid using local proxies for certain +outbound traffic. In addition, the UA client will automatically set up proxies for all programs +required for enabling Ubuntu Advantage services. This includes APT, Snaps, and Livepatch. -In addition, the UA Client will automatically set up proxies for all programs required for enabling Ubuntu Advantage services. This includes APT, Snaps, and Livepatch. +## HTTP/HTTPS Proxies -Proxies can be set using the `ua config set` command. +To configure standard HTTP and/or HTTPS proxies, run the following commands: -HTTP/HTTPS proxies are set using the fields `http_proxy` and `https_proxy`, respectively. The values for these fields will also be used for Snap and Livepatch proxies. +```console +$ sudo ua config set http\_proxy=http://host:port +$ sudo ua config set https\_proxy=https://host:port +``` -APT proxies are defined separately. You can set global apt proxies that affect the whole system using the fields `apt_http_proxy` and `apt_https_proxy`. +After running the above commands, UA client: -> Starting in to-be-released Version 27.9, APT proxies config options will change. You will be able to set global apt proxies that affect the whole system using the fields `global_apt_http_proxy` and `global_apt_https_proxy`. Alternatively, you could set apt proxies only for UA related services with the fields `ua_apt_http_proxy` and `ua_apt_https_proxy`. +1. Verifies that the proxy is working by using it to reach `api.snapcraft.io` +2. Configures itself to use the given proxy for all future network requests +3. If snapd is installed, configures snapd to use the given proxy +4. If Livepatch has already been enabled, configures Livepatch to use the given proxy + 1. If Livepatch is enabled after this command, UA client will configure + Livepatch to use the given proxy at that time. -The format for the proxy configuration values is: +To remove HTTP/HTTPS proxy configuration, run the following: -`://[:@]:` +```console +$ sudo ua config unset http\_proxy +$ sudo ua config unset https\_proxy +``` + +After running the above commands, UA client will also remove proxy +configuration from snapd (if installed) and Livepatch (if enabled). + +## APT Proxies + +APT proxy settings are configured separately. To have UA client manage your +APT proxy configuration, run the following commands: + +```console +$ sudo ua config set apt\_http\_proxy=http://host:port +$ sudo ua config set apt\_https\_proxy=https://host:port +``` + +After running the above commands, UA client: + +1. Verifies that the proxy works by using it to reach `archive.ubuntu.com` or `esm.ubuntu.com`. +2. Configures APT to use the given proxy by writing an apt configuration file to + `/etc/apt/apt.conf.d/90ubuntu-advantage-aptproxy`. + +> **Note** +> Any configuration file that comes later in the apt.conf.d +> directory could override the proxy configured by the UA client. + +To remove the APT proxy configuration, run the following: + +$ sudo ua config unset apt\_http\_proxy +$ sudo ua config unset apt\_https\_proxy + +> **Note** +> Starting in to-be-released Version 27.9, APT proxies config options will +> change. You will be able to set global apt proxies that affect the whole system +> using the fields `global_apt_http_proxy` and `global_apt_https_proxy`. +> Alternatively, you could set apt proxies only for UA related services with the +> fields `ua_apt_http_proxy` and `ua_apt_https_proxy`. + +## Authenticating + +If your proxy server requires authentication, you can pass +the credentials directly in the URL when setting the +configuration, as in: + +$ sudo ua config set https\_proxy=https://username:password@host:port + +## Checking the configuration + +To see what proxies UA client is currently configured to use, you can use the show command. + +```console +$ sudo ua config show +``` + +The above will output something that looks like the following if there are proxies set: + +``` +http_proxy http://proxy +https_proxy https://proxy +apt_http_proxy http://aptproxy +apt_https_proxy https://aptproxy +``` + +Or it may look like this if there aren’t any proxies set: + +``` +http_proxy None +https_proxy None +apt_http_proxy None +apt_https_proxy None +``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/configuring_timer_jobs.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/configuring_timer_jobs.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/configuring_timer_jobs.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/configuring_timer_jobs.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,43 @@ +# How to configure a timer job + +All timer jobs can be configured through the `ua config set` command. +We will show how we can properly use that command to interact with those jobs. + + +## How to check timer jobs configuration + +To see each job’s running interval, use the show command: + +```console +$ sudo ua config show +``` + +You should see output which include the timer jobs: + +``` +update_messaging_timer 21600 +update_status_timer 43200 +metering_timer 14400 +``` + + +## Changing a timer job interval + +Each job has a configuration option of the form `_timer`, +which can be set with `ua config`. The expected value is a positive +integer for the number of seconds in the interval. For example, to +change the `update_status job` timer interval to run every 24 hours, run: + +```console +$ sudo ua config set update_status_timer=86400 +``` + + +## How to disable a timer job + +To disable a job, set its interval to zero. For instance, to disable +the `update_messaging` job, run: + +```console +$ sudo ua config set update_messaging_timer=0 +``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/enable_cc.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/enable_cc.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/enable_cc.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/enable_cc.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,24 @@ +# How to enable CC EAL + +> NOTE: CC EAL can be enabled on both Xenial and Bionic, but the installed scripts +which configure CC EAL on those machines will only run on Xenial 16.04.4 and Bionic 18.04.4 +point releases. + +Common Criteria is supported only on 16.04 and 18.04. For more information on it, +please see https://ubuntu.com/security/cc + +To enable it through UA, please run: + +```console +$ sudo ua enable cc-eal +``` + +You should see output like the following, indicating that the CC EAL packages has +been installed. + +``` +(This will download more than 500MB of packages, so may take some time.) +Installing CC EAL2 packages +CC EAL2 enabled +Please follow instructions in /usr/share/doc/ubuntu-commoncriteria/README to configure EAL2 +``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/enable_cis.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/enable_cis.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/enable_cis.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/enable_cis.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,21 @@ +# How to enable CIS + +> NOTE: On Focal and later releases, CIS was replaced by [USG](https://ubuntu.com/security/certifications/docs/usg), +therefore, just change `cis` to `usg` when running the enable command on those releases. + +To access the CIS tooling first enable the software repository. + +```console +$ sudo ua enable cis +``` + +You should see output like the following, indicating that the CIS package has been installed. + +``` +Installing CIS Audit packages +CIS Audit enabled +Visit https://security-certs.docs.ubuntu.com/en/cis to learn how to use CIS +``` + +Once the feature is enabled please [follow the documentation](https://ubuntu.com/security/certifications/docs/cis) +for the CIS tooling to run the provided hardening audit scripts. diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/enable_esm_infra.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/enable_esm_infra.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/enable_esm_infra.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/enable_esm_infra.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,26 @@ +# How to enable ESM Infra + +For Ubuntu LTS releases, ESM Infra will be automatically enabled after attaching +the UA client to your account. After ubuntu-advantage-tools is installed and your machine is +attached, ESM Infra should be enabled. If ESM Infra is not enabled, you can enable it +with the following command: + +```console +$ sudo ua enable esm-infra +``` + +With the ESM Infra repository enabled, specially on Ubuntu 14.04 and 16.04, you may see +a number of additional package updates available that were not available previously. +Even if your system had indicated that it was up to date before installing the +ubuntu-advantage-tools and attaching, make sure to check for new package updates after +ESM Infra is enabled using apt upgrade. If you have cron jobs set to install updates, or other +unattended upgrades configured, be aware that this will likely result in a number of package updates +with the ESM content. + +Running apt upgrade will now apply all of package updates available, including the ones in ESM. + +```console +$ sudo apt upgrade +``` + +More information: https://ubuntu.com/security/esm diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/enable_fips.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/enable_fips.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/enable_fips.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/enable_fips.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,33 @@ +# How to enable FIPS + +[FIPS is supported on 16.04, 18.04 and 20.04 releases](https://ubuntu.com/security/certifications/docs/fips). + +To use FIPS, one can either launch existing Ubuntu premium support images which already have FIPS +kernel and security pre-enabled on first boot at [AWS Ubuntu PRO FIPS images](https://ubuntu.com/aws/fips), [Azure PRO FIPS images](https://ubuntu.com/azure/fips) and GCP PRO FIPS Images. + +Alternatively, enable FIPS using the UA client will install a FIPS-certified kernel and core security-related +packages such as openssh-server/client and libssl. Note: disabling FIPS on an image is not yet +supported + +> **Warning** +> Enabling FIPS should be performed during a system maintenance window because this operation +> makes changes to underlying SSL related libraries and requires a reboot into the FIPS certified +> kernel. + +> **Note** +> Disabling FIPS is not currently supported, only use it on machines intended expressly for this +> purpose. + +To enable, run: + +```console +$ sudo ua enable fips +``` + +You should see output like the following, indicating that the FIPS packages has been installed. + +``` +Installing FIPS packages +FIPS enabled +A reboot is required to complete installl +``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/enable_livepatch.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/enable_livepatch.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/enable_livepatch.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/enable_livepatch.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,30 @@ +# How to enable Livepatch + +Livepatch requires: + +* kernel version 4.4 or above (16.04+ delivered via the HWE Kernel https://wiki.ubuntu.com/Kernel/LTSEnablementStack) + +To enable, run: + +```console +$ sudo ua enable livepatch +``` + +You should see output like the following, indicating that the Livepatch snap package has +been installed. + +``` +One moment, checking your subscription first +Installing snapd +Updating package lists +Installing canonical-livepatch snap +Canonical livepatch enabled. +``` + +To check the status of Livepatch once it has been installed use this command + +```console +$ sudo canonical-livepatch status +``` + +More information: https://ubuntu.com/security/livepatch diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/enable_ua_in_dockerfile.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/enable_ua_in_dockerfile.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/enable_ua_in_dockerfile.md 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/enable_ua_in_dockerfile.md 2022-07-12 18:09:51.000000000 +0000 @@ -1,13 +1,14 @@ # How to Enable Ubuntu Advantage Services in a Dockerfile -> Requires UA Client version 27.7 +> Requires at least UA Client version 27.7 Ubuntu Advantage (UA) comes with several services, some of which can be useful in docker. For example, Extended Security Maintenance of packages and FIPS certified packages may be desirable in a docker image. In this how-to-guide, we show how you can use the `ua` tool to take advantage of these services in your Dockerfile. ## Step 1: Create a UA Attach Config file -> Warning: the UA Attach Config file will contain your UA Contract token and should be treated as a secret file. +> **Note** +> The UA Attach Config file will contain your UA Contract token and should be treated as a secret file. An attach config file for ua is a yaml file that specifies some options when running `ua attach`. The file has two fields, `token` and `enable_services` and looks something like this: @@ -108,7 +109,8 @@ 1. Prevents any UA Subscription-related tokens and secrets from being leaked in an image layer 2. Keeps the image as small as possible by cleaning up extra packages and files before the layer is finished. -> Note: These benefits could also be attained by squashing the image. +> **Note** +> These benefits could also be attained by squashing the image. ## Step 3: Build the Docker image diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/get_token_and_attach.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/get_token_and_attach.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/get_token_and_attach.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/get_token_and_attach.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,37 @@ +# How to get UA token and attach to a subscription + +Retrieve your UA token from the [advantage](https://ubuntu.com/advantage/) portal. You will log in with your SSO credentials, the same credentials you use for https://login.ubuntu.com. Note that you +can obtain a free personal token, which already provide you with access to several of the UA +services. + +Once that token is obtained, to attach your machine to a subscription, just run: + +``` +$ sudo ua attach YOUR_TOKEN +``` + +You should see output like the following, indicating that you have successfully associated this +machine with your account. + +``` +Enabling default service esm-infra +Updating package lists +ESM Infra enabled +This machine is now attached to 'UA Infra - Essential (Virtual)' + +SERVICE ENTITLED STATUS DESCRIPTION +cis yes disabled Center for Internet Security Audit Tools +esm-infra yes enabled UA Infra: Extended Security Maintenance (ESM) +fips yes n/a NIST-certified FIPS modules +fips-updates yes n/a Uncertified security updates to FIPS modules +livepatch yes n/a Canonical Livepatch service + +NOTICES +Operation in progress: ua attach + +Enable services with: ua enable +``` + +Once the UA client is attached to your UA account, you can use it to activate various services, +including: access to ESM packages, Livepatch, FIPS, and CIS. Some features are specific to certain +LTS releases diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/how_to_attach_with_config_file.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/how_to_attach_with_config_file.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/how_to_attach_with_config_file.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/how_to_attach_with_config_file.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,22 @@ +# How to attach with a configuration file + +To attach with a configuration file, you must run `ua attach` with the `--attach-config` flag, +passing the path of the configuration file you intend to use. + +When using `--attach-config` the token must be passed in the file rather than on the command line. This is useful in situations where it is preferred to keep the secret token in a file. + +Optionally, the attach config file can be used to override the services that are automatically enabled as a part of the attach process. + +An attach config file looks like this: +```yaml +token: YOUR_TOKEN_HERE # required +enable_services: # optional list of service names to auto-enable + - esm-infra + - esm-apps + - cis +``` + +And can be passed on the cli like this: +```shell +sudo ua attach --attach-config /path/to/file.yaml +``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/how_to_collect_ua_logs.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/how_to_collect_ua_logs.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/how_to_collect_ua_logs.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/how_to_collect_ua_logs.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,21 @@ +# How to collect UA logs + +To collect all of the necessary logs for UA, please run the command: + +```console +$ sudo ua collect-logs +``` + +This command creates a tarball with all relevant data for debugging possible problems with UA. +It puts together: +* The UA Client configuration file (the default is `/etc/ubuntu-advantage/uaclient.conf`) +* The UA Client log files (the default is `/var/log/ubuntu-advantage*`) +* The files in `/etc/apt/sources.list.d/*` related to UA +* Output of `systemctl status` for the UA Client related services +* Status of the timer jobs, `canonical-livepatch`, and the systemd timers +* Output of `cloud-id`, `dmesg` and `journalctl` + +Sensitive data is redacted from all files included in the tarball. As of now, the command must be run as root. + +Running the command creates a `ua_logs.tar.gz` file in the current directory. +The output file path/name can be changed using the `-o` option. diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/how_to_run_ua_fix_in_dry_run_mode.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/how_to_run_ua_fix_in_dry_run_mode.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/how_to_run_ua_fix_in_dry_run_mode.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/how_to_run_ua_fix_in_dry_run_mode.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,50 @@ +# How to run fix command in dry run mode + +If you are unsure on what changes will happen on your system after you run `ua fix` to address a +CVE/USN, you can use the `--dry-run` flag to see that packages will be installed in the system if +the command was actually run. For example, this is the output of running `ua fix USN-5079-2 --dry-run`: + +``` +WARNING: The option --dry-run is being used. +No packages will be installed when running this command. +USN-5079-2: curl vulnerabilities +Found CVEs: +https://ubuntu.com/security/CVE-2021-22946 +https://ubuntu.com/security/CVE-2021-22947 +1 affected source package is installed: curl +(1/1) curl: +A fix is available in UA Infra. +The machine is not attached to an Ubuntu Advantage (UA) subscription. +To proceed with the fix, a prompt would ask for a valid UA token. +{ ua attach TOKEN } +UA service: esm-infra is not enabled. +To proceed with the fix, a prompt would ask permission to automatically enable +this service. +{ ua enable esm-infra } +{ apt update && apt install --only-upgrade -y curl libcurl3-gnutls } +✔ USN-5079-2 is resolved. +``` + +You can see that using `--dry-run` will also indicate which actions would need to happen +to completely address the USN/CVE. Here we can see that the package fix can only be accessed +through the `esm-infra` service. Therefore, we need a UA subscription, as can be seen on this +part of the output: + +``` +The machine is not attached to an Ubuntu Advantage (UA) subscription. +To proceed with the fix, a prompt would ask for a valid UA token. +{ ua attach TOKEN } +``` + +Additionally, we also inform you that even with a subscription, we need the specific +`esm-infra` service to be enabled: + +``` +UA service: esm-infra is not enabled. +To proceed with the fix, a prompt would ask permission to automatically enable +this service. +{ ua enable esm-infra } +``` + +After performing these steps during a fix command without `--dry-run`, your machine should +no longer be affected by that USN we used as an example. diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/how_to_simulate_attach.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/how_to_simulate_attach.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/howtoguides/how_to_simulate_attach.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/howtoguides/how_to_simulate_attach.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,29 @@ +# How to simulate attach operation + +If you are unsure on what will be the state of your machine after running attach +with a specific token, you can simulate running the attach operation by running: + +```console +$ ua status --simulate-with-token YOUR_TOKEN +``` + +After running the command, you should see a modified status table, similar to this +one: + +``` +SERVICE AVAILABLE ENTITLED AUTO_ENABLED DESCRIPTION +cc-eal yes yes no Common Criteria EAL2 Provisioning Packages +cis yes yes no Security compliance and audit tools +esm-infra yes yes yes UA Infra: Extended Security Maintenance (ESM) +fips yes yes no NIST-certified core packages +fips-updates yes yes no NIST-certified core packages with priority security updates +livepatch yes yes yes Canonical Livepatch service +``` + +Here, you can see which services are entitled for that token while also verifying +which services will be enabled by default through the **AUTO_ENABLED** column. +The services marked as yes here, will be automatically enabled when running an +attach operation. + +Additionally, if you want more information about the **AVAILABLE** and **ENTITLED** columns, +please refer to this [explanation](../explanations/status_columns.md). diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/references/network_requirements.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/references/network_requirements.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/references/network_requirements.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/references/network_requirements.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,18 @@ +# UA Network Requirements + +Using the UA client to enable support services will rely on network access to obtain updated service +credentials, add APT repositories to install deb packages and install [snap packages](https://snapcraft.io/about) when +Livepatch is enabled. Also see the Proxy Configuration explanation to inform UA client of HTTP(S)/APT proxies. + +Ensure the managed system has access to the following port:urls if in a network-limited environment: + +* 443:https://contracts.canonical.com/ - HTTP PUTs, GETs and POSTs for UAClient interaction +* 443:https://esm.ubuntu.com/\* - APT repository access for most services + +Enabling kernel Livepatch require additional network egress: + +* snap endpoints required in order to install and run snaps as defined in [snap forum network-requirements post](https://forum.snapcraft.io/t/network-requirements/5147) +* 443:api.snapcraft.io +* 443:dashboard.snapcraft.io +* 443:login.ubuntu.com +* 443:\*.snapcraftcontent.com - Download CDNs diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/references/ppas.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/references/ppas.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/references/ppas.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/references/ppas.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,9 @@ +# Available PPAs with different version of Ubuntu Advantage Client +There are 3 PPAs with different release channels of the Ubuntu Advantage Client: + +1. Stable: This contains stable builds only which have been verified for release into Ubuntu stable releases or Ubuntu PRO images. + - add with `sudo add-apt-repository ppa:ua-client/stable` +2. Staging: This contains builds under validation for release to stable Ubuntu releases and images + - add with `sudo add-apt-repository ppa:ua-client/staging` +3. Daily: This PPA is updated every day with the latest changes. + - add with `sudo add-apt-repository ppa:ua-client/daily` \ No newline at end of file diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/tutorials/basic_ua_commands.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/tutorials/basic_ua_commands.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/tutorials/basic_ua_commands.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/tutorials/basic_ua_commands.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,258 @@ +# Tutorial: cover base UA commands + +The Ubuntu Advantage (UA) Tools provides users with a simple mechanism to +view, enable, and disable offerings from Canonical on their system. In this tutorial +we will cover the base UA commands that allow a user to successfully manage the offering +on their machine. + +## Prerequisites + +On this tutorial, you will use [LXD](https://linuxcontainers.org/lxd/) containers. +To set up LXD on your computer, please follow this [guide](https://linuxcontainers.org/lxd/getting-started-cli/). + +## Cover base UA commands + +When dealing with UA through the CLI, there are six main UA commands that cover the main +functionalites of the tool. They are: + +* **status** +* **attach** +* **refresh** +* **detach** +* **enable** +* **disable** + +In this tutorial, we will go through all those commands to show how to properly use them. +To achieve that, we will use a Xenial LXD container. + +## Creating the Xenial LXD container + +To test all of those commands, let's create a Xenial LXD container. Remember to set up LXD as +mentioned on the [Prerequisites](#prerequisites) section. After that, just run the command: + +```console +$ lxc launch ubuntu-daily:xenial dev-x +``` + +After running that, let's access the container by running: + +```console +$ lxc shell dev-x +``` + +## Base UA commands + +### Status + +The status command of UA allows you to see the status of any UA service on your machine. +It also easily allows you to verify if your machine is attached to a UA subscription +or not. + +Let's run it on the LXD container: + +```console +$ ua status +``` + +It is expected for you to see an output similar to this one: + +``` +SERVICE AVAILABLE DESCRIPTION +cis yes Center for Internet Security Audit Tools +esm-infra yes UA Infra: Extended Security Maintenance (ESM) +fips yes NIST-certified core packages +fips-updates yes NIST-certified core packages with priority security updates +livepatch yes Canonical Livepatch service + +This machine is not attached to a UA subscription. +See https://ubuntu.com/advantage +``` + +You can see that the status command shows the services that are available for that given machine, +while also presenting a short description for each of them. + +Additionally, if you look at the last lines of the output, you can identify that this machine is not +attached to a UA subscription. +``` +This machine is not attached to a UA subscription. +See https://ubuntu.com/advantage +``` + +### Attach + +To access any of those service offerings, you need to attach to a UA subscription. This is +achieved by running the attach command. Before you run it, you need to get a UA token. +Any user with a Ubuntu One account is entitled to a free personal token to use with UA. +You can retrieve your UA token from the [advantage](https://ubuntu.com/advantage/) portal. +You will log in with your SSO credentials, the same credentials you use for https://login.ubuntu.com. +After getting your UA token, go to the LXD container and run: + +```console +$ sudo ua attach YOUR_TOKEN +``` + +It is expected for you to see an output similar to this one: + +``` +Enabling default service esm-infra +Updating package lists +UA Infra: ESM enabled +This machine is now attached to 'USER ACCOUNT' + +SERVICE ENTITLED STATUS DESCRIPTION +cis yes disabled Center for Internet Security Audit Tools +esm-infra yes enabled UA Infra: Extended Security Maintenance (ESM) +fips yes n/a NIST-certified core packages +fips-updates yes n/a NIST-certified core packages with priority security updates +livepatch yes n/a Canonical Livepatch service + +NOTICES +Operation in progress: ua attach + +Enable services with: ua enable + + Account: USER ACCOUNT + Subscription: USER SUBSCRIPTION + Valid until: 9999-12-31 00:00:00+00:00 +Technical support level: essential +``` + +From this output, you can see that the attach command enables all of the services specified by the user subscription. +After the command ends, `ua` displays the new state of the machine. +That status output is exactly what you will see if you run the status command again. +You can confirm this by running: + +```console +$ ua status +``` + +One question that may arise is that the output of `ua status` while attached is different from +the output of `ua status` when unattached. When attached, status presents two new columns, +**ENTITLED** and **STATUS**, while also dropping the **AVAILABLE** column. For more information +of why the output is different, please refer to this [explanation](../explanations/status_columns.md). + +Finally, another useful bit at the end of both attach and status is the contract expiration date: + +``` + Account: USER ACCOUNT +Subscription: USER SUBSCRIPTION +Valid until: 9999-12-31 00:00:00+00:00 +``` + +The `Valid until` field describes when your contract will be expired, so you can be aware of when it +needs to be renewed. + + +### Refresh + +In the last section, we mentioned that your contract can expire. Although free tokens never expire, if +you buy a UA subscription, and later need to renew the contract, how you can make your machine aware of +it ? You can do this through the `refresh` command: + +```console +$ sudo ua refresh +``` + +This command will refresh the contract on your machine. This command is also really useful if you +want to change any definitions on your subscription. For example, let's assume that you now want +`cis` to be enabled by default when attaching. After you modify your subscription for that, running +the refresh command will process any changes that were performed in the subscription, enabling +`cis` because of this. + +> Note: the refresh command does more than just update the contract in the machine. If you want +more information about the command, please take a look at this [explanation](../explanations/what_refresh_does.md). + +### Enable + +There is another way to enable a service that wasn't activated during attach or refresh. +Suppose that you want to enable `cis` on this machine manually. To achieve that, You can use the +enable command. + +Let's enable `cis` on our LXD container by running: + +```console +$ sudo ua enable cis +``` + +After running it, you should see an output similar to this one: + +``` +One moment, checking your subscription first +Updating package lists +Installing CIS Audit packages +CIS Audit enabled +Visit https://security-certs.docs.ubuntu.com/en/cis to learn how to use CIS +``` + +You can confirm that `cis` is enabled now by running: + +```console +$ ua status +``` + +And you should see: +``` +SERVICE ENTITLED STATUS DESCRIPTION +cis yes enabled Center for Internet Security Audit Tools +esm-infra yes enabled UA Infra: Extended Security Maintenance (ESM) +fips yes n/a NIST-certified core packages +fips-updates yes n/a NIST-certified core packages with priority security updates +livepatch yes n/a Canonical Livepatch service +``` + +You can see now that `cis` is marked as `enabled` on status. + + +### Disable + +Let's suppose that you don't want a service anymore, you can also disable any service offering +through UA. For example, let's disable the `cis` service you just enabled by running on the LXD +container: + +```console +$ sudo ua disable cis +``` + +After running that command, let's now run `ua status` to see what happened to `cis`: +``` +SERVICE ENTITLED STATUS DESCRIPTION +cis yes disabled Center for Internet Security Audit Tools +esm-apps yes enabled UA Apps: Extended Security Maintenance (ESM) +esm-infra yes enabled UA Infra: Extended Security Maintenance (ESM) +fips yes n/a NIST-certified core packages +fips-updates yes n/a NIST-certified core packages with priority security updates +livepatch yes n/a Canonical Livepatch service +``` + +You can see that `cis` status is back to disabled. + +> Note: the disable command doesn't uninstall any package that was installed by +the service. The command only removes the access you have to the service, but it +doesn't undo any configuration that was applied on the machine. + +### Detach + +Finally, what if you don't want this machine to be attached to a UA subscription any longer ? +You can achieve that using the `detach` command: + +```console +$ sudo ua detach +``` + +This command will disable all of the UA services on the machine for you and +get rid of the subscription stored on your machine during attach. + +> Note: the detach command will also not uninstall any packages that were installed by +any service enabled through UA. + +### Final thoughts + +This tutorial has covered the 6 main commands of UA. If you need more advanced options to configure +the tool, please take a look in [How to guides](./docs/howtoguides). If that still doesn't cover +your needs, feel free to reach the UA team on `#ubuntu-server` on Libera IRC. + +Before you finish this tutorial, exit the container by running `CTRL-D` and delete it by running +this command on the machine: +```console +$ lxc delete --force dev-x +``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/tutorials/create_a_fips_docker_image.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/tutorials/create_a_fips_docker_image.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/tutorials/create_a_fips_docker_image.md 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/tutorials/create_a_fips_docker_image.md 2022-07-12 18:09:51.000000000 +0000 @@ -1,6 +1,6 @@ # Create an Ubuntu FIPS Docker image -> Requires UA Client version 27.7 +> Requires at least UA Client version 27.7 ## Step 1: Acquire your Ubuntu Advantage (UA) token @@ -8,7 +8,8 @@ The Ubuntu One account functions as a Single Sign On, so once logged in we can go straight to the Ubuntu Advantage dashboard at [ubuntu.com/advantage](https://ubuntu.com/advantage). Then we should see a list of our subscriptions (including the free for personal use subscription) in the left-hand column. Click on the subscription that you wish to use for this tutorial if it is not already selected. On the right we will now see the details of our subscription including our secret token under the "Subscription" header next to the "🔗" symbol. -> Warning: The UA token should be kept secret. It is used to uniquely identify your Ubuntu Advantage subscription. +> **Note** +> The UA token should be kept secret. It is used to uniquely identify your Ubuntu Advantage subscription. ## Step 2: Create a UA Attach Config file @@ -74,7 +75,8 @@ ## Step 5: Test the Docker image -> Warning: The docker image isn't considered fully FIPS compliant unless it is running on a host Ubuntu machine that is FIPS compliant. +> **Warning** +> The docker image isn't considered fully FIPS compliant unless it is running on a host Ubuntu machine that is FIPS compliant. Let's check to make sure the FIPS version of openssl is installed in the container. diff -Nru ubuntu-advantage-tools-27.9~18.04.1/docs/tutorials/ua_fix_scenarios.md ubuntu-advantage-tools-27.10.1~18.04.1/docs/tutorials/ua_fix_scenarios.md --- ubuntu-advantage-tools-27.9~18.04.1/docs/tutorials/ua_fix_scenarios.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/docs/tutorials/ua_fix_scenarios.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,374 @@ +# Using fix command to solve CVE/USNs on the machine + +The Ubuntu Advantage Tools (UA) program can be used to inspect and resolve +[CVEs](https://ubuntu.com/security/cves) and [USNs](https://ubuntu.com/security/notices) (Ubuntu +Security Notices) on this machine. + +Every CVE/USN is fixed by trying to upgrade all of the affected packages described by the CVE or +USN. Sometimes, the packages fixes can only be applied if an UA service is already enabled on the +machine. + +On this tutorial, we will cover the main scenarios that can happen when running the UA fix command. + +## Prerequisites + +On this tutorial, we will use [LXD](https://linuxcontainers.org/lxd/) containers. +To set up LXD on your computer, please follow this +[guide](https://linuxcontainers.org/lxd/getting-started-cli/). + +## Creating the Xenial LXD container + +To test the `ua fix` command, let's create a Xenial LXD container. Remember to set up LXD as +mentioned on the [Prerequisites](#prerequisites) section. After that, just run the command: + +```console +$ lxc launch ubuntu-daily:xenial dev-x +``` + +After running that, let's access the container by running: + +```console +$ lxc shell dev-x +``` + +Every time we say: "run the command" our intention will be for +you to run that command on your Xenial LXD container. + +## Using UA fix + +First, let's see what happens on your system when `ua fix` runs. We will choose +to fix a CVE that does not affect the Xenial container, +[CVE-2020-15180](https://ubuntu.com/security/CVE-2020-15180). This CVE address security +issues for the `MariaDB` package, which is not installed on the system. Let's confirm that +it doesn't affect the system by running this command: + +```console +$ ua fix CVE-2020-15180 +``` + +You should see an output like this one: + +``` +CVE-2020-15180: MariaDB vulnerabilities +https://ubuntu.com/security/CVE-2020-15180 +No affected source packages are installed. +✔ CVE-2020-15180 does not affect your system. +``` + +Every `ua fix` output will have a similar output structure where we describe the CVE/USN, +display the affected packages, fix the affected packages and at the end, show if the +CVE/USN is fully fixed in the machine. + +You can better see this on an `ua fix` call that does fix a package. Let's install a package +on the container that we know are associated with [CVE-2020-25686](https://ubuntu.com/security/CVE-2020-25686). +You can install that package by running these commands: + +```console +$ sudo apt update +$ sudo apt install dnsmasq=2.75-1 +``` + +Now you can run the following command: + +```console +$ sudo ua fix CVE-2020-25686 +``` + +You will then see the following output: + +``` +CVE-2020-25686: Dnsmasq vulnerabilities +https://ubuntu.com/security/CVE-2020-25686 +1 affected package is installed: dnsmasq +(1/1) dnsmasq: +A fix is available in Ubuntu standard updates. +{ apt update && apt install --only-upgrade -y dnsmasq } +✔ CVE-2020-25686 is resolved. +``` + +> **Note** +> We need to run the command with sudo because we are now installing a package on the system. + +Whenever `ua fix` has a package to upgrade, it follows a consistent structure and displays the +following in order + +1. The affected package +2. The availability of a fix +3. The location of the fix, if one is available +4. The command that will fix the issue + +Also, in the end of the output is the confirmation that the CVE was fixed by the command. +You can confirm that fix was successfully applied by running the same `ua fix` command again: + +``` +CVE-2020-25686: Dnsmasq vulnerabilities +https://ubuntu.com/security/CVE-2020-25686 +1 affected package is installed: dnsmasq +(1/1) dnsmasq: +A fix is available in Ubuntu standard updates. +The update is already installed. +✔ CVE-2020-25686 is resolved. +``` + +## CVE/USN without released fix + +Some CVE/USNs do not have a fix released yet. When that happens, `ua fix` will let you know +about this situation. Before we reproduce that scenario, you will first install a package by running: + +```console +$ sudo apt install -y libawl-php +``` + +Now, you can confirm that scenario by running the following command: + +```console +$ ua fix USN-4539-1 +``` + +You will see the following output: + +``` +USN-4539-1: AWL vulnerability +Found CVEs: +https://ubuntu.com/security/CVE-2020-11728 +1 affected source package is installed: awl +(1/1) awl: +Sorry, no fix is available. +1 package is still affected: awl +✘ USN-4539-1 is not resolved. +``` + +Notice that we inform that the is no fix available and in the last line the commands also +mentions that the USN is not resolved. + +## CVE/USN that require an UA subscription + +Some package fixes can only be installed when the machine is attached to an UA subscription. +When that happens, `ua fix` will let you know about that. To see an example of this scenario, +you can run the following fix command: + + +```console +$ sudo ua fix USN-5079-2 +``` + +You will see that the command will prompt you like this: + +``` +USN-5079-2: curl vulnerabilities +Found CVEs: +https://ubuntu.com/security/CVE-2021-22946 +https://ubuntu.com/security/CVE-2021-22947 +1 affected package is installed: curl +(1/1) curl: +A fix is available in UA Infra. +The update is not installed because this system is not attached to a +subscription. + +Choose: [S]ubscribe at ubuntu.com [A]ttach existing token [C]ancel +> +``` + +You can see that the prompt is asking for a UA subscription token. Any user with +a Ubuntu One account is entitled to a free personal token to use with UA. +If you choose the `Subscribe` option on the prompt, the command will ask you to go +to the [advantage](https://ubuntu.com/advantage/) portal. You can go into that portal +and get yourself a free subscription token by logging in with your +SSO credentials, the same credentials you use for https://login.ubuntu.com. + +After getting your UA token, you can hit `Enter` on the prompt and it will ask you +to provide the token you just obtained. After entering the token you are expected to +see now the following output: + +``` +USN-5079-2: curl vulnerabilities +Found CVEs: +https://ubuntu.com/security/CVE-2021-22946 +https://ubuntu.com/security/CVE-2021-22947 +1 affected package is installed: curl +(1/1) curl: +A fix is available in UA Infra. +The update is not installed because this system is not attached to a +subscription. + +Choose: [S]ubscribe at ubuntu.com [A]ttach existing token [C]ancel +>S +Open a browser to: https://ubuntu.com/advantage +Hit [Enter] when subscription is complete. +Enter your token (from https://ubuntu.com/advantage) to attach this system: +> TOKEN +{ ua attach TOKEN } +Enabling default service esm-infra +Updating package lists +UA Infra: ESM enabled +This machine is now attached to 'SUBSCRIPTION' + +SERVICE ENTITLED STATUS DESCRIPTION +cis yes disabled Center for Internet Security Audit Tools +esm-infra yes enabled UA Infra: Extended Security Maintenance (ESM) +fips yes n/a NIST-certified core packages +fips-updates yes n/a NIST-certified core packages with priority security updates +livepatch yes n/a Canonical Livepatch service + +NOTICES +Operation in progress: ua attach + +Enable services with: ua enable + + Account: UA Client Test + Subscription: SUBSCRIPTION + Valid until: 9999-12-31 00:00:00+00:00 +Technical support level: essential +{ apt update && apt install --only-upgrade -y curl libcurl3-gnutls } +✔ USN-5079-2 is resolved. +``` + +We can see that that the attach command was successful, which can be verified by +the status output we see when executing the command. Additionally, we can also observe +that the USN is indeed fixed, which you can confirm by running the command again: + +``` +N-5079-2: curl vulnerabilities +Found CVEs: +https://ubuntu.com/security/CVE-2021-22946 +https://ubuntu.com/security/CVE-2021-22947 +1 affected package is installed: curl +(1/1) curl: +A fix is available in UA Infra. +The update is already installed. +✔ USN-5079-2 is resolved. +``` + +> **Note** +> Even though we are not covering this scenario here, if you have an expired contract, +> `ua fix` will detect that and prompt you to attach a new token for your machine. + +## CVE/USN that requires an UA service + +Now, let's assume that you have attached to an UA subscription, but when running `ua fix`, +the required service that fixes the issue is not enabled. In that situation, `ua fix` will +also prompt you to enable that service. + +To confirm that, run the following command to disable `esm-infra`: + +```console +$ sudo ua disable esm-infra +``` + +Now, you can run the following command: + +```console +$ sudo ua fix CVE-2021-44731 +``` + +And you should see the following output (if you type `E` when prompted): + +``` +CVE-2021-44731: snapd vulnerabilities +https://ubuntu.com/security/CVE-2021-44731 +1 affected package is installed: snapd +(1/1) snapd: +A fix is available in UA Infra. +The update is not installed because this system does not have +esm-infra enabled. + +Choose: [E]nable esm-infra [C]ancel +> E +{ ua enable esm-infra } +One moment, checking your subscription first +Updating package lists +UA Infra: ESM enabled +{ apt update && apt install --only-upgrade -y ubuntu-core-launcher snapd } +✔ CVE-2021-44731 is resolved. +``` + +You can observe that the required service was enabled and `ua fix` was able to successfully upgrade +the affected package. + +## CVE/USN that requires reboot + +When running an `ua fix` command, sometimes we can install a package that requires +a system reboot to complete. The `ua fix` command can detect that and will inform you +about it. + +You can confirm this by running the following fix command: + +```console +$ sudo ua fix CVE-2022-0778 +``` + +Then you will see the following output: + +``` +VE-2022-0778: OpenSSL vulnerability +https://ubuntu.com/security/CVE-2022-0778 +1 affected package is installed: openssl +(1/1) openssl: +A fix is available in UA Infra. +{ apt update && apt install --only-upgrade -y libssl1.0.0 openssl } +A reboot is required to complete fix operation. +✘ CVE-2022-0778 is not resolved. +``` + +If we reboot the machine and run the command again, you will see that it is indeed fixed: + +``` +CVE-2022-0778: OpenSSL vulnerability +https://ubuntu.com/security/CVE-2022-0778 +1 affected package is installed: openssl +(1/1) openssl: +A fix is available in UA Infra. +The update is already installed. +✔ CVE-2022-0778 is resolved. +``` + +## Partially resolved CVE/USNs + +Finally, you might run a `ua fix` command that only partially fixes some of the packages affected. +This happens when only a subset of the packages have available updates to fix for that CVE/USN. +In this case, `ua fix` will inform of which package it can and cannot fix. + +But first, let's install some package so we can run `ua fix` to exercise that scenario. + +```console +$ sudo apt-get install expat=2.1.0-7 swish-e matanza ghostscript +``` + +Now, you can run the following command: + +```console +$ sudo ua fix CVE-2017-9233 +``` + +And you will see the following command: + +``` +CVE-2017-9233: Expat vulnerability +https://ubuntu.com/security/CVE-2017-9233 +3 affected packages are installed: expat, matanza, swish-e +(1/3, 2/3) matanza, swish-e: +Sorry, no fix is available. +(3/3) expat: +A fix is available in Ubuntu standard updates. +{ apt update && apt install --only-upgrade -y expat } +2 packages are still affected: matanza, swish-e +✘ CVE-2017-9233 is not resolved. +``` + +We can see that two packages, `matanza` and `swish-e`, don't have any fixes available, but there +is one for `expat`. In that scenario, we install the fix for `expat` and report at the end that +some packages are still affected. Also, observe that in this scenario we mark the CVE/USN as not +resolved. + +### Final thoughts + +This tutorial has covered the main scenario that can happen to you when running `ua fix`. +If you need more information about the command please feel free to reach the UA team on +`#ubuntu-server` on Libera IRC. + +Before you finish this tutorial, exit the container by running `CTRL-D` and delete it by running +this command on the host machine: + +```console +$ lxc delete --force dev-x +``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/apt_json_hook.feature ubuntu-advantage-tools-27.10.1~18.04.1/features/apt_json_hook.feature --- ubuntu-advantage-tools-27.9~18.04.1/features/apt_json_hook.feature 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/apt_json_hook.feature 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,99 @@ +Feature: APT JSON Hook + + @series.xenial + @uses.config.machine_type.lxd.container + Scenario Outline: APT JSON Hook prints package counts correctly on xenial + Given a `` machine with ubuntu-advantage-tools installed + When I attach `contract_token` with sudo + When I run `apt-get update` with sudo + When I run `apt-get upgrade -y` with sudo + + When I run `apt-get install -y --allow-downgrades ` with sudo + When I run `apt-get upgrade -y` with sudo + Then stdout matches regexp: + """ + 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. + 2 standard security updates + + """ + + When I run `apt-get install -y --allow-downgrades ` with sudo + When I run `apt-get upgrade -y` with sudo + Then stdout matches regexp: + """ + 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. + 2 esm-infra security updates + + """ + + When I run `apt-get install -y --allow-downgrades ` with sudo + When I run `apt-get upgrade -y` with sudo + Then stdout matches regexp: + """ + 1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. + 1 esm-apps security update + + """ + + When I run `apt-get install -y --allow-downgrades ` with sudo + When I run `apt-get install -y --allow-downgrades ` with sudo + When I run `apt-get upgrade -y` with sudo + Then stdout matches regexp: + """ + 4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. + 2 standard security updates and 2 esm-infra updates + + """ + + When I run `apt-get install -y --allow-downgrades ` with sudo + When I run `apt-get install -y --allow-downgrades ` with sudo + When I run `apt-get upgrade -y` with sudo + Then stdout matches regexp: + """ + 3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. + 2 standard security updates and 1 esm-apps update + + """ + + When I run `apt-get install -y --allow-downgrades ` with sudo + When I run `apt-get install -y --allow-downgrades ` with sudo + When I run `apt-get upgrade -y` with sudo + Then stdout matches regexp: + """ + 3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. + 2 esm-infra security updates and 1 esm-apps update + + """ + + When I run `apt-get install -y --allow-downgrades ` with sudo + When I run `apt-get install -y --allow-downgrades ` with sudo + When I run `apt-get install -y --allow-downgrades ` with sudo + When I run `apt-get upgrade -y` with sudo + Then stdout matches regexp: + """ + 5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. + 2 standard security updates, 2 esm-infra updates and 1 esm-apps update + + """ + + When I run `apt-get upgrade -y` with sudo + Then stdout matches regexp: + """ + 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. + """ + Then stdout does not match regexp: + """ + standard security update + """ + Then stdout does not match regexp: + """ + esm-infra + """ + Then stdout does not match regexp: + """ + esm-apps + """ + + Examples: ubuntu release + | release | standard-pkg | infra-pkg | apps-pkg | + | xenial | accountsservice=0.6.40-2ubuntu10 libaccountsservice0=0.6.40-2ubuntu10 | curl=7.47.0-1ubuntu2 libcurl3-gnutls=7.47.0-1ubuntu2 | libzstd1=1.3.1+dfsg-1~ubuntu0.16.04.1 | diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/attached_commands.feature ubuntu-advantage-tools-27.10.1~18.04.1/features/attached_commands.feature --- ubuntu-advantage-tools-27.9~18.04.1/features/attached_commands.feature 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/attached_commands.feature 2022-07-12 18:09:51.000000000 +0000 @@ -138,7 +138,7 @@ | xenial | cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch,\nrealtime-kernel, ros, ros-updates. | | bionic | cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch,\nrealtime-kernel, ros, ros-updates. | | focal | cc-eal, esm-apps, esm-infra, fips, fips-updates, livepatch, realtime-kernel,\nros, ros-updates, usg. | - | jammy | cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch,\nrealtime-kernel, ros, ros-updates. | + | jammy | cc-eal, esm-apps, esm-infra, fips, fips-updates, livepatch, realtime-kernel,\nros, ros-updates, usg. | @series.xenial @series.bionic @@ -156,8 +156,7 @@ And stderr matches regexp: """ Cannot disable unknown service 'foobar'. - Try cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch, - realtime-kernel, ros, ros-updates. + """ And I verify that running `ua disable esm-infra` `as non-root` exits `1` And stderr matches regexp: @@ -177,10 +176,10 @@ And I verify that running `apt update` `with sudo` exits `0` Examples: ubuntu release - | release | - | xenial | - | bionic | - | jammy | + | release | msg | + | xenial | Try cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch,\nrealtime-kernel, ros, ros-updates. | + | bionic | Try cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch,\nrealtime-kernel, ros, ros-updates. | + | jammy | Try cc-eal, esm-apps, esm-infra, fips, fips-updates, livepatch, realtime-kernel,\nros, ros-updates, usg. | @series.focal @uses.config.machine_type.lxd.container @@ -294,7 +293,7 @@ | xenial | yes | yes | yes | yes | yes | yes | cis | no | | bionic | yes | yes | yes | yes | yes | yes | cis | no | | focal | yes | no | yes | yes | yes | no | usg | no | - | jammy | yes | no | no | no | no | no | cis | yes | + | jammy | yes | no | no | no | no | no | usg | yes | @series.all @uses.config.machine_type.lxd.container @@ -344,7 +343,7 @@ @series.all @uses.config.machine_type.lxd.container - Scenario Outline: Unattached status in a ubuntu machine with feature overrides + 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: """ @@ -371,14 +370,30 @@ And I attach `contract_token` with sudo And I run `ua status --all` with sudo Then stdout matches regexp: - """ - SERVICE +ENTITLED STATUS DESCRIPTION - cc-eal +no - """ - When I run `ua --version` as non-root - Then I will see the uaclient version on stdout with features ` +disable_auto_attach +machine_token_overlay -other` - When I run `ua version` as non-root - Then I will see the uaclient version on stdout with features ` +disable_auto_attach +machine_token_overlay -other` + """ + SERVICE +ENTITLED STATUS DESCRIPTION + cc-eal +no + """ + And stdout matches regexp: + """ + FEATURES + disable_auto_attach: True + machine_token_overlay: /tmp/machine-token-overlay.json + other: False + """ + When I run `ua status --all` as non-root + Then stdout matches regexp: + """ + SERVICE +ENTITLED STATUS DESCRIPTION + cc-eal +no + """ + And stdout matches regexp: + """ + FEATURES + disable_auto_attach: True + machine_token_overlay: /tmp/machine-token-overlay.json + other: False + """ When I run `ua auto-attach` with sudo Then stdout matches regexp: """ @@ -583,12 +598,12 @@ | bionic | enabled | | xenial | enabled | | impish | n/a | - | jammy | enabled | + @series.jammy @series.focal @uses.config.machine_type.lxd.container - Scenario: Help command on an attached machine - Given a `focal` machine with ubuntu-advantage-tools installed + Scenario Outline: Help command on an attached machine + Given a `` machine with ubuntu-advantage-tools installed When I attach `contract_token` with sudo And I run `ua help esm-infra` with sudo Then I will see the following on stdout: @@ -681,6 +696,11 @@ \(https://ubuntu.com/security/certifications/docs/usg\) """ + Examples: ubuntu release + | release | + | focal | + | jammy | + @series.lts @uses.config.machine_type.lxd.container Scenario Outline: Enable command with invalid repositories in user machine @@ -806,52 +826,6 @@ @series.lts @uses.config.machine_type.lxd.container - Scenario Outline: Run collect-logs on an attached machine - Given a `` machine with ubuntu-advantage-tools installed - When I attach `contract_token` with sudo - And I run `python3 /usr/lib/ubuntu-advantage/timer.py` with sudo - And I verify that running `ua collect-logs` `as non-root` exits `1` - Then I will see the following on stderr: - """ - This command must be run as root (try using sudo). - """ - When I run `ua collect-logs` with sudo - Then I verify that files exist matching `ua_logs.tar.gz` - When I run `tar zxf ua_logs.tar.gz` as non-root - Then I verify that files exist matching `logs/` - When I run `sh -c "ls -1 logs/ | sort -d"` as non-root - # On Xenial, the return value for inexistent services is the same as for dead ones (3). - # So the -error suffix does not appear there. - Then stdout matches regexp: - """ - build.info - cloud-id.txt - jobs-status.json - journalctl.txt - livepatch-status.txt-error - systemd-timers.txt - ua-auto-attach.path.txt(-error)? - ua-auto-attach.service.txt(-error)? - uaclient.conf - ua-reboot-cmds.service.txt - ua-status.json - ua-timer.service.txt - ua-timer.timer.txt - ubuntu-advantage.log - ubuntu-advantage.service.txt - ubuntu-advantage-timer.log - ubuntu-esm-apps.list - ubuntu-esm-infra.list - """ - Examples: ubuntu release - | release | - | xenial | - | bionic | - | focal | - | jammy | - - @series.lts - @uses.config.machine_type.lxd.container Scenario Outline: Run timer script to valid machine activity endpoint Given a `` machine with ubuntu-advantage-tools installed When I attach `contract_token` with sudo @@ -967,6 +941,10 @@ """ "status": "pending_attach" """ + And stdout matches regexp: + """ + "download_size": \d+ + """ When I attach `contract_token` with sudo And I run `ua security-status --format json` as non-root Then stdout matches regexp: @@ -989,6 +967,10 @@ """ "status": "upgrade_available" """ + And stdout matches regexp: + """ + "download_size": \d+ + """ When I run `ua security-status --format yaml` as non-root Then stdout is a yaml matching the `ua_security_status` schema And stdout matches regexp: diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/attached_enable.feature ubuntu-advantage-tools-27.10.1~18.04.1/features/attached_enable.feature --- ubuntu-advantage-tools-27.9~18.04.1/features/attached_enable.feature 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/attached_enable.feature 2022-07-12 18:09:51.000000000 +0000 @@ -183,7 +183,7 @@ | xenial | cc-eal, cis, esm-infra, fips, fips-updates, livepatch. | | bionic | cc-eal, cis, esm-infra, fips, fips-updates, livepatch. | | focal | cc-eal, esm-infra, fips, fips-updates, livepatch, usg. | - | jammy | cc-eal, cis, esm-infra, fips, fips-updates, livepatch. | + | jammy | cc-eal, esm-infra, fips, fips-updates, livepatch, usg. | @series.lts @uses.config.machine_type.lxd.container diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/attach_validtoken.feature ubuntu-advantage-tools-27.10.1~18.04.1/features/attach_validtoken.feature --- ubuntu-advantage-tools-27.9~18.04.1/features/attach_validtoken.feature 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/attach_validtoken.feature 2022-07-12 18:09:51.000000000 +0000 @@ -173,7 +173,7 @@ | xenial | libkrad0=1.13.2+dfsg-5 | disabled | cis | disabled | disabled | Canonical Livepatch service | | bionic | libkrad0=1.16-2build1 | disabled | cis | disabled | disabled | Canonical Livepatch service | | focal | hello=2.10-2ubuntu2 | n/a | usg | disabled | disabled | Canonical Livepatch service | - | jammy | hello=2.10-2ubuntu4 | n/a | cis | n/a | n/a | Available with the HWE kernel | + | jammy | hello=2.10-2ubuntu4 | n/a | usg | n/a | n/a | Available with the HWE kernel | @series.lts @uses.config.machine_type.lxd.container @@ -240,7 +240,7 @@ Then stderr matches regexp: """ Error while reading /tmp/attach.yaml: Got value with incorrect type for field - "token": Expected value with type StringDataValue but got value: None + "token": Expected value with type StringDataValue but got type: null """ # other schema error When I create the file `/tmp/attach.yaml` with the following @@ -253,7 +253,7 @@ Then stderr matches regexp: """ Error while reading /tmp/attach.yaml: Got value with incorrect type for field - "enable_services": Expected value with type list but got value: {\'cis\': True} + "enable_services": Expected value with type list but got type: dict """ # invalid service name When I create the file `/tmp/attach.yaml` with the following @@ -343,7 +343,7 @@ | xenial | disabled |enabled | Canonical Livepatch service | disabled | cis | disabled | | bionic | disabled |enabled | Canonical Livepatch service | disabled | cis | disabled | | focal | disabled |enabled | Canonical Livepatch service | n/a | usg | disabled | - | jammy | n/a |enabled | Canonical Livepatch service | n/a | cis | n/a | + | jammy | n/a |enabled | Canonical Livepatch service | n/a | usg | n/a | @series.all @uses.config.machine_type.azure.generic @@ -401,10 +401,10 @@ Examples: ubuntu release livepatch status | release | lp_status | fips_status | cc_status | cis_or_usg | cis_status | - | xenial | enabled | n/a | disabled | cis | disabled | + | xenial | enabled | disabled | disabled | cis | disabled | | bionic | enabled | disabled | disabled | cis | disabled | | focal | enabled | disabled | n/a | usg | disabled | - | jammy | enabled | n/a | n/a | cis | n/a | + | jammy | enabled | n/a | n/a | usg | n/a | @series.all @uses.config.machine_type.gcp.generic @@ -463,9 +463,9 @@ Examples: ubuntu release livepatch status | release | lp_status | fips_status | cc_status | cis_or_usg | cis_status | | xenial | n/a | n/a | disabled | cis | disabled | - | bionic | n/a | disabled | disabled | cis | disabled | + | bionic | enabled | disabled | disabled | cis | disabled | | focal | enabled | disabled | n/a | usg | disabled | - | jammy | enabled | n/a | n/a | cis | n/a | + | jammy | enabled | n/a | n/a | usg | n/a | @series.all @uses.config.machine_type.lxd.container diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/aws-ids.yaml ubuntu-advantage-tools-27.10.1~18.04.1/features/aws-ids.yaml --- ubuntu-advantage-tools-27.9~18.04.1/features/aws-ids.yaml 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/aws-ids.yaml 2022-07-12 18:09:51.000000000 +0000 @@ -1,6 +1,7 @@ -bionic: ami-02b4e50c1ebb5034c +bionic: ami-0ab76d42180343ad1 bionic-fips: ami-03b75f613f80bcff1 -focal: ami-01deb29ae4e3b9c97 +focal: ami-098bbb131bcc971d9 focal-fips: ami-02782bf2569bf457c +jammy: ami-0e6235eb0fe67fd3c xenial: ami-011bcfe2bea365b6a xenial-fips: ami-077e4c339a098fc9f diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/azure-ids.yaml ubuntu-advantage-tools-27.10.1~18.04.1/features/azure-ids.yaml --- ubuntu-advantage-tools-27.9~18.04.1/features/azure-ids.yaml 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/azure-ids.yaml 2022-07-12 18:09:51.000000000 +0000 @@ -1,5 +1,6 @@ bionic: "Canonical:0001-com-ubuntu-pro-bionic:pro-18_04-lts" focal: "Canonical:0001-com-ubuntu-pro-focal:pro-20_04-lts" +jammy: "Canonical:0001-com-ubuntu-pro-jammy:pro-22_04-lts" xenial: "Canonical:0001-com-ubuntu-pro-xenial:pro-16_04-lts" bionic-fips: "Canonical:0001-com-ubuntu-pro-bionic-fips:pro-fips-18_04" xenial-fips: "Canonical:0001-com-ubuntu-pro-xenial-fips:pro-fips-16_04-private" diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/cloud.py ubuntu-advantage-tools-27.10.1~18.04.1/features/cloud.py --- ubuntu-advantage-tools-27.9~18.04.1/features/cloud.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/cloud.py 2022-07-12 18:09:51.000000000 +0000 @@ -486,8 +486,10 @@ if self.service_account_email: return - gcp_credentials_path = credentials.get("gce", {}).get( - "credentials_path" + gcp_credentials_path = os.path.expandvars( + os.path.expanduser( + credentials.get("gce", {}).get("credentials_path") + ) ) if gcp_credentials_path: with open(gcp_credentials_path, "r") as f: diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/collect_logs.feature ubuntu-advantage-tools-27.10.1~18.04.1/features/collect_logs.feature --- ubuntu-advantage-tools-27.9~18.04.1/features/collect_logs.feature 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/collect_logs.feature 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,110 @@ +@uses.config.contract_token +Feature: Command behaviour when attached to an UA subscription + + @series.all + @uses.config.machine_type.lxd.container + Scenario Outline: Run collect-logs on an unattached machine + Given a `` machine with ubuntu-advantage-tools installed + When I run `python3 /usr/lib/ubuntu-advantage/timer.py` with sudo + And I verify that running `ua collect-logs` `as non-root` exits `1` + Then I will see the following on stderr: + """ + This command must be run as root (try using sudo). + """ + # simulate logrotate + When I run `touch /var/log/ubuntu-advantage.log.1` with sudo + When I run `touch /var/log/ubuntu-advantage.log.2.gz` with sudo + When I run `touch /var/log/ubuntu-advantage-timer.log.1` with sudo + When I run `touch /var/log/ubuntu-advantage-timer.log.2.gz` with sudo + When I run `ua collect-logs` with sudo + Then I verify that files exist matching `ua_logs.tar.gz` + When I run `tar zxf ua_logs.tar.gz` as non-root + Then I verify that files exist matching `logs/` + When I run `sh -c "ls -1 logs/ | sort -d"` as non-root + # On Xenial, the return value for inexistent services is the same as for dead ones (3). + # So the -error suffix does not appear there. + Then stdout matches regexp: + """ + build.info + cloud-id.txt + jobs-status.json + journalctl.txt + livepatch-status.txt-error + systemd-timers.txt + ua-auto-attach.path.txt(-error)? + ua-auto-attach.service.txt(-error)? + uaclient.conf + ua-reboot-cmds.service.txt + ua-status.json + ua-timer.service.txt + ua-timer.timer.txt + ubuntu-advantage.log + ubuntu-advantage.log.1 + ubuntu-advantage.log.2.gz + ubuntu-advantage.service.txt + ubuntu-advantage-timer.log + ubuntu-advantage-timer.log.1 + ubuntu-advantage-timer.log.2.gz + """ + Examples: ubuntu release + | release | + | xenial | + | bionic | + | focal | + | impish | + | jammy | + + @series.lts + @uses.config.machine_type.lxd.container + Scenario Outline: Run collect-logs on an attached machine + Given a `` machine with ubuntu-advantage-tools installed + When I attach `contract_token` with sudo + And I run `python3 /usr/lib/ubuntu-advantage/timer.py` with sudo + And I verify that running `ua collect-logs` `as non-root` exits `1` + Then I will see the following on stderr: + """ + This command must be run as root (try using sudo). + """ + # simulate logrotate + When I run `touch /var/log/ubuntu-advantage.log.1` with sudo + When I run `touch /var/log/ubuntu-advantage.log.2.gz` with sudo + When I run `touch /var/log/ubuntu-advantage-timer.log.1` with sudo + When I run `touch /var/log/ubuntu-advantage-timer.log.2.gz` with sudo + When I run `ua collect-logs` with sudo + Then I verify that files exist matching `ua_logs.tar.gz` + When I run `tar zxf ua_logs.tar.gz` as non-root + Then I verify that files exist matching `logs/` + When I run `sh -c "ls -1 logs/ | sort -d"` as non-root + # On Xenial, the return value for inexistent services is the same as for dead ones (3). + # So the -error suffix does not appear there. + Then stdout matches regexp: + """ + build.info + cloud-id.txt + jobs-status.json + journalctl.txt + livepatch-status.txt-error + systemd-timers.txt + ua-auto-attach.path.txt(-error)? + ua-auto-attach.service.txt(-error)? + uaclient.conf + ua-reboot-cmds.service.txt + ua-status.json + ua-timer.service.txt + ua-timer.timer.txt + ubuntu-advantage.log + ubuntu-advantage.log.1 + ubuntu-advantage.log.2.gz + ubuntu-advantage.service.txt + ubuntu-advantage-timer.log + ubuntu-advantage-timer.log.1 + ubuntu-advantage-timer.log.2.gz + ubuntu-esm-apps.list + ubuntu-esm-infra.list + """ + Examples: ubuntu release + | release | + | xenial | + | bionic | + | focal | + | jammy | diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/detached_auto_attach.feature ubuntu-advantage-tools-27.10.1~18.04.1/features/detached_auto_attach.feature --- ubuntu-advantage-tools-27.9~18.04.1/features/detached_auto_attach.feature 2022-04-01 13:27:49.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/detached_auto_attach.feature 2022-07-12 18:09:51.000000000 +0000 @@ -10,10 +10,11 @@ When I attach `contract_token` with sudo And I run `ua refresh` with sudo Then I will see the following on stdout: - """ - Successfully processed your ua configuration. - Successfully refreshed your subscription. - """ + """ + Successfully processed your ua configuration. + Successfully refreshed your subscription. + Successfully updated UA related APT and MOTD messages. + """ When I run `ua auto-attach` with sudo Then stderr matches regexp: """ diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/environment.py ubuntu-advantage-tools-27.10.1~18.04.1/features/environment.py --- ubuntu-advantage-tools-27.9~18.04.1/features/environment.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/environment.py 2022-07-12 18:09:51.000000000 +0000 @@ -6,14 +6,14 @@ import re import string import textwrap -from typing import Any, Dict, List, Optional, Tuple, Union # noqa: F401 +from typing import Dict, List, Optional, Tuple, Union # noqa: F401 import pycloudlib # type: ignore from behave.model import Feature, Scenario from behave.runner import Context import features.cloud as cloud -from features.util import build_debs, emit_spinner_on_travis, lxc_get_property +from features.util import build_debs, lxc_get_property ALL_SUPPORTED_SERIES = ["bionic", "focal", "xenial"] @@ -22,7 +22,7 @@ USERDATA_BLOCK_AUTO_ATTACH_IMG = """\ #cloud-config -bootcmd: +[bootcmd, once]: - cp /usr/bin/ua /usr/bin/ua.orig - 'echo "#!/bin/sh\ndate >> /root/ua-calls\n" > /usr/bin/ua' - chmod 755 /usr/bin/ua @@ -302,7 +302,7 @@ def from_environ(cls, config) -> "UAClientBehaveConfig": """Gather config options from os.environ and return a config object""" # First, gather all known options - kwargs: Dict[str, Union[str, bool, "List"]] = {} + kwargs = {} # type: Dict[str, Union[str, bool, List]] # Preserve cmdline_tags for reference if not config.tags.ands: kwargs["cmdline_tags"] = [] @@ -607,13 +607,11 @@ logging.info( "--- Could not find any debs to reuse. Building it locally" ) - - with emit_spinner_on_travis("Building debs from local source... "): - deb_paths = build_debs( - series=series, - cache_source=context.config.cache_source, - chroot=context.config.sbuild_chroot, - ) + deb_paths = build_debs( + series=series, + cache_source=context.config.cache_source, + chroot=context.config.sbuild_chroot, + ) if "pro" in context.config.machine_type: return deb_paths @@ -722,13 +720,13 @@ :param config: UAClientBehaveConfig :param deb_paths: Optional paths to local deb files we need to install """ - cmds: List[Any] = [["systemctl", "is-system-running", "--wait"]] + cmds = ["systemctl is-system-running --wait"] # type: List[str] if deb_paths is None: deb_paths = [] if deb_paths: - cmds.append(["sudo", "apt-get", "update", "-qqy"]) + cmds.append("sudo apt-get update -qqy") deb_files = [] inst = config.cloud_api.get_instance(container_id) @@ -761,7 +759,7 @@ if "pro" in machine_type: ua_pkg.append("ubuntu-advantage-pro") - cmds.append(["sudo", "apt-get", "update"]) + cmds.append("sudo apt-get update") cmds.append( " ".join( [ @@ -791,7 +789,7 @@ cmds.append("sudo ua status --wait") cmds.append("sudo ua detach --assume-yes") - cmds.append(["ua", "version"]) + cmds.append("ua version") instance = config.cloud_api.get_instance(container_id) for cmd in cmds: # type: ignore result = instance.execute(cmd) diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/fix.feature ubuntu-advantage-tools-27.10.1~18.04.1/features/fix.feature --- ubuntu-advantage-tools-27.9~18.04.1/features/fix.feature 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/fix.feature 2022-07-12 18:09:51.000000000 +0000 @@ -101,114 +101,170 @@ And I reboot the `` machine And I verify that running `ua fix USN-4539-1` `as non-root` exits `1` Then stdout matches regexp: - """ - USN-4539-1: AWL vulnerability - Found CVEs: - https://ubuntu.com/security/CVE-2020-11728 - 1 affected source package is installed: awl - \(1/1\) awl: - Sorry, no fix is available. - 1 package is still affected: awl - .*✘.* USN-4539-1 is not resolved. - """ + """ + USN-4539-1: AWL vulnerability + Found CVEs: + https://ubuntu.com/security/CVE-2020-11728 + 1 affected source package is installed: awl + \(1/1\) awl: + Sorry, no fix is available. + 1 package is still affected: awl + .*✘.* USN-4539-1 is not resolved. + """ When I run `ua fix CVE-2020-15180` as non-root Then stdout matches regexp: - """ - CVE-2020-15180: MariaDB vulnerabilities - https://ubuntu.com/security/CVE-2020-15180 - No affected source packages are installed. - .*✔.* CVE-2020-15180 does not affect your system. - """ + """ + CVE-2020-15180: MariaDB vulnerabilities + https://ubuntu.com/security/CVE-2020-15180 + No affected source packages are installed. + .*✔.* CVE-2020-15180 does not affect your system. + """ When I run `ua fix CVE-2020-28196` as non-root Then stdout matches regexp: - """ - CVE-2020-28196: Kerberos vulnerability - https://ubuntu.com/security/CVE-2020-28196 - 1 affected source package is installed: krb5 - \(1/1\) krb5: - A fix is available in Ubuntu standard updates. - The update is already installed. - .*✔.* CVE-2020-28196 is resolved. - """ + """ + CVE-2020-28196: Kerberos vulnerability + https://ubuntu.com/security/CVE-2020-28196 + 1 affected source package is installed: krb5 + \(1/1\) krb5: + A fix is available in Ubuntu standard updates. + The update is already installed. + .*✔.* CVE-2020-28196 is resolved. + """ When I run `DEBIAN_FRONTEND=noninteractive apt-get install -y expat=2.1.0-7 swish-e matanza ghostscript` with sudo - And I verify that running `ua fix CVE-2017-9233` `with sudo` exits `1` + And I verify that running `ua fix CVE-2017-9233 --dry-run` `as non-root` exits `1` Then stdout matches regexp: - """ - CVE-2017-9233: Expat vulnerability - https://ubuntu.com/security/CVE-2017-9233 - 3 affected source packages are installed: expat, matanza, swish-e - \(1/3, 2/3\) matanza, swish-e: - Sorry, no fix is available. - \(3/3\) expat: - A fix is available in Ubuntu standard updates. - .*\{ apt update && apt install --only-upgrade -y expat \}.* - 2 packages are still affected: matanza, swish-e - .*✘.* CVE-2017-9233 is not resolved. - """ + """ + .*WARNING: The option --dry-run is being used. + No packages will be installed when running this command..* + CVE-2017-9233: Expat vulnerability + https://ubuntu.com/security/CVE-2017-9233 + 3 affected source packages are installed: expat, matanza, swish-e + \(1/3, 2/3\) matanza, swish-e: + Sorry, no fix is available. + \(3/3\) expat: + A fix is available in Ubuntu standard updates. + .*\{ apt update && apt install --only-upgrade -y expat \}.* + 2 packages are still affected: matanza, swish-e + .*✘.* CVE-2017-9233 is not resolved. + """ + When I verify that running `ua fix CVE-2017-9233` `with sudo` exits `1` + Then stdout matches regexp: + """ + CVE-2017-9233: Expat vulnerability + https://ubuntu.com/security/CVE-2017-9233 + 3 affected source packages are installed: expat, matanza, swish-e + \(1/3, 2/3\) matanza, swish-e: + Sorry, no fix is available. + \(3/3\) expat: + A fix is available in Ubuntu standard updates. + .*\{ apt update && apt install --only-upgrade -y expat \}.* + 2 packages are still affected: matanza, swish-e + .*✘.* CVE-2017-9233 is not resolved. + """ + When I run `ua fix USN-5079-2 --dry-run` as non-root + Then stdout matches regexp: + """ + .*WARNING: The option --dry-run is being used. + No packages will be installed when running this command..* + USN-5079-2: curl vulnerabilities + Found CVEs: + https://ubuntu.com/security/CVE-2021-22946 + https://ubuntu.com/security/CVE-2021-22947 + 1 affected source package is installed: curl + \(1/1\) curl: + A fix is available in UA Infra. + .*The machine is not attached to an Ubuntu Advantage \(UA\) subscription. + To proceed with the fix, a prompt would ask for a valid UA token. + \{ ua attach TOKEN \}.* + .*UA service: esm-infra is not enabled. + To proceed with the fix, a prompt would ask permission to automatically enable + this service. + \{ ua enable esm-infra \}.* + .*\{ apt update && apt install --only-upgrade -y curl libcurl3-gnutls \}.* + .*✔.* USN-5079-2 is resolved. + """ When I fix `USN-5079-2` by attaching to a subscription with `contract_token_staging_expired` Then stdout matches regexp - """ - USN-5079-2: curl vulnerabilities - Found CVEs: - https://ubuntu.com/security/CVE-2021-22946 - https://ubuntu.com/security/CVE-2021-22947 - 1 affected source package is installed: curl - \(1/1\) curl: - A fix is available in UA Infra. - The update is not installed because this system is not attached to a - subscription. + """ + USN-5079-2: curl vulnerabilities + Found CVEs: + https://ubuntu.com/security/CVE-2021-22946 + https://ubuntu.com/security/CVE-2021-22947 + 1 affected source package is installed: curl + \(1/1\) curl: + A fix is available in UA Infra. + The update is not installed because this system is not attached to a + subscription. - Choose: \[S\]ubscribe at ubuntu.com \[A\]ttach existing token \[C\]ancel - > Enter your token \(from https://ubuntu.com/advantage\) to attach this system: - > .*\{ ua attach .*\}.* - Attach denied: - Contract ".*" expired on .* - Visit https://ubuntu.com/advantage to manage contract tokens. - 1 package is still affected: curl - .*✘.* USN-5079-2 is not resolved. - """ + Choose: \[S\]ubscribe at ubuntu.com \[A\]ttach existing token \[C\]ancel + > Enter your token \(from https://ubuntu.com/advantage\) to attach this system: + > .*\{ ua attach .*\}.* + Attach denied: + Contract ".*" expired on .* + Visit https://ubuntu.com/advantage to manage contract tokens. + 1 package is still affected: curl + .*✘.* USN-5079-2 is not resolved. + """ When I fix `USN-5079-2` by attaching to a subscription with `contract_token` Then stdout matches regexp: - """ - USN-5079-2: curl vulnerabilities - Found CVEs: - https://ubuntu.com/security/CVE-2021-22946 - https://ubuntu.com/security/CVE-2021-22947 - 1 affected source package is installed: curl - \(1/1\) curl: - A fix is available in UA Infra. - The update is not installed because this system is not attached to a - subscription. + """ + USN-5079-2: curl vulnerabilities + Found CVEs: + https://ubuntu.com/security/CVE-2021-22946 + https://ubuntu.com/security/CVE-2021-22947 + 1 affected source package is installed: curl + \(1/1\) curl: + A fix is available in UA Infra. + The update is not installed because this system is not attached to a + subscription. - Choose: \[S\]ubscribe at ubuntu.com \[A\]ttach existing token \[C\]ancel - > Enter your token \(from https://ubuntu.com/advantage\) to attach this system: - > .*\{ ua attach .*\}.* - Updating package lists - UA Apps: ESM enabled - Updating package lists - UA Infra: ESM enabled - """ + Choose: \[S\]ubscribe at ubuntu.com \[A\]ttach existing token \[C\]ancel + > Enter your token \(from https://ubuntu.com/advantage\) to attach this system: + > .*\{ ua attach .*\}.* + Updating package lists + UA Apps: ESM enabled + Updating package lists + UA Infra: ESM enabled + """ And stdout matches regexp: - """ - .*\{ apt update && apt install --only-upgrade -y curl libcurl3-gnutls \}.* - .*✔.* USN-5079-2 is resolved. - """ + """ + .*\{ apt update && apt install --only-upgrade -y curl libcurl3-gnutls \}.* + .*✔.* USN-5079-2 is resolved. + """ When I verify that running `ua fix USN-5051-2` `with sudo` exits `2` Then stdout matches regexp: - """ - USN-5051-2: OpenSSL vulnerability - Found CVEs: - https://ubuntu.com/security/CVE-2021-3712 - 1 affected source package is installed: openssl - \(1/1\) openssl: - A fix is available in UA Infra. - .*\{ apt update && apt install --only-upgrade -y libssl1.0.0 openssl \}.* - A reboot is required to complete fix operation. - .*✘.* USN-5051-2 is not resolved. - """ + """ + USN-5051-2: OpenSSL vulnerability + Found CVEs: + https://ubuntu.com/security/CVE-2021-3712 + 1 affected source package is installed: openssl + \(1/1\) openssl: + A fix is available in UA Infra. + .*\{ apt update && apt install --only-upgrade -y libssl1.0.0 openssl \}.* + A reboot is required to complete fix operation. + .*✘.* USN-5051-2 is not resolved. + """ When I run `ua disable esm-infra` with sudo And I run `apt-get install gzip -y` with sudo - And I run `ua fix USN-5378-4` `with sudo` and stdin `E` + And I run `ua fix USN-5378-4 --dry-run` as non-root + Then stdout matches regexp: + """ + .*WARNING: The option --dry-run is being used. + No packages will be installed when running this command..* + USN-5378-4: Gzip vulnerability + Found CVEs: + https://ubuntu.com/security/CVE-2022-1271 + 2 affected source packages are installed: gzip, xz-utils + \(1/2, 2/2\) gzip, xz-utils: + A fix is available in UA Infra. + .*UA service: esm-infra is not enabled. + To proceed with the fix, a prompt would ask permission to automatically enable + this service. + \{ ua enable esm-infra \}.* + .*\{ apt update && apt install --only-upgrade -y gzip liblzma5 xz-utils \}.* + .*✔.* USN-5378-4 is resolved. + """ + When I run `ua fix USN-5378-4` `with sudo` and stdin `E` Then stdout matches regexp: """ USN-5378-4: Gzip vulnerability @@ -239,50 +295,64 @@ Given a `bionic` machine with ubuntu-advantage-tools installed When I verify that running `ua fix CVE-1800-123456` `as non-root` exits `1` Then I will see the following on stderr: - """ - Error: CVE-1800-123456 not found. - """ + """ + Error: CVE-1800-123456 not found. + """ When I verify that running `ua fix USN-12345-12` `as non-root` exits `1` Then I will see the following on stderr: - """ - Error: USN-12345-12 not found. - """ + """ + Error: USN-12345-12 not found. + """ When I verify that running `ua fix CVE-12345678-12` `as non-root` exits `1` Then I will see the following on stderr: - """ - Error: issue "CVE-12345678-12" is not recognized. - Usage: "ua fix CVE-yyyy-nnnn" or "ua fix USN-nnnn" - """ + """ + Error: issue "CVE-12345678-12" is not recognized. + Usage: "ua fix CVE-yyyy-nnnn" or "ua fix USN-nnnn" + """ When I verify that running `ua fix USN-12345678-12` `as non-root` exits `1` Then I will see the following on stderr: - """ - Error: issue "USN-12345678-12" is not recognized. - Usage: "ua fix CVE-yyyy-nnnn" or "ua fix USN-nnnn" - """ + """ + Error: issue "USN-12345678-12" is not recognized. + Usage: "ua fix CVE-yyyy-nnnn" or "ua fix USN-nnnn" + """ When I run `apt install -y libawl-php` with sudo - And I verify that running `ua fix USN-4539-1` `as non-root` exits `1` + And I verify that running `ua fix USN-4539-1 --dry-run` `as non-root` exits `1` Then stdout matches regexp: - """ - USN-4539-1: AWL vulnerability - Found CVEs: - https://ubuntu.com/security/CVE-2020-11728 - 1 affected source package is installed: awl - \(1/1\) awl: - Ubuntu security engineers are investigating this issue. - 1 package is still affected: awl - .*✘.* USN-4539-1 is not resolved. - """ + """ + .*WARNING: The option --dry-run is being used. + No packages will be installed when running this command..* + USN-4539-1: AWL vulnerability + Found CVEs: + https://ubuntu.com/security/CVE-2020-11728 + 1 affected source package is installed: awl + \(1/1\) awl: + Ubuntu security engineers are investigating this issue. + 1 package is still affected: awl + .*✘.* USN-4539-1 is not resolved. + """ + When I verify that running `ua fix USN-4539-1` `as non-root` exits `1` + Then stdout matches regexp: + """ + USN-4539-1: AWL vulnerability + Found CVEs: + https://ubuntu.com/security/CVE-2020-11728 + 1 affected source package is installed: awl + \(1/1\) awl: + Ubuntu security engineers are investigating this issue. + 1 package is still affected: awl + .*✘.* USN-4539-1 is not resolved. + """ When I run `ua fix CVE-2020-28196` as non-root Then stdout matches regexp: - """ - CVE-2020-28196: Kerberos vulnerability - https://ubuntu.com/security/CVE-2020-28196 - 1 affected source package is installed: krb5 - \(1/1\) krb5: - A fix is available in Ubuntu standard updates. - The update is already installed. - .*✔.* CVE-2020-28196 is resolved. - """ + """ + CVE-2020-28196: Kerberos vulnerability + https://ubuntu.com/security/CVE-2020-28196 + 1 affected source package is installed: krb5 + \(1/1\) krb5: + A fix is available in Ubuntu standard updates. + The update is already installed. + .*✔.* CVE-2020-28196 is resolved. + """ When I run `apt-get install xterm=330-1ubuntu2 -y` with sudo And I verify that running `ua fix CVE-2021-27135` `as non-root` exits `1` Then stdout matches regexp: @@ -297,6 +367,19 @@ 1 package is still affected: xterm .*✘.* CVE-2021-27135 is not resolved. """ + When I run `ua fix CVE-2021-27135 --dry-run` with sudo + Then stdout matches regexp: + """ + .*WARNING: The option --dry-run is being used. + No packages will be installed when running this command..* + CVE-2021-27135: xterm vulnerability + https://ubuntu.com/security/CVE-2021-27135 + 1 affected source package is installed: xterm + \(1/1\) xterm: + A fix is available in Ubuntu standard updates. + .*\{ apt update && apt install --only-upgrade -y xterm \}.* + .*✔.* CVE-2021-27135 is resolved. + """ When I run `ua fix CVE-2021-27135` with sudo Then stdout matches regexp: """ diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/gcp-ids.yaml ubuntu-advantage-tools-27.10.1~18.04.1/features/gcp-ids.yaml --- ubuntu-advantage-tools-27.9~18.04.1/features/gcp-ids.yaml 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/gcp-ids.yaml 2022-07-12 18:09:51.000000000 +0000 @@ -1,5 +1,6 @@ -bionic: projects/ubuntu-os-pro-cloud/global/images/ubuntu-pro-1804-bionic-v20220411 +bionic: projects/ubuntu-os-pro-cloud/global/images/ubuntu-pro-1804-bionic-v20220510 bionic-fips: projects/ubuntu-os-pro-cloud/global/images/ubuntu-pro-fips-1804-bionic-v20220411a -focal: projects/ubuntu-os-pro-cloud/global/images/ubuntu-pro-2004-focal-v20220411 +focal: projects/ubuntu-os-pro-cloud/global/images/ubuntu-pro-2004-focal-v20220426 focal-fips: projects/ubuntu-os-pro-cloud/global/images/ubuntu-pro-fips-2004-focal-v20220411b +jammy: projects/ubuntu-os-pro-cloud/global/images/ubuntu-pro-2204-jammy-v20220506 xenial: projects/ubuntu-os-pro-cloud/global/images/ubuntu-pro-1604-xenial-v20211213 diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/proxy_config.feature ubuntu-advantage-tools-27.10.1~18.04.1/features/proxy_config.feature --- ubuntu-advantage-tools-27.9~18.04.1/features/proxy_config.feature 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/proxy_config.feature 2022-07-12 18:09:51.000000000 +0000 @@ -259,6 +259,7 @@ Scenario Outline: Attach command when authenticated proxy is configured for uaclient Given a `` machine with ubuntu-advantage-tools installed When I launch a `focal` `proxy` machine + And I run `apt update` `with sudo` on the `proxy` machine And I run `apt install squid apache2-utils -y` `with sudo` on the `proxy` machine And I run `htpasswd -bc /etc/squid/passwordfile someuser somepassword` `with sudo` on the `proxy` machine And I add this text on `/etc/squid/squid.conf` on `proxy` above `http_access deny all`: @@ -355,6 +356,7 @@ Scenario Outline: Attach command when authenticated proxy is configured Given a `` machine with ubuntu-advantage-tools installed When I launch a `focal` `proxy` machine + And I run `apt update` `with sudo` on the `proxy` machine And I run `apt install squid apache2-utils -y` `with sudo` on the `proxy` machine And I run `htpasswd -bc /etc/squid/passwordfile someuser somepassword` `with sudo` on the `proxy` machine And I add this text on `/etc/squid/squid.conf` on `proxy` above `http_access deny all`: @@ -554,6 +556,7 @@ Scenario Outline: Attach command when authenticated proxy is configured manually for uaclient Given a `` machine with ubuntu-advantage-tools installed When I launch a `focal` `proxy` machine + And I run `apt update` `with sudo` on the `proxy` machine And I run `apt install squid apache2-utils -y` `with sudo` on the `proxy` machine And I run `htpasswd -bc /etc/squid/passwordfile someuser somepassword` `with sudo` on the `proxy` machine And I add this text on `/etc/squid/squid.conf` on `proxy` above `http_access deny all`: @@ -797,6 +800,7 @@ Scenario Outline: Attach command when authenticated proxy is configured globally Given a `` machine with ubuntu-advantage-tools installed When I launch a `focal` `proxy` machine + And I run `apt update` `with sudo` on the `proxy` machine And I run `apt install squid apache2-utils -y` `with sudo` on the `proxy` machine And I run `htpasswd -bc /etc/squid/passwordfile someuser somepassword` `with sudo` on the `proxy` machine And I add this text on `/etc/squid/squid.conf` on `proxy` above `http_access deny all`: diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/schemas/ua_security_status.json ubuntu-advantage-tools-27.10.1~18.04.1/features/schemas/ua_security_status.json --- ubuntu-advantage-tools-27.9~18.04.1/features/schemas/ua_security_status.json 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/schemas/ua_security_status.json 2022-07-12 18:09:51.000000000 +0000 @@ -83,6 +83,9 @@ "origin": { "type": "string" }, + "download_size": { + "type": "integer" + }, "status": { "type": "string", "enum": [ diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/steps/steps.py ubuntu-advantage-tools-27.10.1~18.04.1/features/steps/steps.py --- ubuntu-advantage-tools-27.9~18.04.1/features/steps/steps.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/steps/steps.py 2022-07-12 18:09:51.000000000 +0000 @@ -22,12 +22,7 @@ capture_container_as_image, create_instance_with_uat_installed, ) -from features.util import ( - SLOW_CMDS, - SafeLoaderWithoutDatetime, - emit_spinner_on_travis, - nullcontext, -) +from features.util import SafeLoaderWithoutDatetime from uaclient.defaults import DEFAULT_CONFIG_FILE, DEFAULT_MACHINE_TOKEN_PATH from uaclient.util import DatetimeAwareJSONDecoder @@ -72,27 +67,24 @@ if context.config.snapshot_strategy: if series not in context.series_image_name: - with emit_spinner_on_travis(): - build_container_name = add_test_name_suffix( - context, series, IMAGE_BUILD_PREFIX - ) - image_inst = create_instance_with_uat_installed( - context, series, build_container_name - ) + build_container_name = add_test_name_suffix( + context, series, IMAGE_BUILD_PREFIX + ) + image_inst = create_instance_with_uat_installed( + context, series, build_container_name + ) - image_name = add_test_name_suffix( - context, series, IMAGE_PREFIX - ) - image_inst_id = context.config.cloud_manager.get_instance_id( - image_inst - ) - image_id = capture_container_as_image( - image_inst_id, - image_name=image_name, - cloud_api=context.config.cloud_api, - ) - context.series_image_name[series] = image_id - image_inst.delete(wait=False) + image_name = add_test_name_suffix(context, series, IMAGE_PREFIX) + image_inst_id = context.config.cloud_manager.get_instance_id( + image_inst + ) + image_id = capture_container_as_image( + image_inst_id, + image_name=image_name, + cloud_api=context.config.cloud_api, + ) + context.series_image_name[series] = image_id + image_inst.delete(wait=False) inst = context.config.cloud_manager.launch( series=series, @@ -329,17 +321,9 @@ "", context.instances["proxy"].ip ) prefix = get_command_prefix_for_user_spec(user_spec) - slow_cmd_spinner = nullcontext - for slow_cmd in SLOW_CMDS: - if slow_cmd in command: - slow_cmd_spinner = emit_spinner_on_travis - break full_cmd = prefix + shlex.split(command) - with slow_cmd_spinner(): - result = context.instances[instance_name].execute( - full_cmd, stdin=stdin - ) + result = context.instances[instance_name].execute(full_cmd, stdin=stdin) process = subprocess.CompletedProcess( args=full_cmd, @@ -601,27 +585,18 @@ @then("I will see the uaclient version on stdout") -def then_i_will_see_the_uaclient_version_on_stdout(context, feature_str=""): +def then_i_will_see_the_uaclient_version_on_stdout(context): python_import = "from uaclient.version import get_version" cmd = "python3 -c '{}; print(get_version())'".format(python_import) actual_version = context.process.stdout.strip() when_i_run_command(context, cmd, "as non-root") - expected_version = context.process.stdout.strip() + feature_str + expected_version = context.process.stdout.strip() assert_that(expected_version, equal_to(actual_version)) -@then("I will see the uaclient version on stdout with features `{features}`") -def then_i_will_see_the_uaclient_version_with_feature_suffix( - context, features -): - then_i_will_see_the_uaclient_version_on_stdout( - context, feature_str=features - ) - - @then("I verify that the `{cmd_name}` command is not found") def then_i_should_see_that_the_command_is_not_found(context, cmd_name): cmd = "which {} || echo FAILURE".format(cmd_name) @@ -1062,6 +1037,63 @@ ) +@when( + "I prepare the local PPAs to upgrade from `{release}` to `{next_release}`" +) +def when_i_create_local_ppas(context, release, next_release): + if not context.config.build_pr: + return + + # We need Kinetic or greater to support zstd when creating the PPAs + launch_machine(context, "kinetic", "ppa") + when_i_run_command_on_machine( + context, "apt-get update", "with sudo", "ppa" + ) + when_i_run_command_on_machine( + context, "apt-get install -y aptly", "with sudo", "ppa" + ) + create_local_ppa(context, release) + create_local_ppa(context, next_release) + repo_line = "deb [trusted=yes] http://{}:8080 {} main".format( + context.instances["ppa"].ip, release + ) + repo_file = "/etc/apt/sources.list.d/local-ua.list" + when_i_run_shell_command( + context, "printf '{}\n' > {}".format(repo_line, repo_file), "with sudo" + ) + when_i_run_command_on_machine( + context, + "sh -c 'nohup aptly serve > /dev/null 2>&1 &'", + "with sudo", + "ppa", + ) + + +def create_local_ppa(context, release): + when_i_run_command_on_machine( + context, + "aptly repo create -distribution {} repo-{}".format(release, release), + "with sudo", + "ppa", + ) + debs = build_debs_from_sbuild(context, release) + for deb in debs: + deb_destination = "/tmp/" + deb.split("/")[-1] + context.instances["ppa"].push_file(deb, deb_destination) + when_i_run_command_on_machine( + context, + "aptly repo add repo-{} {}".format(release, deb_destination), + "with sudo", + "ppa", + ) + when_i_run_command_on_machine( + context, + "aptly publish repo -skip-signing repo-{}".format(release), + "with sudo", + "ppa", + ) + + def get_command_prefix_for_user_spec(user_spec): prefix = [] if user_spec == "with sudo": diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/ubuntu_pro.feature ubuntu-advantage-tools-27.10.1~18.04.1/features/ubuntu_pro.feature --- ubuntu-advantage-tools-27.9~18.04.1/features/ubuntu_pro.feature 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/ubuntu_pro.feature 2022-07-12 18:09:51.000000000 +0000 @@ -138,7 +138,7 @@ """ Examples: ubuntu release | release | fips-s | cc-eal-s | cis-s | livepatch-s | cis_or_usg | - | xenial | n/a | disabled | disabled | enabled | cis | + | xenial | disabled | disabled | disabled | enabled | cis | | bionic | disabled | disabled | disabled | enabled | cis | | focal | disabled | n/a | disabled | enabled | usg | @@ -210,7 +210,7 @@ Examples: ubuntu release | release | fips-s | cc-eal-s | cis-s | livepatch-s | cis_or_usg | | xenial | n/a | disabled | disabled | n/a | cis | - | bionic | disabled | disabled | disabled | n/a | cis | + | bionic | disabled | disabled | disabled | enabled | cis | | focal | disabled | n/a | disabled | enabled | usg | @series.lts @@ -227,56 +227,40 @@ And I run `ua auto-attach` with sudo And I run `ua status --wait` as non-root Then stdout matches regexp: - """ - SERVICE +ENTITLED STATUS DESCRIPTION - cc-eal +yes + +Common Criteria EAL2 Provisioning Packages - """ + """ + SERVICE +ENTITLED STATUS DESCRIPTION + cc-eal +yes + +Common Criteria EAL2 Provisioning Packages + """ Then stdout matches regexp: - """ - esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\) - esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) - fips +yes + +NIST-certified core packages - fips-updates +yes + +NIST-certified core packages with priority security updates - livepatch +yes +enabled +Canonical Livepatch service - """ + """ + esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\) + esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) + fips +yes + +NIST-certified core packages + fips-updates +yes + +NIST-certified core packages with priority security updates + livepatch +yes +enabled +Canonical Livepatch service + """ Then stdout matches regexp: - """ - +yes + +Security compliance and audit tools - """ + """ + +yes + +Security compliance and audit tools + """ When I run `ua status --all` as non-root Then stdout matches regexp: - """ - SERVICE +ENTITLED STATUS DESCRIPTION - cc-eal +yes + +Common Criteria EAL2 Provisioning Packages - """ - Then stdout matches regexp: - """ - esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\) - esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) - fips +yes + +NIST-certified core packages - fips-updates +yes + +NIST-certified core packages with priority security updates - livepatch +yes +enabled +Canonical Livepatch service - """ - Then stdout matches regexp: - """ - +yes + +Security compliance and audit tools - """ - When I run `ua enable ` with sudo - And I run `ua status` with sudo - Then stdout matches regexp: - """ - +yes +enabled +Security compliance and audit tools - """ - When I run `ua disable ` with sudo + """ + SERVICE +ENTITLED STATUS DESCRIPTION + cc-eal +yes + +Common Criteria EAL2 Provisioning Packages + """ Then stdout matches regexp: - """ - Updating package lists - """ - When I run `ua status` with sudo + """ + esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\) + esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) + fips +yes + +NIST-certified core packages + fips-updates +yes + +NIST-certified core packages with priority security updates + livepatch +yes +enabled +Canonical Livepatch service + """ Then stdout matches regexp: - """ - +yes +disabled +Security compliance and audit tools - """ + """ + +yes + +Security compliance and audit tools + """ When I run `systemctl start ua-auto-attach.service` with sudo And I verify that running `systemctl status ua-auto-attach.service` `as non-root` exits `0,3` Then stdout matches regexp: @@ -336,15 +320,17 @@ And I verify that running `systemctl status ua-reboot-cmds.service` `as non-root` exits `0,3` Then stdout matches regexp: - """ - .*status=0\/SUCCESS.* - """ + """ + .*status=0\/SUCCESS.* + """ Examples: ubuntu release | release | fips-s | cc-eal-s | cis-s | infra-pkg | apps-pkg | cis_or_usg | | xenial | disabled | disabled | disabled | libkrad0 | jq | cis | | bionic | disabled | disabled | disabled | libkrad0 | bundler | cis | | focal | disabled | n/a | disabled | hello | ant | usg | + | jammy | n/a | n/a | n/a | hello | hello | usg | + @series.lts @uses.config.machine_type.azure.pro @@ -361,56 +347,40 @@ And I run `ua status --wait` as non-root And I run `ua status` as non-root Then stdout matches regexp: - """ - SERVICE +ENTITLED STATUS DESCRIPTION - cc-eal +yes + +Common Criteria EAL2 Provisioning Packages - """ + """ + SERVICE +ENTITLED STATUS DESCRIPTION + cc-eal +yes + +Common Criteria EAL2 Provisioning Packages + """ Then stdout matches regexp: - """ - esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\) - esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) - fips +yes + +NIST-certified core packages - fips-updates +yes + +NIST-certified core packages with priority security updates - livepatch +yes + +Canonical Livepatch service - """ + """ + esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\) + esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) + fips +yes + +NIST-certified core packages + fips-updates +yes + +NIST-certified core packages with priority security updates + livepatch +yes + +Canonical Livepatch service + """ Then stdout matches regexp: - """ - +yes + +Security compliance and audit tools - """ + """ + +yes + +Security compliance and audit tools + """ When I run `ua status --all` as non-root Then stdout matches regexp: - """ - SERVICE +ENTITLED STATUS DESCRIPTION - cc-eal +yes + +Common Criteria EAL2 Provisioning Packages - """ - Then stdout matches regexp: - """ - esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\) - esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) - fips +yes + +NIST-certified core packages - fips-updates +yes + +NIST-certified core packages with priority security updates - livepatch +yes + +Canonical Livepatch service - """ - Then stdout matches regexp: - """ - +yes + +Security compliance and audit tools - """ - When I run `ua enable ` with sudo - And I run `ua status` with sudo - Then stdout matches regexp: - """ - +yes +enabled +Security compliance and audit tools - """ - When I run `ua disable ` with sudo + """ + SERVICE +ENTITLED STATUS DESCRIPTION + cc-eal +yes + +Common Criteria EAL2 Provisioning Packages + """ Then stdout matches regexp: - """ - Updating package lists - """ - When I run `ua status` with sudo + """ + esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\) + esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) + fips +yes + +NIST-certified core packages + fips-updates +yes + +NIST-certified core packages with priority security updates + livepatch +yes + +Canonical Livepatch service + """ Then stdout matches regexp: - """ - +yes +disabled +Security compliance and audit tools - """ + """ + +yes + +Security compliance and audit tools + """ When I run `systemctl start ua-auto-attach.service` with sudo And I verify that running `systemctl status ua-auto-attach.service` `as non-root` exits `0,3` Then stdout matches regexp: @@ -470,15 +440,16 @@ And I verify that running `systemctl status ua-reboot-cmds.service` `as non-root` exits `0,3` Then stdout matches regexp: - """ - .*status=0\/SUCCESS.* - """ + """ + .*status=0\/SUCCESS.* + """ Examples: ubuntu release | release | fips-s | cc-eal-s | cis-s | infra-pkg | apps-pkg | livepatch | cis_or_usg | - | xenial | n/a | disabled | disabled | libkrad0 | jq | enabled | cis | + | xenial | disabled | disabled | disabled | libkrad0 | jq | enabled | cis | | bionic | disabled | disabled | disabled | libkrad0 | bundler | enabled | cis | | focal | disabled | n/a | disabled | hello | ant | enabled | usg | + | jammy | n/a | n/a | n/a | hello | hello | enabled | usg | @series.lts @uses.config.machine_type.gcp.pro @@ -495,56 +466,40 @@ And I run `ua status --wait` as non-root And I run `ua status` as non-root Then stdout matches regexp: - """ - SERVICE +ENTITLED STATUS DESCRIPTION - cc-eal +yes + +Common Criteria EAL2 Provisioning Packages - """ + """ + SERVICE +ENTITLED STATUS DESCRIPTION + cc-eal +yes + +Common Criteria EAL2 Provisioning Packages + """ Then stdout matches regexp: - """ - esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\) - esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) - fips +yes + +NIST-certified core packages - fips-updates +yes + +NIST-certified core packages with priority security updates - livepatch +yes + +Canonical Livepatch service - """ + """ + esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\) + esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) + fips +yes + +NIST-certified core packages + fips-updates +yes + +NIST-certified core packages with priority security updates + livepatch +yes + +Canonical Livepatch service + """ Then stdout matches regexp: - """ - +yes + +Security compliance and audit tools - """ + """ + +yes + +Security compliance and audit tools + """ When I run `ua status --all` as non-root Then stdout matches regexp: - """ - SERVICE +ENTITLED STATUS DESCRIPTION - cc-eal +yes + +Common Criteria EAL2 Provisioning Packages - """ - Then stdout matches regexp: - """ - esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\) - esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) - fips +yes + +NIST-certified core packages - fips-updates +yes + +NIST-certified core packages with priority security updates - livepatch +yes + +Canonical Livepatch service - """ - Then stdout matches regexp: - """ - +yes + +Security compliance and audit tools - """ - When I run `ua enable ` with sudo - And I run `ua status` with sudo - Then stdout matches regexp: - """ - +yes +enabled +Security compliance and audit tools - """ - When I run `ua disable ` with sudo + """ + SERVICE +ENTITLED STATUS DESCRIPTION + cc-eal +yes + +Common Criteria EAL2 Provisioning Packages + """ Then stdout matches regexp: - """ - Updating package lists - """ - When I run `ua status` with sudo + """ + esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\) + esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) + fips +yes + +NIST-certified core packages + fips-updates +yes + +NIST-certified core packages with priority security updates + livepatch +yes + +Canonical Livepatch service + """ Then stdout matches regexp: - """ - +yes +disabled +Security compliance and audit tools - """ + """ + +yes + +Security compliance and audit tools + """ When I run `systemctl start ua-auto-attach.service` with sudo And I verify that running `systemctl status ua-auto-attach.service` `as non-root` exits `0,3` Then stdout matches regexp: @@ -604,12 +559,13 @@ And I verify that running `systemctl status ua-reboot-cmds.service` `as non-root` exits `0,3` Then stdout matches regexp: - """ - .*status=0\/SUCCESS.* - """ + """ + .*status=0\/SUCCESS.* + """ Examples: ubuntu release | release | fips-s | cc-eal-s | cis-s | infra-pkg | apps-pkg | livepatch | cis_or_usg | | xenial | n/a | disabled | disabled | libkrad0 | jq | n/a | cis | - | bionic | disabled | disabled | disabled | libkrad0 | bundler | n/a | cis | + | bionic | disabled | disabled | disabled | libkrad0 | bundler | enabled | cis | | focal | disabled | n/a | disabled | hello | ant | enabled | usg | + | jammy | n/a | n/a | n/a | hello | hello | enabled | usg | diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/ubuntu_pro_fips.feature ubuntu-advantage-tools-27.10.1~18.04.1/features/ubuntu_pro_fips.feature --- ubuntu-advantage-tools-27.9~18.04.1/features/ubuntu_pro_fips.feature 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/ubuntu_pro_fips.feature 2022-07-12 18:09:51.000000000 +0000 @@ -17,20 +17,20 @@ And I run `ua status --wait` as non-root And I run `ua status` as non-root Then stdout matches regexp: - """ - esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\) - esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) - fips +yes +enabled +NIST-certified core packages - fips-updates +yes +disabled +NIST-certified core packages with priority security updates - livepatch +yes +n/a +Canonical Livepatch service - """ + """ + esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\) + esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) + fips +yes +enabled +NIST-certified core packages + fips-updates +yes +disabled +NIST-certified core packages with priority security updates + livepatch +yes +n/a +Canonical Livepatch service + """ And I verify that running `apt update` `with sudo` exits `0` And I verify that running `grep Traceback /var/log/ubuntu-advantage.log` `with sudo` exits `1` When I run `uname -r` as non-root Then stdout matches regexp: - """ - - """ + """ + + """ When I run `apt-cache policy ubuntu-azure-fips` as non-root Then stdout does not match regexp: """ @@ -99,26 +99,31 @@ """ When I run `ua enable fips-updates --assume-yes` with sudo Then I will see the following on stdout: - """ - One moment, checking your subscription first - Disabling incompatible service: FIPS - Updating package lists - Installing FIPS Updates packages - FIPS Updates enabled - A reboot is required to complete install. - """ + """ + One moment, checking your subscription first + Disabling incompatible service: FIPS + Updating package lists + Installing FIPS Updates packages + FIPS Updates enabled + A reboot is required to complete install. + """ When I run `ua status` with sudo Then stdout matches regexp: - """ - fips +yes +n/a +NIST-certified core packages - fips-updates +yes +enabled +NIST-certified core packages with priority security updates - """ + """ + fips +yes +n/a +NIST-certified core packages + fips-updates +yes +enabled +NIST-certified core packages with priority security updates + """ + And stdout matches regexp: + """ + NOTICES + FIPS support requires system reboot to complete configuration. + """ When I reboot the `` machine And I run `uname -r` as non-root Then stdout matches regexp: - """ - - """ + """ + + """ When I run `apt-cache policy ubuntu-azure-fips` as non-root Then stdout does not match regexp: """ @@ -129,6 +134,12 @@ """ 1 """ + When I run `ua status` with sudo + Then stdout does not match regexp: + """ + NOTICES + FIPS support requires system reboot to complete configuration. + """ Examples: ubuntu release | release | infra-pkg | apps-pkg | fips-apt-source | fips-kernel-version | @@ -146,8 +157,6 @@ data_dir: /var/lib/ubuntu-advantage log_level: debug log_file: /var/log/ubuntu-advantage.log - features: - allow_xenial_fips_on_cloud: true """ And I run `ua auto-attach` with sudo And I run `ua status --wait` as non-root @@ -225,20 +234,20 @@ And I run `ua status --wait` as non-root And I run `ua status` as non-root Then stdout matches regexp: - """ - esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\) - esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) - fips +yes +enabled +NIST-certified core packages - fips-updates +yes +disabled +NIST-certified core packages with priority security updates - livepatch +yes +n/a +Canonical Livepatch service - """ + """ + esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\) + esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\) + fips +yes +enabled +NIST-certified core packages + fips-updates +yes +disabled +NIST-certified core packages with priority security updates + livepatch +yes +n/a +Canonical Livepatch service + """ And I verify that running `apt update` `with sudo` exits `0` And I verify that running `grep Traceback /var/log/ubuntu-advantage.log` `with sudo` exits `1` When I run `uname -r` as non-root Then stdout matches regexp: - """ - - """ + """ + + """ When I run `apt-cache policy ubuntu-aws-fips` as non-root Then stdout does not match regexp: """ @@ -307,26 +316,31 @@ """ When I run `ua enable fips-updates --assume-yes` with sudo Then I will see the following on stdout: - """ - One moment, checking your subscription first - Disabling incompatible service: FIPS - Updating package lists - Installing FIPS Updates packages - FIPS Updates enabled - A reboot is required to complete install. - """ + """ + One moment, checking your subscription first + Disabling incompatible service: FIPS + Updating package lists + Installing FIPS Updates packages + FIPS Updates enabled + A reboot is required to complete install. + """ When I run `ua status` with sudo Then stdout matches regexp: - """ - fips +yes +n/a +NIST-certified core packages - fips-updates +yes +enabled +NIST-certified core packages with priority security updates - """ + """ + fips +yes +n/a +NIST-certified core packages + fips-updates +yes +enabled +NIST-certified core packages with priority security updates + """ + And stdout matches regexp: + """ + NOTICES + FIPS support requires system reboot to complete configuration. + """ When I reboot the `` machine And I run `uname -r` as non-root Then stdout matches regexp: - """ - - """ + """ + + """ When I run `apt-cache policy ubuntu-aws-fips` as non-root Then stdout does not match regexp: """ @@ -337,6 +351,12 @@ """ 1 """ + When I run `ua status` with sudo + Then stdout does not match regexp: + """ + NOTICES + FIPS support requires system reboot to complete configuration. + """ Examples: ubuntu release | release | infra-pkg | apps-pkg | fips-apt-source | fips-kernel-version | @@ -354,8 +374,6 @@ data_dir: /var/lib/ubuntu-advantage log_level: debug log_file: /var/log/ubuntu-advantage.log - features: - allow_xenial_fips_on_cloud: true """ And I run `ua auto-attach` with sudo And I run `ua status --wait` as non-root @@ -498,9 +516,9 @@ And I verify that running `grep Traceback /var/log/ubuntu-advantage.log` `with sudo` exits `1` When I run `uname -r` as non-root Then stdout matches regexp: - """ - - """ + """ + + """ When I run `apt-cache policy ubuntu-gcp-fips` as non-root Then stdout does not match regexp: """ @@ -569,26 +587,31 @@ """ When I run `ua enable fips-updates --assume-yes` with sudo Then I will see the following on stdout: - """ - One moment, checking your subscription first - Disabling incompatible service: FIPS - Updating package lists - Installing FIPS Updates packages - FIPS Updates enabled - A reboot is required to complete install. - """ + """ + One moment, checking your subscription first + Disabling incompatible service: FIPS + Updating package lists + Installing FIPS Updates packages + FIPS Updates enabled + A reboot is required to complete install. + """ When I run `ua status` with sudo Then stdout matches regexp: - """ - fips +yes +n/a +NIST-certified core packages - fips-updates +yes +enabled +NIST-certified core packages with priority security updates - """ + """ + fips +yes +n/a +NIST-certified core packages + fips-updates +yes +enabled +NIST-certified core packages with priority security updates + """ + And stdout matches regexp: + """ + NOTICES + FIPS support requires system reboot to complete configuration. + """ When I reboot the `` machine And I run `uname -r` as non-root Then stdout matches regexp: - """ - - """ + """ + + """ When I run `apt-cache policy ubuntu-gcp-fips` as non-root Then stdout does not match regexp: """ @@ -599,6 +622,12 @@ """ 1 """ + When I run `ua status` with sudo + Then stdout does not match regexp: + """ + NOTICES + FIPS support requires system reboot to complete configuration. + """ Examples: ubuntu release | release | infra-pkg | apps-pkg | fips-apt-source | fips-kernel-version | @@ -615,8 +644,6 @@ data_dir: /var/lib/ubuntu-advantage log_level: debug log_file: /var/log/ubuntu-advantage.log - features: - allow_xenial_fips_on_cloud: true """ And I run `ua auto-attach` with sudo And I run `ua status --wait` as non-root @@ -650,8 +677,6 @@ data_dir: /var/lib/ubuntu-advantage log_level: debug log_file: /var/log/ubuntu-advantage.log - features: - allow_xenial_fips_on_cloud: true """ And I run `ua auto-attach` with sudo And I run `ua status --wait` as non-root diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/ubuntu_upgrade.feature ubuntu-advantage-tools-27.10.1~18.04.1/features/ubuntu_upgrade.feature --- ubuntu-advantage-tools-27.9~18.04.1/features/ubuntu_upgrade.feature 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/ubuntu_upgrade.feature 2022-07-12 18:09:51.000000000 +0000 @@ -9,10 +9,8 @@ Given a `` machine with ubuntu-advantage-tools installed When I attach `contract_token` with sudo And I run `` with sudo - # update-manager-core requires ua < 28. Our tests that build the package will - # generate ua with version 28. We are removing that package here to make sure - # do-release-upgrade will be able to run - And I run `apt remove update-manager-core -y` with sudo + # Local PPAs are prepared and served only when testing with BUILD_PR=1 + And I prepare the local PPAs to upgrade from `` to `` And I run `apt-get dist-upgrade --assume-yes` with sudo # Some packages upgrade may require a reboot And I reboot the `` machine @@ -34,7 +32,7 @@ """ """ When I run `ua refresh` with sudo - When I run `ua status` with sudo + And I run `ua status` with sudo Then stdout matches regexp: """ +yes + @@ -89,7 +87,9 @@ """ 1 """ - When I run `apt-get dist-upgrade -y --allow-downgrades` with sudo + # Local PPAs are prepared and served only when testing with BUILD_PR=1 + When I prepare the local PPAs to upgrade from `` to `` + And I run `apt-get dist-upgrade -y --allow-downgrades` with sudo # A package may need a reboot after running dist-upgrade And I reboot the `` machine And I create the file `/etc/update-manager/release-upgrades.d/ua-test.cfg` with the following diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/ubuntu_upgrade_unattached.feature ubuntu-advantage-tools-27.10.1~18.04.1/features/ubuntu_upgrade_unattached.feature --- ubuntu-advantage-tools-27.9~18.04.1/features/ubuntu_upgrade_unattached.feature 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/ubuntu_upgrade_unattached.feature 2022-07-12 18:09:51.000000000 +0000 @@ -7,10 +7,8 @@ @upgrade Scenario Outline: Unattached upgrade Given a `` machine with ubuntu-advantage-tools installed - # update-manager-core requires ua < 28. Our tests that build the package will - # generate ua with version 28. We are removing that package here to make sure - # do-release-upgrade will be able to run - When I run `apt remove update-manager-core -y` with sudo + # Local PPAs are prepared and served only when testing with BUILD_PR=1 + When I prepare the local PPAs to upgrade from `` to `` And I run `apt-get dist-upgrade --assume-yes` with sudo # Some packages upgrade may require a reboot And I reboot the `` machine diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/unattached_commands.feature ubuntu-advantage-tools-27.10.1~18.04.1/features/unattached_commands.feature --- ubuntu-advantage-tools-27.9~18.04.1/features/unattached_commands.feature 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/unattached_commands.feature 2022-07-12 18:09:51.000000000 +0000 @@ -178,47 +178,6 @@ @series.all @uses.config.machine_type.lxd.container - Scenario Outline: Run collect-logs on an unattached machine - Given a `` machine with ubuntu-advantage-tools installed - When I run `python3 /usr/lib/ubuntu-advantage/timer.py` with sudo - And I verify that running `ua collect-logs` `as non-root` exits `1` - Then I will see the following on stderr: - """ - This command must be run as root (try using sudo). - """ - When I run `ua collect-logs` with sudo - Then I verify that files exist matching `ua_logs.tar.gz` - When I run `tar zxf ua_logs.tar.gz` as non-root - Then I verify that files exist matching `logs/` - When I run `sh -c "ls -1 logs/ | sort -d"` as non-root - Then stdout matches regexp: - """ - build.info - cloud-id.txt - jobs-status.json - journalctl.txt - livepatch-status.txt-error - systemd-timers.txt - ua-auto-attach.path.txt-error - ua-auto-attach.service.txt-error - uaclient.conf - ua-reboot-cmds.service.txt - ua-status.json - ua-timer.service.txt - ua-timer.timer.txt - ubuntu-advantage.log - ubuntu-advantage.service.txt - ubuntu-advantage-timer.log - """ - Examples: ubuntu release - | release | - | bionic | - | focal | - | impish | - | jammy | - - @series.all - @uses.config.machine_type.lxd.container Scenario Outline: Unattached enable/disable fails in a ubuntu machine Given a `` machine with ubuntu-advantage-tools installed When I verify that running `ua esm-infra` `as non-root` exits `1` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/unattached_status.feature ubuntu-advantage-tools-27.10.1~18.04.1/features/unattached_status.feature --- ubuntu-advantage-tools-27.9~18.04.1/features/unattached_status.feature 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/unattached_status.feature 2022-07-12 18:09:51.000000000 +0000 @@ -133,6 +133,9 @@ ros-updates + +All Updates for the Robot Operating System ?( + +Security compliance and audit tools)? + FEATURES + allow_beta: True + This machine is not attached to a UA subscription. See https://ubuntu.com/advantage """ @@ -143,8 +146,7 @@ | bionic | yes | yes | cis | yes | yes | yes | yes | yes | | no | | focal | yes | no | | yes | yes | yes | no | yes | usg | no | | impish | no | no | cis | no | no | no | no | no | | no | - # jammy livepatch is only no when running the container test on a pre-jammy ubuntu - | jammy | yes | no | cis | no | no | yes | no | no | | yes | + | jammy | yes | no | | no | no | yes | no | no | usg | yes | @series.all @uses.config.machine_type.lxd.container @@ -209,8 +211,7 @@ | bionic | yes | yes | cis | yes | yes | yes | yes | yes | | no | | focal | yes | no | | yes | yes | yes | no | yes | usg | no | | impish | no | no | cis | no | no | no | no | no | | no | - # jammy livepatch is only no when running the container test on a pre-jammy ubuntu - | jammy | yes | no | cis | no | no | yes | no | no | | yes | + | jammy | yes | no | | no | no | yes | no | no | usg | yes | @series.all @@ -258,4 +259,4 @@ | bionic | yes | yes | cis | yes | yes | yes | yes | yes | | | focal | yes | no | | yes | yes | yes | no | yes | usg | | impish | no | no | cis | no | no | no | no | no | | - | jammy | no | no | cis | no | no | yes | no | no | | + | jammy | no | no | | no | no | yes | no | no | usg | diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/util.py ubuntu-advantage-tools-27.10.1~18.04.1/features/util.py --- ubuntu-advantage-tools-27.9~18.04.1/features/util.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/util.py 2022-07-12 18:09:51.000000000 +0000 @@ -1,13 +1,10 @@ import hashlib import logging -import multiprocessing import os import shutil import subprocess import tempfile import textwrap -import time -from contextlib import contextmanager from typing import Iterable, List, Optional import yaml @@ -16,7 +13,6 @@ "image": {"series": "properties.release", "machine_type": "Type"}, "container": {"series": "image.release", "machine_type": "image.type"}, } -SLOW_CMDS = ["do-release-upgrade"] # Commands which will emit dots on travis UA_TMP_DIR = os.path.join(tempfile.gettempdir(), "uaclient-behave") SOURCE_PR_TGZ = os.path.join(UA_TMP_DIR, "pr_source.tar.gz") SOURCE_PR_UNTAR_DIR = os.path.join(UA_TMP_DIR, "behave-ua-src") @@ -95,6 +91,8 @@ "features", "sru", "tools", + "docs", + "dev-docs", ) ): """ @@ -281,52 +279,6 @@ return [tools_deb_cache_path, pro_deb_cache_path] -# Support for python 3.6 or earlier -@contextmanager -def nullcontext(enter_result=None): - yield enter_result - - -def spinning_cursor(): - while True: - for cursor in "|/-\\": - yield cursor - - -@contextmanager -def emit_spinner_on_travis(msg: str = " "): - """ - A context manager that emits a spinner updating 5 seconds if running on - Travis. - - Travis will kill jobs that don't emit output for a certain amount of time. - This context manager spins up a background process which will emit a char - to stdout every 10 seconds to avoid being killed. - - It should be wrapped selectively around operations that are known to take a - long time - """ - if os.environ.get("TRAVIS") != "true": - # If we aren't on Travis, don't do anything. - yield - return - - def emit_spinner(): - print(msg, end="", flush=True) - spinner = spinning_cursor() - while True: - time.sleep(5) - print("\b%s" % next(spinner), end="", flush=True) - - dot_process = multiprocessing.Process(target=emit_spinner) - dot_process.start() - try: - yield - finally: - print() - dot_process.terminate() - - class SafeLoaderWithoutDatetime(yaml.SafeLoader): yaml_implicit_resolvers = { k: [r for r in v if r[0] != "tag:yaml.org,2002:timestamp"] diff -Nru ubuntu-advantage-tools-27.9~18.04.1/features/_version.feature ubuntu-advantage-tools-27.10.1~18.04.1/features/_version.feature --- ubuntu-advantage-tools-27.9~18.04.1/features/_version.feature 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/features/_version.feature 2022-07-12 18:09:51.000000000 +0000 @@ -21,12 +21,9 @@ {UACLIENT_BEHAVE_CHECK_VERSION} """ When I run `ua version` with sudo - Then stdout matches regexp: - # We are adding that regex here to match possible config overrides - # we add. For example, on PRO machines we add a config override to - # disable auto-attach on boot + Then I will see the following on stdout """ - {UACLIENT_BEHAVE_CHECK_VERSION}.* + {UACLIENT_BEHAVE_CHECK_VERSION} """ Examples: version | release | @@ -48,12 +45,9 @@ {UACLIENT_BEHAVE_CHECK_VERSION} """ When I run `ua version` with sudo - Then stdout matches regexp: - # We are adding that regex here to match possible config overrides - # we add. For example, on PRO machines we add a config override to - # disable auto-attach on boot + Then I will see the following on stdout """ - {UACLIENT_BEHAVE_CHECK_VERSION}.* + {UACLIENT_BEHAVE_CHECK_VERSION} """ Examples: version | release | diff -Nru ubuntu-advantage-tools-27.9~18.04.1/.github/workflows/ci-base.yaml ubuntu-advantage-tools-27.10.1~18.04.1/.github/workflows/ci-base.yaml --- ubuntu-advantage-tools-27.9~18.04.1/.github/workflows/ci-base.yaml 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/.github/workflows/ci-base.yaml 2022-07-12 18:09:51.000000000 +0000 @@ -13,7 +13,7 @@ jobs: lint-and-style: name: Static Analysis - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Install dependencies run: | @@ -21,23 +21,35 @@ sudo DEBIAN_FRONTEND=noninteractive apt-get -qy install tox - name: Git checkout uses: actions/checkout@v2 - - name: Linting and style - run: tox -e flake8 -e black -e isort - - name: mypy + - name: Formatting + run: tox -e black -e isort + - name: Mypy run: tox -e mypy + - name: Version Consistency + run: python3 ./tools/check-versions-are-consistent.py unit-tests: - name: Unit - runs-on: ubuntu-18.04 + name: Matrix + strategy: + matrix: + testenv: + - {os: ubuntu-18.04, pyver: py35, deadsnake: python3.5} + - {os: ubuntu-18.04, pyver: py36} + - {os: ubuntu-20.04, pyver: py38} + - {os: ubuntu-22.04, pyver: py310} + runs-on: ${{ matrix.testenv.os }} steps: - name: Install dependencies run: | sudo DEBIAN_FRONTEND=noninteractive apt-get -qy update - sudo DEBIAN_FRONTEND=noninteractive apt-get -qy install python3-venv + sudo DEBIAN_FRONTEND=noninteractive apt-get -qy install tox + - name: Install older Python from deadsnakes PPA + if: matrix.testenv.deadsnake != '' + run: | + sudo add-apt-repository --yes ppa:deadsnakes/ppa + sudo DEBIAN_FRONTEND=noninteractive apt-get -qy install "${{ matrix.testenv.deadsnake }}" - name: Git checkout uses: actions/checkout@v2 - - name: Linting and style - run: | - python3 -m venv unit-test-venv - . unit-test-venv/bin/activate - pip install tox tox-pip-version - tox -e py3 -e py3-bionic -e py3-xenial + - name: Flake8 + run: tox -e "${{ matrix.testenv.pyver }}-flake8" + - name: Unit + run: tox -e "${{ matrix.testenv.pyver }}-test" diff -Nru ubuntu-advantage-tools-27.9~18.04.1/.github/workflows/ci-integration.yaml ubuntu-advantage-tools-27.10.1~18.04.1/.github/workflows/ci-integration.yaml --- ubuntu-advantage-tools-27.9~18.04.1/.github/workflows/ci-integration.yaml 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/.github/workflows/ci-integration.yaml 2022-07-12 18:09:51.000000000 +0000 @@ -105,14 +105,14 @@ UACLIENT_BEHAVE_CONTRACT_TOKEN_STAGING_EXPIRED: '${{ secrets.UACLIENT_BEHAVE_CONTRACT_TOKEN_STAGING_EXPIRED }}' run: | PYCLOUDLIB_CONFIG="$(mktemp --tmpdir="${{ runner.temp }}" pycloudlib.toml.XXXXXXXXXX)" - GOOGLE_APPLICATION_CREDENTIALS="$(mktemp --tmpdir="${{ runner.temp }}" gcloud.json.XXXXXXXXXX)" + GCE_CREDENTIALS_PATH="$(mktemp --tmpdir="${{ runner.temp }}" gcloud.json.XXXXXXXXXX)" export PYCLOUDLIB_CONFIG - export GOOGLE_APPLICATION_CREDENTIALS + export GCE_CREDENTIALS_PATH # Dump secrets using a subshell to avoid leaks due to xtrace. # Use printf as dash's echo always interpretes control sequences (e.g. \n). sh -c 'printf "%s\n" "$PYCLOUDLIB_CONFIG_CONTENTS" > "$PYCLOUDLIB_CONFIG"' - sh -c 'printf "%s\n" "$GOOGLE_APPLICATION_CREDENTIALS_CONTENTS" > "$GOOGLE_APPLICATION_CREDENTIALS"' + sh -c 'printf "%s\n" "$GOOGLE_APPLICATION_CREDENTIALS_CONTENTS" > "$GCE_CREDENTIALS_PATH"' # SSH keys (should match what specified in pycloudlib.toml) mkdir ~/.ssh diff -Nru ubuntu-advantage-tools-27.9~18.04.1/lib/timer.py ubuntu-advantage-tools-27.10.1~18.04.1/lib/timer.py --- ubuntu-advantage-tools-27.9~18.04.1/lib/timer.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/lib/timer.py 2022-07-12 18:09:51.000000000 +0000 @@ -42,6 +42,7 @@ return False try: + LOG.debug("Running job: %s", self.name) if self._job_func(cfg=cfg): LOG.debug("Executed job: %s", self.name) except Exception as e: diff -Nru ubuntu-advantage-tools-27.9~18.04.1/Makefile ubuntu-advantage-tools-27.10.1~18.04.1/Makefile --- ubuntu-advantage-tools-27.9~18.04.1/Makefile 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/Makefile 2022-07-12 18:09:51.000000000 +0000 @@ -12,10 +12,6 @@ find . -type d -name '*__pycache__' -delete $(MAKE) -C apt-hook clean -demo: - @echo Creating contract-bionic-demo container with ua-contracts server - @./demo/demo-contract-service - deps: @which mk-build-deps > /dev/null || { \ echo "Missing mk-build-deps; installing devscripts, equivs."; \ @@ -27,31 +23,4 @@ test: @tox -testdeps: - pip install tox - pip install tox-pip-version - pip install tox-setuptools-version - -travis-deb-install: - git fetch --unshallow - sudo apt-get update - sudo apt-get build-dep -y ubuntu-advantage-tools - sudo apt-get install -y --install-recommends sbuild ubuntu-dev-tools dh-systemd - # Missing build-deps - sudo apt-get install -y --install-recommends libapt-pkg-dev python3-mock python3-pytest - -# Use the mirror for a GCE region, to speed things up. (Travis build VMs use -# DataSourceNone so we can't dynamically determine the correct region.) -travis-deb-script: export DEBOOTSTRAP_MIRROR=http://us-central1.gce.archive.ubuntu.com/ubuntu/ -travis-deb-script: - debuild -S -uc -us - sudo sbuild-adduser ${USER} - cp /usr/share/doc/sbuild/examples/example.sbuildrc /home/${USER}/.sbuildrc - # Use this to get a new shell where we're in the sbuild group - sudo -E su ${USER} -c 'mk-sbuild ${PACKAGE_BUILD_SERIES}' - sudo -E su ${USER} -c 'sbuild --nolog --verbose --dist=${PACKAGE_BUILD_SERIES} ../ubuntu-advantage-tools*.dsc' - cp ./ubuntu-advantage-tools*.deb ubuntu-advantage-tools-${PACKAGE_BUILD_SERIES}.deb - cp ./ubuntu-advantage-pro*.deb ubuntu-advantage-tools-pro-${PACKAGE_BUILD_SERIES}.deb - - -.PHONY: build clean test testdeps demo +.PHONY: build clean test diff -Nru ubuntu-advantage-tools-27.9~18.04.1/.pre-commit-config.yaml ubuntu-advantage-tools-27.10.1~18.04.1/.pre-commit-config.yaml --- ubuntu-advantage-tools-27.9~18.04.1/.pre-commit-config.yaml 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/.pre-commit-config.yaml 2022-07-12 18:09:51.000000000 +0000 @@ -7,3 +7,8 @@ rev: 5.8.0 # Also stored in dev-requirements.txt; update both together! hooks: - id: isort + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.8.0.4 # Also stored in dev-requirements.txt; update both together! + hooks: + - id: shellcheck + args: ['--severity=warning'] diff -Nru ubuntu-advantage-tools-27.9~18.04.1/README.md ubuntu-advantage-tools-27.10.1~18.04.1/README.md --- ubuntu-advantage-tools-27.9~18.04.1/README.md 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/README.md 2022-07-12 18:09:51.000000000 +0000 @@ -7,66 +7,77 @@ ###### Clean and Consistent CLI for your Ubuntu Advantage Systems - -![Latest Version](https://img.shields.io/github/v/tag/canonical/ubuntu-advantage-client.svg?label=Latest%20Version) +![Latest Upstream Version](https://img.shields.io/github/v/tag/canonical/ubuntu-advantage-client.svg?label=Latest%20Upstream%20Version&logo=github&logoColor=white&color=33ce57) ![CI](https://github.com/canonical/ubuntu-advantage-client/actions/workflows/ci-base.yaml/badge.svg?branch=main) +
+![Released Xenial Version](https://img.shields.io/ubuntu/v/ubuntu-advantage-tools/xenial?label=Xenial&logo=ubuntu&logoColor=white) +![Released Bionic Version](https://img.shields.io/ubuntu/v/ubuntu-advantage-tools/bionic?label=Bionic&logo=ubuntu&logoColor=white) +![Released Focal Version](https://img.shields.io/ubuntu/v/ubuntu-advantage-tools/focal?label=Focal&logo=ubuntu&logoColor=white) +![Released Jammy Version](https://img.shields.io/ubuntu/v/ubuntu-advantage-tools/jammy?label=Jammy&logo=ubuntu&logoColor=white) + +The Ubuntu Advantage (UA) Client is the offical tool to enable Canonical offerings on your +system. -The Ubuntu Advantage (UA) Client provides users with a simple mechanism to -view, enable, and disable offerings from Canonical on their system. The -following entitlements are supported: +UA provides support to view, enable, and disable the following Canonical services: - [Common Criteria EAL2 Certification Tooling](https://ubuntu.com/security/cc) - [CIS Benchmark Audit Tooling](https://ubuntu.com/security/cis) - [Ubuntu Security Guide (USG) Tooling](https://ubuntu.com/security/certifications/docs/usg) - [Ubuntu Extended Security Maintenance (ESM)](https://ubuntu.com/security/esm) - [Robot Operating System (ROS) Extended Security Maintenance](https://ubuntu.com/robotics/ros-esm) -- [FIPS 140-2 Certified Modules](https://ubuntu.com/security/fips) -- [FIPS 140-2 Non-Certified Module Updates](https://ubuntu.com/security/fips) +- [FIPS 140-2 Certified Modules (and optional non-certified patches)](https://ubuntu.com/security/fips) - [Livepatch Service](https://ubuntu.com/security/livepatch) -## Obtaining the Client - -The client comes pre-installed on all Ubuntu systems in the debian -`ubuntu-advantage-tools` package. "Ubuntu Pro" images on AWS, Azure and GCP -will also contain `ubuntu-advantage-pro` which automates machine attach -on boot for custom AWS, Azure and GCP images. - -Ubuntu Pro images are available on the following cloud platforms on all Ubuntu LTS releases (Xenial, Bionic, Focal): -1. AWS: [Ubuntu PRO](https://ubuntu.com/aws/pro) and [Ubuntu PRO FIPS](https://ubuntu.com/aws/fips) -2. Azure: [Ubuntu PRO](https://ubuntu.com/azure/pro) and [Ubuntu PRO FIPS](https://ubuntu.com/azure/fips) -3. GCP: [Ubuntu PRO](https://ubuntu.com/gcp/pro) - -Additionally, there are 3 PPAs with different release channels of the Ubuntu Advantage Client: - -1. Stable: This contains stable builds only which have been verified for release into Ubuntu stable releases or Ubuntu PRO images. - - add with `sudo add-apt-repository ppa:ua-client/stable` -2. Staging: This contains builds under validation for release to stable Ubuntu releases and images - - add with `sudo add-apt-repository ppa:ua-client/staging` -3. Daily: This PPA is updated every day with the latest changes. - - add with `sudo add-apt-repository ppa:ua-client/daily` -Users can manually run the `ua` command to learn more or view the manpage. +If you need any of those services for your machine, UA is the right tool for you. +Furthermore, UA is already installed on every Ubuntu system. Try it out by running `ua help`! -## User Documentation +## Documentation ### Tutorials +* [Getting started with UA](./docs/tutorials/basic_ua_commands.md) * [Create a FIPS compliant Ubuntu Docker image](./docs/tutorials/create_a_fips_docker_image.md) +* [Fixing vulnerabilities by CVE or USN using `ua fix`](./docs/tutorials/ua_fix_scenarios.md) ### How To Guides +* [How to get an UA token and attach to a subscription](./docs/howtoguides/get_token_and_attach.md) * [How to Configure Proxies](./docs/howtoguides/configure_proxies.md) * [How to Enable Ubuntu Advantage Services in a Dockerfile](./docs/howtoguides/enable_ua_in_dockerfile.md) * [How to Create a custom Golden Image based on Ubuntu Pro](./docs/howtoguides/create_pro_golden_image.md) * [How to Manually update MOTD and APT messages](./docs/howtoguides/update_motd_messages.md) +* [How to enable CIS](./docs/howtoguides/enable_cis.md) +* [How to enable CC EAL](./docs/howtoguides/enable_cc.md) +* [How to enable ESM Infra](./docs/howtoguides/enable_esm_infra.md) +* [How to enable FIPS](./docs/howtoguides/enable_fips.md) +* [How to enable Livepatch](./docs/howtoguides/enable_livepatch.md) +* [How to configure a timer job](./docs/howtoguides/configuring_timer_jobs.md) +* [How to attach with a configuration file](./docs/howtoguides/how_to_attach_with_config_file.md) +* [How to collect UA logs](./docs/howtoguides/how_to_collect_ua_logs.md) +* [How to Simulate attach operation](./docs/howtoguides/how_to_simulate_attach.md) +* [How to run ua fix in dry-run mode](./docs/howtoguides/how_to_run_ua_fix_in_dry_run_mode.md) ### Reference * [Ubuntu Release and Architecture Support Matrix](./docs/references/support_matrix.md) +* [UA Network Requirements](./docs/references/network_requirements.md) +* [PPAs with different versions of `ua`](./docs/references/ppas.md) ### Explanation * [What is the daemon for? (And how to disable it)](./docs/explanations/what_is_the_daemon.md) +* [What is Ubuntu PRO?](./docs/explanations/what_is_ubuntu_pro.md) +* [What is the ubuntu-advantage-pro package?](./docs/explanations/what_is_the_ubuntu_advantage_pro_package.md) +* [What are the timer jobs?](./docs/explanations/what_are_the_timer_jobs.md) +* [What are the UA related MOTD messages?](./docs/explanations/motd_messages.md) +* [What are the UA related APT messages?](./docs/explanations/apt_messages.md) +* [How to interpret the security-status command](./docs/explanations/how_to_interpret_the_security_status_command.md) +* [Why Trusty (14.04) is no longer supported](./docs/explanations/why_trusty_is_no_longer_supported.md) + +## Project and community + +UA is a member of the Ubuntu family. It’s an open source project that warmly welcomes +community projects, contributions, suggestions, fixes and constructive feedback. -## Contributing -See [CONTRIBUTING.md](CONTRIBUTING.md) +* [Contribute](CONTRIBUTING.md) diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/1832757/esm-trusty-test-1.md ubuntu-advantage-tools-27.10.1~18.04.1/sru/1832757/esm-trusty-test-1.md --- ubuntu-advantage-tools-27.9~18.04.1/sru/1832757/esm-trusty-test-1.md 2020-10-15 14:52:16.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/1832757/esm-trusty-test-1.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -# Test case 1: Attach a trusty machine and verify ESM is attached and ESM packages can be installed. -``` -#!/bin/bash -echo "--- Test 1: Attach a trusty machine using a token from auth.contracts.canonical.com and verify ESM is attached and ESM packages can be installed." - -echo "Launch Trusty container with allowing ssh access for " - -export CONTRACT_TOKEN="" -export ARCHIVE_URL="http://archive.ubuntu.com/ubuntu" - -cat >trusty-ssh.yaml < add_uat_apt_pocket.sh << EOF -#/bin/bash -pocket_name=\$1 -echo deb $ARCHIVE_URL \$pocket_name main | tee /etc/apt/sources.list.d/\$pocket_name.list -EOF - -echo "Upgrade ubuntu-advantage-tools to trusty-proposed" -lxc file push add_uat_apt_pocket.sh sru-trusty/; -lxc exec sru-trusty chmod 755 /add_uat_apt_pocket.sh; -lxc exec sru-trusty /add_uat_apt_pocket.sh trusty-proposed; -lxc exec sru-trusty -- apt-get update -q; -lxc exec sru-trusty -- apt-get install -qy ubuntu-advantage-tools; - -echo "Confirm ubuntu-advantage-tools version from -proposed" -lxc exec sru-trusty -- apt-cache policy ubuntu-advantage-tools; - - -echo "Enable esm on trusty as non-root sudo" -VM_IP=`lxc list sru-trusty -c 4 | awk '/10/{print $2}'` - -# Expect ua status to show esm enabled, livepatch n/a -ssh ubuntu@$VM_IP -- sudo ua attach $CONTRACT_TOKEN - -echo "Confirm ansible is available for trusty esm PPA" -ssh ubuntu@$VM_IP -- apt-cache policy ansible - -ANSIBLE_ESM_VER=`lxc exec sru-trusty -- apt-cache policy ansible | grep esm | grep Candidate | awk '{print $2}'` - -echo "Installing ansible from esm" -ssh ubuntu@$VM_IP -- sudo apt-get install ansible=$ANSIBLE_ESM_VER -y -``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/1832757/esm-trusty-test-2.md ubuntu-advantage-tools-27.10.1~18.04.1/sru/1832757/esm-trusty-test-2.md --- ubuntu-advantage-tools-27.9~18.04.1/sru/1832757/esm-trusty-test-2.md 2020-10-15 14:52:16.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/1832757/esm-trusty-test-2.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,93 +0,0 @@ -# Test case 2 - -2. - a. Start with a fresh Ubuntu instance which does not have u-a-t installed (i.e. ubuntu-minimal is not installed). Install u-a-t from -updates. - Do not enable ua. Upgrade to u-a-t from -proposed. - b. In an identical instance, install u-a-t from -proposed. - c. Confirm that the on-disk results of a) and b) are identical. - -``` -originally from https://gist.githubusercontent.com/panlinux/4caaf069356da7436d97b47afce32234/raw/d07504309557e9176ae887b8606b4de80c422e02/esm-trusty-test-2.txt - - -sudo su - -# adjust if needed, i.e., point to a mirror -export ARCHIVE_URL=http://br.archive.ubuntu.com/ubuntu -export PROPOSED_REPO="deb $ARCHIVE_URL trusty-proposed main" - -mkdir /esm-sru -cd /esm-sru -truncate -s 10G file.img -zpool create -O sync=disabled tank $(pwd)/file.img -zfs create tank/trusty-minimal -debootstrap --exclude=ubuntu-minimal trusty /tank/trusty-minimal $ARCHIVE_URL -zfs snapshot tank/trusty-minimal@fresh -# confirm no ubuntu-minimal nor ubuntu-advantage-tools -chroot /tank/trusty-minimal dpkg -l | grep -E "(ubuntu-minimal|ubuntu-advantage)" - -# create a clone from trusty-minimal called trusty-2a -zfs clone tank/trusty-minimal@fresh tank/trusty-2a - -# add extra pockets -cat >> /tank/trusty-2a/etc/apt/sources.list < /tank/trusty-2a/etc/apt/sources.list.d/proposed.list <> /tank/trusty-2b/etc/apt/sources.list < /tank/trusty-2b/etc/apt/sources.list.d/proposed.list < trusty-2a.list -find /tank/trusty-2b/ | sed -r 's,^/tank/[^/]+,,' | sort > trusty-2b.list - -# compare and verify the result. The difference should be just that the 2a list has the intermediary u-a-t package from trusty-updates in the apt cache -diff -u trusty-2a.list trusty-2b.list ---- trusty-2a.list 2019-10-24 15:55:01.120848221 -0300 -+++ trusty-2b.list 2019-10-24 15:55:01.256846583 -0300 -@@ -13723,7 +13723,6 @@ - /var/cache/apt/archives/sysv-rc_2.88dsf-41ubuntu6_all.deb - /var/cache/apt/archives/tar_1.27.1-1_amd64.deb - /var/cache/apt/archives/tzdata_2014b-1_all.deb --/var/cache/apt/archives/ubuntu-advantage-tools_10ubuntu0.14.04.4_all.deb - /var/cache/apt/archives/ubuntu-advantage-tools_19.6~ubuntu14.04.1~ppa2_amd64.deb - /var/cache/apt/archives/ubuntu-keyring_2012.05.19_all.deb - /var/cache/apt/archives/ucf_3.0027+nmu1_all.deb - - -# diff the contents of /etc/apt, should be empty -diff -uNr /tank/trusty-2{a,b}/etc/apt - -# OPTIONAL -# to go back to a clean state, without having to debootstrap again: -zfs destroy tank/trusty-2a -zfs destroy tank/trusty-2b -zfs rollback tank/trusty-minimal@fresh - -# confirming -zfs list -t all -r tank -``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/1832757/esm-trusty-test-3.md ubuntu-advantage-tools-27.10.1~18.04.1/sru/1832757/esm-trusty-test-3.md --- ubuntu-advantage-tools-27.9~18.04.1/sru/1832757/esm-trusty-test-3.md 2020-10-15 14:52:16.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/1832757/esm-trusty-test-3.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,139 +0,0 @@ -# Test case 3: Install u-a-t on minimal system test enable-esm vs ua attach - -3. - a. Start with a fresh Ubuntu instance which does not have u-a-t installed (i.e. ubuntu-minimal is not installed). Install u-a-t from -updates. Enable esm with 'ubuntu-advantage enable-esm'. Upgrade to u-a-t from -proposed. - b. In an identical instance, install u-a-t from -proposed. Enable esm with 'ubuntu-advantage attach'. - c. Confirm that the on-disk results of a) and b) are identical. - -``` -# originally from https://gist.github.com/panlinux/4843bfc1e726a3f006aa44190411d582 - -sudo su - -# adjust if needed, i.e., point to a mirror -export ARCHIVE_URL=http://br.archive.ubuntu.com/ubuntu -export PROPOSED_REPO="deb $ARCHIVE_URL trusty-proposed main" - -# these are needed -export LEGACY_ESM_TOKEN="user:password" -export UA_CONTRACT_TOKEN="" - -mkdir /esm-sru -cd /esm-sru -truncate -s 10G file.img -zpool create -O sync=disabled tank $(pwd)/file.img -zfs create tank/trusty-minimal -debootstrap --exclude=ubuntu-minimal trusty /tank/trusty-minimal $ARCHIVE_URL -zfs snapshot tank/trusty-minimal@fresh -# confirm no ubuntu-minimal nor ubuntu-advantage-tools -chroot /tank/trusty-minimal dpkg -l | grep -E "(ubuntu-minimal|ubuntu-advantage)" - -# create a clone from trusty-minimal called trusty-3a -zfs clone tank/trusty-minimal@fresh tank/trusty-3a - -# add extra pockets -cat >> /tank/trusty-3a/etc/apt/sources.list < /tank/trusty-3a/etc/apt/sources.list.d/proposed.list <> /tank/trusty-3b/etc/apt/sources.list < /tank/trusty-3b/etc/apt/sources.list.d/proposed.list < trusty-3a.list -find /tank/trusty-3b/ | sed -r 's,^/tank/[^/]+,,' | sort > trusty-3b.list - -# compare and verify the result -diff -u trusty-3a.list trusty-3b.list ---- trusty-3a.list 2019-10-24 11:20:19.207260287 -0300 -+++ trusty-3b.list 2019-10-24 11:20:21.939243951 -0300 -@@ -13723,7 +13723,6 @@ - /var/cache/apt/archives/sysv-rc_2.88dsf-41ubuntu6_all.deb - /var/cache/apt/archives/tar_1.27.1-1_amd64.deb - /var/cache/apt/archives/tzdata_2014b-1_all.deb --/var/cache/apt/archives/ubuntu-advantage-tools_10ubuntu0.14.04.4_all.deb - /var/cache/apt/archives/ubuntu-advantage-tools_19.6~ubuntu14.04.1~ppa2_amd64.deb - /var/cache/apt/archives/ubuntu-keyring_2012.05.19_all.deb - /var/cache/apt/archives/ucf_3.0027+nmu1_all.deb -@@ -13762,10 +13761,10 @@ - /var/lib/apt/lists/br.archive.ubuntu.com_ubuntu_dists_trusty-updates_InRelease - /var/lib/apt/lists/br.archive.ubuntu.com_ubuntu_dists_trusty-updates_main_binary-amd64_Packages - /var/lib/apt/lists/br.archive.ubuntu.com_ubuntu_dists_trusty-updates_main_i18n_Translation-en --/var/lib/apt/lists/esm.ubuntu.com_ubuntu_dists_trusty-security_InRelease --/var/lib/apt/lists/esm.ubuntu.com_ubuntu_dists_trusty-security_main_binary-amd64_Packages --/var/lib/apt/lists/esm.ubuntu.com_ubuntu_dists_trusty-updates_InRelease --/var/lib/apt/lists/esm.ubuntu.com_ubuntu_dists_trusty-updates_main_binary-amd64_Packages -+/var/lib/apt/lists/esm.ubuntu.com_ubuntu_dists_trusty-infra-security_InRelease -+/var/lib/apt/lists/esm.ubuntu.com_ubuntu_dists_trusty-infra-security_main_binary-amd64_Packages -+/var/lib/apt/lists/esm.ubuntu.com_ubuntu_dists_trusty-infra-updates_InRelease -+/var/lib/apt/lists/esm.ubuntu.com_ubuntu_dists_trusty-infra-updates_main_binary-amd64_Packages - /var/lib/apt/lists/lock - /var/lib/apt/lists/partial - /var/lib/apt/lists/ppa.launchpad.net_ci-train-ppa-service_3830_ubuntu_dists_trusty_InRelease -@@ -14881,6 +14880,16 @@ - /var/lib/systemd/deb-systemd-helper-enabled/rsyslog.service.dsh-also - /var/lib/systemd/deb-systemd-helper-enabled/syslog.service - /var/lib/ubuntu-advantage -+/var/lib/ubuntu-advantage/machine-id -+/var/lib/ubuntu-advantage/private -+/var/lib/ubuntu-advantage/private/machine-access-cc-eal.json -+/var/lib/ubuntu-advantage/private/machine-access-esm-infra.json -+/var/lib/ubuntu-advantage/private/machine-access-fips.json -+/var/lib/ubuntu-advantage/private/machine-access-fips-updates.json -+/var/lib/ubuntu-advantage/private/machine-access-livepatch.json -+/var/lib/ubuntu-advantage/private/machine-access-support.json -+/var/lib/ubuntu-advantage/private/machine-token.json -+/var/lib/ubuntu-advantage/status.json - /var/lib/ucf - /var/lib/ucf/cache - /var/lib/ucf/cache/:etc:rsyslog.d:50-default.conf - -# since 3a just upgraded to new u-a-t but didn't run attach, it won't have the /var/lib/ubuntu-advantage contents that 3b has -# 3a also won't have the new "infra" name in its repositories, so that's another expected difference -# finally, 3b won't have the package from trusty-updates, since it got the proposed one installed directly - -# diff the contents of /etc/apt. The expected changes are: -# - /etc/apt/auth.conf.d/90ubuntu-advantage: switch from old credentials to bearer token -# - /etc/apt/sources.list.d/ubuntu-esm-infra-trusty.list: switch to the infra repositories -diff -uNr /tank/trusty-3{a,b}/etc/apt - - -# OPTIONAL -# to go back to a clean state, without having to debootstrap again: -zfs destroy tank/trusty-3a -zfs destroy tank/trusty-3b -zfs rollback tank/trusty-minimal@fresh - -# confirming -zfs list -t all -r tank -``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/1832757/esm-trusty-test-4.md ubuntu-advantage-tools-27.10.1~18.04.1/sru/1832757/esm-trusty-test-4.md --- ubuntu-advantage-tools-27.9~18.04.1/sru/1832757/esm-trusty-test-4.md 2020-10-15 14:52:16.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/1832757/esm-trusty-test-4.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -# Test case 4: Start from cloud-image with u-a-t installed, compar enable-esm vs ua attach - -4. - a. Start with a fresh Ubuntu instance which does have u-a-t installed. Enable esm with 'ubuntu-advantage enable-esm'. Upgrade to u-a-t from -proposed. - b. In an identical instance, upgrade to u-a-t from -proposed. Enable esm with 'ubuntu-advantage attach'. - c. Confirm that the on-disk results of a) and b) are identical other than legacyToken|contractToken - -``` -# Originally from https://gist.github.com/blackboxsw/0e968aeabd42c23df619d29c7906c76e - -export LEGACY_ESM_TOKEN= -export UA_CONTRACT_TOKEN= -export ARCHIVE_URL=http://archive.ubuntu.com/ubuntu - -echo -- BEGIN test 4a: enable esm via `ubuntu-advantage enable-esm` on typical trusty-updates cloud-images which already have -updates installed - -# Launch a basic trusty cloud-image that is updated to latest ubuntu-advantage-tools from -updates -cat > update-uat-trusty.yaml < ppa-key << EOF ------BEGIN PGP PUBLIC KEY BLOCK----- - -xo0EUs00cgEEAJJqaPue5gzQiLB1krT9slYbqVW/bSBpW9+qX8gFI44IVM/Bo3yh -9BPAs1RAzja96N0FS6SNlew4JYfk7MBT2sFDGpm3bTKt9Go7muO0JkvKv0vYgrrw -qORlWK3SfsYa6EpsCdVzZPAKvGzc8I0XywVgcJhM5okx+3J2naBaSp9NABEBAAHN -K0xhdW5jaHBhZCBQUEEgZm9yIENJIFRyYWluIFBQQSBTZXJ2aWNlIFRlYW3CuAQT -AQIAIgUCUs00cgIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQhVBBKOzx -IEy62gP/T2h98ongV+RXekM1DpgTNoH0PBHrZVj4zfrvrYKZOaxRmJ6TWtzG8tFI -uB4gPjaFeenJBhCFaZ9UncFQemS9jztQ/pA049L1N7Tijd8/BKD7gc7tM07+Fq+Q -6DT7VuUFiVlfZUwWYzk5UXEk6ctluoIRpnRWUHmh6NssuAgd1Nk= -=aPbC ------END PGP PUBLIC KEY BLOCK----- -EOF - -# emit script to upgrade u-a-t -cat > add_uat_apt_pocket.sh << EOF -#/bin/bash -pocket_name=\$1 -if [ "\$pocket_name" = "devel" ]; then - echo deb [trusted=yes] http://ppa.launchpad.net/ci-train-ppa-service/3830/ubuntu trusty main | tee /etc/apt/sources.list.d/\$pocket_name.list - apt-key add /ppa-key -else - echo deb $ARCHIVE_URL \$pocket_name main | tee /etc/apt/sources.list.d/\$pocket_name.list -fi -EOF - -lxc file push ppa-key esm-sru-4a/ -lxc file push add_uat_apt_pocket.sh esm-sru-4a/ -lxc exec esm-sru-4a chmod 755 /add_uat_apt_pocket.sh - -echo "Make a pristine lxc snapshot for 4a and 4b" -lxc snapshot esm-sru-4a esm-sru-4a-pristine - -echo "Enable esm via ubuntu-advantage enable-esm" -lxc exec esm-sru-4a -- ubuntu-advantage enable-esm $LEGACY_ESM_TOKEN - -echo "Confirm ansible is available for esm PPA" -lxc exec esm-sru-4a apt-cache policy ansible - -echo "Upgrade u-a-t to trusty-proposed" -lxc exec esm-sru-4a /add_uat_apt_pocket.sh trusty-proposed # or devel -lxc exec esm-sru-4a -- apt-get update -q; -lxc exec esm-sru-4a -- apt-get install -qy ubuntu-advantage-tools; - -echo "Confirm ansible is available for esm PPA" -lxc exec esm-sru-4a apt-cache policy ansible - -lxc exec esm-sru-4a -- find / -xdev | sort > 4a/files.list -lxc file pull -r esm-sru-4a/etc 4a/ - - -echo -- BEGIN test 4b: upgrade u-a-t to -proposed version on typical trusty-updates cloud-images which already have -updates installed -lxc restore esm-sru-4a esm-sru-4a-pristine - -echo "Confirm u-a-t is already installed from trusty-updates v. 10ubuntu0.14.04.4" -lxc exec esm-sru-4a -- apt-cache policy ubuntu-advantage-tools - -echo "Upgrade u-a-t to trusty-proposed" -lxc exec esm-sru-4a /add_uat_apt_pocket.sh trusty-proposed # or devel -lxc exec esm-sru-4a -- apt-get update -q; -lxc exec esm-sru-4a -- apt-get install -qy ubuntu-advantage-tools; - -echo "Enable esm via: ua attach " -lxc exec esm-sru-4a ua attach $UA_CONTRACT_TOKEN - -echo "Confirm ansible is available for esm PPA" -lxc exec esm-sru-4a apt-cache policy ansible - -lxc exec esm-sru-4a -- find / -xdev | sort > 4b/files.list -lxc file pull -r esm-sru-4a/etc 4b/ - -echo --- BEGIN test 4c: ensure no filesystem diffs between 4a and 4b with exception of token used -diff -urN 4a 4b -``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/1832757/esm-trusty-test-5.md ubuntu-advantage-tools-27.10.1~18.04.1/sru/1832757/esm-trusty-test-5.md --- ubuntu-advantage-tools-27.9~18.04.1/sru/1832757/esm-trusty-test-5.md 2020-10-15 14:52:16.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/1832757/esm-trusty-test-5.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,90 +0,0 @@ -# Test case 5: Start with minimal precise vm with enable-esm and dist-upgrade to trusty -poposed - -5. - a. Start with a fresh Ubuntu *precise* instance which does have u-a-t installed and esm enabled. Dist-upgrade to trusty, then upgrade to u-a-t from -proposed. - b. In an identical instance, dist-upgrade to trusty with -proposed enabled. - c. Confirm that the on-disk results of a) and b) are identical. - -## 5a. Start with a fresh Ubuntu *precise* instance which does have u-a-t installed and esm enabled. Dist-upgrade to trusty, then upgrade to u-a-t from -proposed. - -``` -# Originally from https://gist.github.com/panlinux/e5bda289401660d77ed5eff4d980c30c 10/25 -echo --- BEGIN test 5a: dist-upgrade an esm-enable precise-updates to trusty-updates, then upgrade to -proposed - -mkdir -p 5a/var/lib/ -echo "Launch precise container with allowing ssh access for " - -cat >precise.yaml <] -EOF -lxc launch ubuntu-daily:precise sru-precise -c user.user-data="$(cat precise.yaml)" - -echo "Enable esm on precise" -lxc exec sru-precise ubuntu-advantage enable-esm - -echo "Dist-upgrade precise -> trusty" -VM_IP=`lxc list dev-p -c 4 | awk '/10/{print $2}'` -ssh ubuntu@$VM_IP -sudo mkdir -p /etc/update-manager/release-upgrades.d -echo -e "[Sources]\nAllowThirdParty=yes" > allow.cfg -sudo mv allow.cfg /etc/update-manager/release-upgrades.d -sudo do-release-upgrade # respond yes to any interactive prompts - -echo "Confirm ansible is available for trusty esm PPA" -apt-cache policy ansible - -echo "Upgrade u-a-t to trusty-proposed" -lxc file push ua_tools_install_from_pocket.sh sru-precise/ -lxc exec sru-precise "bash /ua_tools_install_from_pocket.sh trusty-proposed" - -lxc exec sru-precise -- dpkg -l > 5a/dpkg.list -lxc file pull -r sru-precise/etc 5a/ -lxc file pull -r sru-precise/var/lib/ubuntu-advantage 5a/var/lib -lxc stop sru-precise -lxc delete sru-precise -``` - -## b. In an identical instance, dist-upgrade to trusty with -proposed enabled. -``` -echo --- BEGIN test 5b: dist-upgrade an esm-enable precise-proposed to trusty-proposed -mkdir -p 5b/var/lib/ -echo "Launch precise container with allowing ssh access for " - -cat >precise.yaml <] -EOF -lxc launch ubuntu-daily:precise sru-precise -c user.user-data="$(cat precise.yaml)" - -echo "Enable esm on precise" -lxc exec sru-precise ubuntu-advantage enable-esm - -echo "Upgrade u-a-t to precise-proposed" # no-op -lxc file push ua_tools_install_from_pocket.sh sru-precise/ -lxc exec sru-precise "bash /ua_tools_install_from_pocket.sh sru-proposed" -lxc exec sru-precise "apt-get dist-upgrade" - -echo "Dist-upgrade precise-proposed -> trusty-proposed" -VM_IP=`lxc list dev-p -c 4 | awk '/10/{print $2}'` -ssh ubuntu@$VM_IP -sudo mkdir -p /etc/update-manager/release-upgrades.d -echo -e "[Sources]\nAllowThirdParty=yes" > allow.cfg -sudo mv allow.cfg /etc/update-manager/release-upgrades.d -sudo do-release-upgrade # respond yes to any interactive prompts - -echo "Confirm ansible is available for trusty esm PPA" -apt-cache policy ansible - -lxc exec sru-precise -- dpkg -l > 5b/dpkg.list -lxc file pull -r sru-precise/etc 5b/ -lxc file pull -r sru-precise/var/lib/ubuntu-advantage 5b/var/lib -lxc stop sru-precise -lxc delete sru-precise -``` - -## c. Confirm that the on-disk results of a) and b) are identical. -``` -echo --- BEGIN test 5c: confirm filesytem changes of test 5a and 5b are identical -dirr -urN 5a 5b -``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/1851858/esm-trusty-test-1.md ubuntu-advantage-tools-27.10.1~18.04.1/sru/1851858/esm-trusty-test-1.md --- ubuntu-advantage-tools-27.9~18.04.1/sru/1851858/esm-trusty-test-1.md 2020-10-15 14:52:16.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/1851858/esm-trusty-test-1.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,97 +0,0 @@ -# Test case 1: Start from x86_64 cloud-image with u-a-t installed and esm attached, upgrade to -proposed - -1. - a. Start with a fresh Ubuntu **x86_64** instance which does have u-a-t installed. Enable esm with 'ubuntu-advantage attach'. Upgrade to u-a-t from -proposed. - b. Confirm that machine remains attached, esm enabled and package installs - work - c. Confirm that machine handles ua-contract architecture deltas for esm and remains attached/enabled - -``` -export UA_CONTRACT_TOKEN= -export ARCHIVE_URL=http://archive.ubuntu.com/ubuntu - -echo -- BEGIN test 1a: enable esm via "ubuntu-advantage attach " on typical trusty-updates cloud-images which already have -updates installed - -# Launch a basic trusty cloud-image that is updated to latest ubuntu-advantage-tools from -updates -cat > update-uat-trusty.yaml < fake_contract_delta.sh << EOF -#!/bin/bash -echo "Introduce a fake architecture delta by modifying the cache machine token" -sed -i 's/"i386", "ppc64le",/"i386",/' /var/lib/ubuntu-advantage/private/machine-token.json -sed -i 's/"i386", "ppc64le",/"i386",/' /var/lib/ubuntu-advantage/private/machine-access-esm-infra.json -EOF - - -lxc launch ubuntu-daily:trusty esm-sru-1a -c user.user-data="$(cat update-uat-trusty.yaml)" - -echo "Wait for cloud-init to finish startup on trusty" -RUNLEVEL="NOTSET" -while ! [ "N 2" = "$RUNLEVEL" ]; do echo -n '.'; sleep 1; RUNLEVEL=`lxc exec esm-sru-1a runlevel`; done; echo - -echo "Confirm u-a-t is already installed" -lxc exec esm-sru-1a -- apt-cache policy ubuntu-advantage-tools - -cat > ppa-key << EOF ------BEGIN PGP PUBLIC KEY BLOCK----- - -xo0EUs00cgEEAJJqaPue5gzQiLB1krT9slYbqVW/bSBpW9+qX8gFI44IVM/Bo3yh -9BPAs1RAzja96N0FS6SNlew4JYfk7MBT2sFDGpm3bTKt9Go7muO0JkvKv0vYgrrw -qORlWK3SfsYa6EpsCdVzZPAKvGzc8I0XywVgcJhM5okx+3J2naBaSp9NABEBAAHN -K0xhdW5jaHBhZCBQUEEgZm9yIENJIFRyYWluIFBQQSBTZXJ2aWNlIFRlYW3CuAQT -AQIAIgUCUs00cgIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQhVBBKOzx -IEy62gP/T2h98ongV+RXekM1DpgTNoH0PBHrZVj4zfrvrYKZOaxRmJ6TWtzG8tFI -uB4gPjaFeenJBhCFaZ9UncFQemS9jztQ/pA049L1N7Tijd8/BKD7gc7tM07+Fq+Q -6DT7VuUFiVlfZUwWYzk5UXEk6ctluoIRpnRWUHmh6NssuAgd1Nk= -=aPbC ------END PGP PUBLIC KEY BLOCK----- -EOF - -# emit script to upgrade u-a-t -cat > add_uat_apt_pocket.sh << EOF -#/bin/bash -pocket_name=\$1 -if [ "\$pocket_name" = "devel" ]; then - echo deb [trusted=yes] http://ppa.launchpad.net/ci-train-ppa-service/3830/ubuntu trusty main | tee /etc/apt/sources.list.d/\$pocket_name.list - apt-key add /ppa-key -else - echo deb $ARCHIVE_URL \$pocket_name main | tee /etc/apt/sources.list.d/\$pocket_name.list -fi -EOF - -lxc file push ppa-key esm-sru-1a/ -lxc file push add_uat_apt_pocket.sh esm-sru-1a/ -lxc file push fake_contract_delta.sh esm-sru-1a/ -lxc exec esm-sru-1a chmod 755 /add_uat_apt_pocket.sh -lxc exec esm-sru-1a chmod 755 /fake_contract_delta.sh - -echo "Enable esm via ubuntu-advantage enable-esm" -lxc exec esm-sru-1a -- ubuntu-advantage attach $UA_CONTRACT_TOKEN - -echo "Confirm python-jinja2 is available for esm PPA" -lxc exec esm-sru-1a apt-cache policy python-jinja2 - -echo -- BEGIN test 1a: Confirm upgraded attached machine remains attached and esm enabled -echo "Upgrade u-a-t to trusty-proposed" -lxc exec esm-sru-1a /add_uat_apt_pocket.sh trusty-proposed # or devel -lxc exec esm-sru-1a -- apt-get update -q; -lxc exec esm-sru-1a -- apt-get install -qy ubuntu-advantage-tools; - -echo "Confirm python-jinja2 is available for esm PPA" -lxc exec esm-sru-1a apt-cache policy python-jinja2 - -lxc exec esm-sru-1a apt-get install python-jinja2 - -echo -- BEGIN test 1c: Confirm ua-contract architecture deltas don't unattach/disable esm on supported platforms -lxc exec esm-sru-1a /echo -- BEGIN test 1c: Confirm ua-contract architecture deltas do not unattach/disable esm on supported platforms -lxc exec esm-sru-1a /fake_contract_delta.sh -lxc exec esm-sru-1a ua refresh -lxc exec esm-sru-1a ua status - -``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/1851858/esm-trusty-test-2.md ubuntu-advantage-tools-27.10.1~18.04.1/sru/1851858/esm-trusty-test-2.md --- ubuntu-advantage-tools-27.9~18.04.1/sru/1851858/esm-trusty-test-2.md 2020-10-15 14:52:16.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/1851858/esm-trusty-test-2.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -# Test case 2: Start from **pp64le** cloud-image on canonistack with u-a-t installed and esm attached, upgrade to -proposed and test architecture deltas - -2. - a. Start with a fresh Ubuntu **non-x86** instance which does have u-a-t installed. Enable esm with 'ubuntu-advantage attach'. Upgrade to u-a-t from -proposed. - b. Confirm that machine remains attached, esm gets **disabled**, and status remains **disabled**. - c. Update machine token files to represent delta in architectures from contract server. Ensure `ua refresh` retains attached, but esm status becomes **n/a** - -``` -#!/bin/bash -set -xe -NOVARC=.canonistack/csmith.novarc -source $NOVARC - -export UA_CONTRACT_TOKEN= -export ARCHIVE_URL=http://archive.ubuntu.com/ubuntu - -# Assume only 1 keypair registered -export SSH_KEY=`openstack keypair list -f json | jq -r '.[0].Name'` -export LP_USER= - -echo -- BEGIN test 2a: enable esm via "ubuntu-advantage attach " on typical trusty-updates cloud-images which already have -updates installed - -# Launch a basic trusty cloud-image that is updated to latest ubuntu-advantage-tools from -updates -cat > update-uat-trusty.yaml < images-ppc64le.json -fi - -sshopts=( -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR ) - -cat > ppa-key << EOF ------BEGIN PGP PUBLIC KEY BLOCK----- - -xo0EUs00cgEEAJJqaPue5gzQiLB1krT9slYbqVW/bSBpW9+qX8gFI44IVM/Bo3yh -9BPAs1RAzja96N0FS6SNlew4JYfk7MBT2sFDGpm3bTKt9Go7muO0JkvKv0vYgrrw -qORlWK3SfsYa6EpsCdVzZPAKvGzc8I0XywVgcJhM5okx+3J2naBaSp9NABEBAAHN -K0xhdW5jaHBhZCBQUEEgZm9yIENJIFRyYWluIFBQQSBTZXJ2aWNlIFRlYW3CuAQT -AQIAIgUCUs00cgIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQhVBBKOzx -IEy62gP/T2h98ongV+RXekM1DpgTNoH0PBHrZVj4zfrvrYKZOaxRmJ6TWtzG8tFI -uB4gPjaFeenJBhCFaZ9UncFQemS9jztQ/pA049L1N7Tijd8/BKD7gc7tM07+Fq+Q -6DT7VuUFiVlfZUwWYzk5UXEk6ctluoIRpnRWUHmh6NssuAgd1Nk= -=aPbC ------END PGP PUBLIC KEY BLOCK----- -EOF - -cat > add_uat_apt_pocket.sh << EOF -#/bin/bash -pocket_name=\$1 -if [ "\$pocket_name" = "devel" ]; then - echo deb [trusted=yes] http://ppa.launchpad.net/ci-train-ppa-service/3839/ubuntu trusty main | tee /etc/apt/sources.list.d/\$pocket_name.list - apt-key add /ppa-key -else - echo deb $ARCHIVE_URL \$pocket_name main | tee /etc/apt/sources.list.d/\$pocket_name.list -fi -EOF - -cat > fake_contract_delta.sh << EOF -#!/bin/bash -echo "Introduce a fake architecture delta by modifying the cache machine token" -sed -i 's/"i386", "ppc64le",/"i386",/' /var/lib/ubuntu-advantage/private/machine-token.json -sed -i 's/"i386", "ppc64le",/"i386",/' /var/lib/ubuntu-advantage/private/machine-access-esm-infra.json -EOF - - -for series in trusty; do - echo "### BEGIN $series" - # Determine image, launch instance and attach IP address - image=$(cat images-ppc64le.json | jq -r '.[]|select((.Name|contains("disk1.img")) and (.Name|contains("'$series'"))) | .ID' | tail -n 1) - openstack server create --flavor cpu1-ram2-disk20 --image $image --key-name $SSH_KEY --user-data update-uat-trusty.yaml test-$series --wait - sleep 10 - VM_IP=`openstack server show test-trusty -f json | jq -r '.addresses' | awk -F '=' '{print $NF}'` - echo "Wait for cloud-init to finish startup on trusty: $VM_IP" - RUNLEVEL="NOTSET" - while ! [ "N 2" = "$RUNLEVEL" ]; do echo -n '.'; sleep 5; RUNLEVEL=`ssh "${sshopts[@]}" ubuntu@$VM_IP runlevel`; done; echo - - echo "Confirm u-a-t is already installed" - ssh "${sshopts[@]}" ubuntu@$VM_IP -- apt-cache policy ubuntu-advantage-tools - - -# emit script to upgrade u-a-t - scp "${sshopts[@]}" ppa-key ubuntu@$VM_IP:. - scp "${sshopts[@]}" add_uat_apt_pocket.sh ubuntu@$VM_IP:. - scp "${sshopts[@]}" fake_contract_delta.sh ubuntu@$VM_IP:. - ssh "${sshopts[@]}" ubuntu@$VM_IP chmod 755 ./add_uat_apt_pocket.sh - ssh "${sshopts[@]}" ubuntu@$VM_IP chmod 755 ./fake_contract_delta.sh - echo "Enable esm via ubuntu-advantage enable-esm" - ssh "${sshopts[@]}" ubuntu@$VM_IP -- sudo ua attach $UA_CONTRACT_TOKEN - - echo "Confirm python-jinja2 is available for esm PPA" - ssh "${sshopts[@]}" ubuntu@$VM_IP apt-cache policy python-jinja2 - - echo "Upgrade u-a-t to trusty-proposed" - echo -- BEGIN test 2b: confirm machine stays attached, but esm is disabled after upgrade to -proposed - ssh "${sshopts[@]}" ubuntu@$VM_IP -- sudo ./add_uat_apt_pocket.sh trusty-proposed - ssh "${sshopts[@]}" ubuntu@$VM_IP -- sudo apt-get update; - ssh "${sshopts[@]}" ubuntu@$VM_IP -- sudo apt-get install -y ubuntu-advantage-tools; - - echo "Confirm status remains attached: non-root" - ssh "${sshopts[@]}" ubuntu@$VM_IP ua status; - echo "Confirm status remains attached: root" - ssh "${sshopts[@]}" ubuntu@$VM_IP sudo ua status; - - echo "Confirm python-jinja2 is available for esm PPA" - ssh "${sshopts[@]}" ubuntu@$VM_IP apt-cache policy python-jinja2 - ssh "${sshopts[@]}" ubuntu@$VM_IP sudo apt-get install python-jinja2 - echo "Test 2c: Confirm deltas in architectures don't break ua client" - ssh "${sshopts[@]}" ubuntu@$VM_IP sudo apt-get install python-jinja2 - ssh "${sshopts[@]}" ubuntu@$VM_IP sudo ./fake_contract_delta.sh - ssh "${sshopts[@]}" ubuntu@$VM_IP sudo ua refresh - ssh "${sshopts[@]}" ubuntu@$VM_IP sudo ua status -done -``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/1832757/esm-trusty-test-1.md ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/1832757/esm-trusty-test-1.md --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/1832757/esm-trusty-test-1.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/1832757/esm-trusty-test-1.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,52 @@ +# Test case 1: Attach a trusty machine and verify ESM is attached and ESM packages can be installed. +``` +#!/bin/bash +echo "--- Test 1: Attach a trusty machine using a token from auth.contracts.canonical.com and verify ESM is attached and ESM packages can be installed." + +echo "Launch Trusty container with allowing ssh access for " + +export CONTRACT_TOKEN="" +export ARCHIVE_URL="http://archive.ubuntu.com/ubuntu" + +cat >trusty-ssh.yaml < add_uat_apt_pocket.sh << EOF +#/bin/bash +pocket_name=\$1 +echo deb $ARCHIVE_URL \$pocket_name main | tee /etc/apt/sources.list.d/\$pocket_name.list +EOF + +echo "Upgrade ubuntu-advantage-tools to trusty-proposed" +lxc file push add_uat_apt_pocket.sh sru-trusty/; +lxc exec sru-trusty chmod 755 /add_uat_apt_pocket.sh; +lxc exec sru-trusty /add_uat_apt_pocket.sh trusty-proposed; +lxc exec sru-trusty -- apt-get update -q; +lxc exec sru-trusty -- apt-get install -qy ubuntu-advantage-tools; + +echo "Confirm ubuntu-advantage-tools version from -proposed" +lxc exec sru-trusty -- apt-cache policy ubuntu-advantage-tools; + + +echo "Enable esm on trusty as non-root sudo" +VM_IP=`lxc list sru-trusty -c 4 | awk '/10/{print $2}'` + +# Expect ua status to show esm enabled, livepatch n/a +ssh ubuntu@$VM_IP -- sudo ua attach $CONTRACT_TOKEN + +echo "Confirm ansible is available for trusty esm PPA" +ssh ubuntu@$VM_IP -- apt-cache policy ansible + +ANSIBLE_ESM_VER=`lxc exec sru-trusty -- apt-cache policy ansible | grep esm | grep Candidate | awk '{print $2}'` + +echo "Installing ansible from esm" +ssh ubuntu@$VM_IP -- sudo apt-get install ansible=$ANSIBLE_ESM_VER -y +``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/1832757/esm-trusty-test-2.md ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/1832757/esm-trusty-test-2.md --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/1832757/esm-trusty-test-2.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/1832757/esm-trusty-test-2.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,93 @@ +# Test case 2 + +2. + a. Start with a fresh Ubuntu instance which does not have u-a-t installed (i.e. ubuntu-minimal is not installed). Install u-a-t from -updates. + Do not enable ua. Upgrade to u-a-t from -proposed. + b. In an identical instance, install u-a-t from -proposed. + c. Confirm that the on-disk results of a) and b) are identical. + +``` +originally from https://gist.githubusercontent.com/panlinux/4caaf069356da7436d97b47afce32234/raw/d07504309557e9176ae887b8606b4de80c422e02/esm-trusty-test-2.txt + + +sudo su - +# adjust if needed, i.e., point to a mirror +export ARCHIVE_URL=http://br.archive.ubuntu.com/ubuntu +export PROPOSED_REPO="deb $ARCHIVE_URL trusty-proposed main" + +mkdir /esm-sru +cd /esm-sru +truncate -s 10G file.img +zpool create -O sync=disabled tank $(pwd)/file.img +zfs create tank/trusty-minimal +debootstrap --exclude=ubuntu-minimal trusty /tank/trusty-minimal $ARCHIVE_URL +zfs snapshot tank/trusty-minimal@fresh +# confirm no ubuntu-minimal nor ubuntu-advantage-tools +chroot /tank/trusty-minimal dpkg -l | grep -E "(ubuntu-minimal|ubuntu-advantage)" + +# create a clone from trusty-minimal called trusty-2a +zfs clone tank/trusty-minimal@fresh tank/trusty-2a + +# add extra pockets +cat >> /tank/trusty-2a/etc/apt/sources.list < /tank/trusty-2a/etc/apt/sources.list.d/proposed.list <> /tank/trusty-2b/etc/apt/sources.list < /tank/trusty-2b/etc/apt/sources.list.d/proposed.list < trusty-2a.list +find /tank/trusty-2b/ | sed -r 's,^/tank/[^/]+,,' | sort > trusty-2b.list + +# compare and verify the result. The difference should be just that the 2a list has the intermediary u-a-t package from trusty-updates in the apt cache +diff -u trusty-2a.list trusty-2b.list +--- trusty-2a.list 2019-10-24 15:55:01.120848221 -0300 ++++ trusty-2b.list 2019-10-24 15:55:01.256846583 -0300 +@@ -13723,7 +13723,6 @@ + /var/cache/apt/archives/sysv-rc_2.88dsf-41ubuntu6_all.deb + /var/cache/apt/archives/tar_1.27.1-1_amd64.deb + /var/cache/apt/archives/tzdata_2014b-1_all.deb +-/var/cache/apt/archives/ubuntu-advantage-tools_10ubuntu0.14.04.4_all.deb + /var/cache/apt/archives/ubuntu-advantage-tools_19.6~ubuntu14.04.1~ppa2_amd64.deb + /var/cache/apt/archives/ubuntu-keyring_2012.05.19_all.deb + /var/cache/apt/archives/ucf_3.0027+nmu1_all.deb + + +# diff the contents of /etc/apt, should be empty +diff -uNr /tank/trusty-2{a,b}/etc/apt + +# OPTIONAL +# to go back to a clean state, without having to debootstrap again: +zfs destroy tank/trusty-2a +zfs destroy tank/trusty-2b +zfs rollback tank/trusty-minimal@fresh + +# confirming +zfs list -t all -r tank +``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/1832757/esm-trusty-test-3.md ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/1832757/esm-trusty-test-3.md --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/1832757/esm-trusty-test-3.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/1832757/esm-trusty-test-3.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,139 @@ +# Test case 3: Install u-a-t on minimal system test enable-esm vs ua attach + +3. + a. Start with a fresh Ubuntu instance which does not have u-a-t installed (i.e. ubuntu-minimal is not installed). Install u-a-t from -updates. Enable esm with 'ubuntu-advantage enable-esm'. Upgrade to u-a-t from -proposed. + b. In an identical instance, install u-a-t from -proposed. Enable esm with 'ubuntu-advantage attach'. + c. Confirm that the on-disk results of a) and b) are identical. + +``` +# originally from https://gist.github.com/panlinux/4843bfc1e726a3f006aa44190411d582 + +sudo su - +# adjust if needed, i.e., point to a mirror +export ARCHIVE_URL=http://br.archive.ubuntu.com/ubuntu +export PROPOSED_REPO="deb $ARCHIVE_URL trusty-proposed main" + +# these are needed +export LEGACY_ESM_TOKEN="user:password" +export UA_CONTRACT_TOKEN="" + +mkdir /esm-sru +cd /esm-sru +truncate -s 10G file.img +zpool create -O sync=disabled tank $(pwd)/file.img +zfs create tank/trusty-minimal +debootstrap --exclude=ubuntu-minimal trusty /tank/trusty-minimal $ARCHIVE_URL +zfs snapshot tank/trusty-minimal@fresh +# confirm no ubuntu-minimal nor ubuntu-advantage-tools +chroot /tank/trusty-minimal dpkg -l | grep -E "(ubuntu-minimal|ubuntu-advantage)" + +# create a clone from trusty-minimal called trusty-3a +zfs clone tank/trusty-minimal@fresh tank/trusty-3a + +# add extra pockets +cat >> /tank/trusty-3a/etc/apt/sources.list < /tank/trusty-3a/etc/apt/sources.list.d/proposed.list <> /tank/trusty-3b/etc/apt/sources.list < /tank/trusty-3b/etc/apt/sources.list.d/proposed.list < trusty-3a.list +find /tank/trusty-3b/ | sed -r 's,^/tank/[^/]+,,' | sort > trusty-3b.list + +# compare and verify the result +diff -u trusty-3a.list trusty-3b.list +--- trusty-3a.list 2019-10-24 11:20:19.207260287 -0300 ++++ trusty-3b.list 2019-10-24 11:20:21.939243951 -0300 +@@ -13723,7 +13723,6 @@ + /var/cache/apt/archives/sysv-rc_2.88dsf-41ubuntu6_all.deb + /var/cache/apt/archives/tar_1.27.1-1_amd64.deb + /var/cache/apt/archives/tzdata_2014b-1_all.deb +-/var/cache/apt/archives/ubuntu-advantage-tools_10ubuntu0.14.04.4_all.deb + /var/cache/apt/archives/ubuntu-advantage-tools_19.6~ubuntu14.04.1~ppa2_amd64.deb + /var/cache/apt/archives/ubuntu-keyring_2012.05.19_all.deb + /var/cache/apt/archives/ucf_3.0027+nmu1_all.deb +@@ -13762,10 +13761,10 @@ + /var/lib/apt/lists/br.archive.ubuntu.com_ubuntu_dists_trusty-updates_InRelease + /var/lib/apt/lists/br.archive.ubuntu.com_ubuntu_dists_trusty-updates_main_binary-amd64_Packages + /var/lib/apt/lists/br.archive.ubuntu.com_ubuntu_dists_trusty-updates_main_i18n_Translation-en +-/var/lib/apt/lists/esm.ubuntu.com_ubuntu_dists_trusty-security_InRelease +-/var/lib/apt/lists/esm.ubuntu.com_ubuntu_dists_trusty-security_main_binary-amd64_Packages +-/var/lib/apt/lists/esm.ubuntu.com_ubuntu_dists_trusty-updates_InRelease +-/var/lib/apt/lists/esm.ubuntu.com_ubuntu_dists_trusty-updates_main_binary-amd64_Packages ++/var/lib/apt/lists/esm.ubuntu.com_ubuntu_dists_trusty-infra-security_InRelease ++/var/lib/apt/lists/esm.ubuntu.com_ubuntu_dists_trusty-infra-security_main_binary-amd64_Packages ++/var/lib/apt/lists/esm.ubuntu.com_ubuntu_dists_trusty-infra-updates_InRelease ++/var/lib/apt/lists/esm.ubuntu.com_ubuntu_dists_trusty-infra-updates_main_binary-amd64_Packages + /var/lib/apt/lists/lock + /var/lib/apt/lists/partial + /var/lib/apt/lists/ppa.launchpad.net_ci-train-ppa-service_3830_ubuntu_dists_trusty_InRelease +@@ -14881,6 +14880,16 @@ + /var/lib/systemd/deb-systemd-helper-enabled/rsyslog.service.dsh-also + /var/lib/systemd/deb-systemd-helper-enabled/syslog.service + /var/lib/ubuntu-advantage ++/var/lib/ubuntu-advantage/machine-id ++/var/lib/ubuntu-advantage/private ++/var/lib/ubuntu-advantage/private/machine-access-cc-eal.json ++/var/lib/ubuntu-advantage/private/machine-access-esm-infra.json ++/var/lib/ubuntu-advantage/private/machine-access-fips.json ++/var/lib/ubuntu-advantage/private/machine-access-fips-updates.json ++/var/lib/ubuntu-advantage/private/machine-access-livepatch.json ++/var/lib/ubuntu-advantage/private/machine-access-support.json ++/var/lib/ubuntu-advantage/private/machine-token.json ++/var/lib/ubuntu-advantage/status.json + /var/lib/ucf + /var/lib/ucf/cache + /var/lib/ucf/cache/:etc:rsyslog.d:50-default.conf + +# since 3a just upgraded to new u-a-t but didn't run attach, it won't have the /var/lib/ubuntu-advantage contents that 3b has +# 3a also won't have the new "infra" name in its repositories, so that's another expected difference +# finally, 3b won't have the package from trusty-updates, since it got the proposed one installed directly + +# diff the contents of /etc/apt. The expected changes are: +# - /etc/apt/auth.conf.d/90ubuntu-advantage: switch from old credentials to bearer token +# - /etc/apt/sources.list.d/ubuntu-esm-infra-trusty.list: switch to the infra repositories +diff -uNr /tank/trusty-3{a,b}/etc/apt + + +# OPTIONAL +# to go back to a clean state, without having to debootstrap again: +zfs destroy tank/trusty-3a +zfs destroy tank/trusty-3b +zfs rollback tank/trusty-minimal@fresh + +# confirming +zfs list -t all -r tank +``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/1832757/esm-trusty-test-4.md ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/1832757/esm-trusty-test-4.md --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/1832757/esm-trusty-test-4.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/1832757/esm-trusty-test-4.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,112 @@ +# Test case 4: Start from cloud-image with u-a-t installed, compar enable-esm vs ua attach + +4. + a. Start with a fresh Ubuntu instance which does have u-a-t installed. Enable esm with 'ubuntu-advantage enable-esm'. Upgrade to u-a-t from -proposed. + b. In an identical instance, upgrade to u-a-t from -proposed. Enable esm with 'ubuntu-advantage attach'. + c. Confirm that the on-disk results of a) and b) are identical other than legacyToken|contractToken + +``` +# Originally from https://gist.github.com/blackboxsw/0e968aeabd42c23df619d29c7906c76e + +export LEGACY_ESM_TOKEN= +export UA_CONTRACT_TOKEN= +export ARCHIVE_URL=http://archive.ubuntu.com/ubuntu + +echo -- BEGIN test 4a: enable esm via `ubuntu-advantage enable-esm` on typical trusty-updates cloud-images which already have -updates installed + +# Launch a basic trusty cloud-image that is updated to latest ubuntu-advantage-tools from -updates +cat > update-uat-trusty.yaml < ppa-key << EOF +-----BEGIN PGP PUBLIC KEY BLOCK----- + +xo0EUs00cgEEAJJqaPue5gzQiLB1krT9slYbqVW/bSBpW9+qX8gFI44IVM/Bo3yh +9BPAs1RAzja96N0FS6SNlew4JYfk7MBT2sFDGpm3bTKt9Go7muO0JkvKv0vYgrrw +qORlWK3SfsYa6EpsCdVzZPAKvGzc8I0XywVgcJhM5okx+3J2naBaSp9NABEBAAHN +K0xhdW5jaHBhZCBQUEEgZm9yIENJIFRyYWluIFBQQSBTZXJ2aWNlIFRlYW3CuAQT +AQIAIgUCUs00cgIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQhVBBKOzx +IEy62gP/T2h98ongV+RXekM1DpgTNoH0PBHrZVj4zfrvrYKZOaxRmJ6TWtzG8tFI +uB4gPjaFeenJBhCFaZ9UncFQemS9jztQ/pA049L1N7Tijd8/BKD7gc7tM07+Fq+Q +6DT7VuUFiVlfZUwWYzk5UXEk6ctluoIRpnRWUHmh6NssuAgd1Nk= +=aPbC +-----END PGP PUBLIC KEY BLOCK----- +EOF + +# emit script to upgrade u-a-t +cat > add_uat_apt_pocket.sh << EOF +#/bin/bash +pocket_name=\$1 +if [ "\$pocket_name" = "devel" ]; then + echo deb [trusted=yes] http://ppa.launchpad.net/ci-train-ppa-service/3830/ubuntu trusty main | tee /etc/apt/sources.list.d/\$pocket_name.list + apt-key add /ppa-key +else + echo deb $ARCHIVE_URL \$pocket_name main | tee /etc/apt/sources.list.d/\$pocket_name.list +fi +EOF + +lxc file push ppa-key esm-sru-4a/ +lxc file push add_uat_apt_pocket.sh esm-sru-4a/ +lxc exec esm-sru-4a chmod 755 /add_uat_apt_pocket.sh + +echo "Make a pristine lxc snapshot for 4a and 4b" +lxc snapshot esm-sru-4a esm-sru-4a-pristine + +echo "Enable esm via ubuntu-advantage enable-esm" +lxc exec esm-sru-4a -- ubuntu-advantage enable-esm $LEGACY_ESM_TOKEN + +echo "Confirm ansible is available for esm PPA" +lxc exec esm-sru-4a apt-cache policy ansible + +echo "Upgrade u-a-t to trusty-proposed" +lxc exec esm-sru-4a /add_uat_apt_pocket.sh trusty-proposed # or devel +lxc exec esm-sru-4a -- apt-get update -q; +lxc exec esm-sru-4a -- apt-get install -qy ubuntu-advantage-tools; + +echo "Confirm ansible is available for esm PPA" +lxc exec esm-sru-4a apt-cache policy ansible + +lxc exec esm-sru-4a -- find / -xdev | sort > 4a/files.list +lxc file pull -r esm-sru-4a/etc 4a/ + + +echo -- BEGIN test 4b: upgrade u-a-t to -proposed version on typical trusty-updates cloud-images which already have -updates installed +lxc restore esm-sru-4a esm-sru-4a-pristine + +echo "Confirm u-a-t is already installed from trusty-updates v. 10ubuntu0.14.04.4" +lxc exec esm-sru-4a -- apt-cache policy ubuntu-advantage-tools + +echo "Upgrade u-a-t to trusty-proposed" +lxc exec esm-sru-4a /add_uat_apt_pocket.sh trusty-proposed # or devel +lxc exec esm-sru-4a -- apt-get update -q; +lxc exec esm-sru-4a -- apt-get install -qy ubuntu-advantage-tools; + +echo "Enable esm via: ua attach " +lxc exec esm-sru-4a ua attach $UA_CONTRACT_TOKEN + +echo "Confirm ansible is available for esm PPA" +lxc exec esm-sru-4a apt-cache policy ansible + +lxc exec esm-sru-4a -- find / -xdev | sort > 4b/files.list +lxc file pull -r esm-sru-4a/etc 4b/ + +echo --- BEGIN test 4c: ensure no filesystem diffs between 4a and 4b with exception of token used +diff -urN 4a 4b +``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/1832757/esm-trusty-test-5.md ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/1832757/esm-trusty-test-5.md --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/1832757/esm-trusty-test-5.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/1832757/esm-trusty-test-5.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,90 @@ +# Test case 5: Start with minimal precise vm with enable-esm and dist-upgrade to trusty -poposed + +5. + a. Start with a fresh Ubuntu *precise* instance which does have u-a-t installed and esm enabled. Dist-upgrade to trusty, then upgrade to u-a-t from -proposed. + b. In an identical instance, dist-upgrade to trusty with -proposed enabled. + c. Confirm that the on-disk results of a) and b) are identical. + +## 5a. Start with a fresh Ubuntu *precise* instance which does have u-a-t installed and esm enabled. Dist-upgrade to trusty, then upgrade to u-a-t from -proposed. + +``` +# Originally from https://gist.github.com/panlinux/e5bda289401660d77ed5eff4d980c30c 10/25 +echo --- BEGIN test 5a: dist-upgrade an esm-enable precise-updates to trusty-updates, then upgrade to -proposed + +mkdir -p 5a/var/lib/ +echo "Launch precise container with allowing ssh access for " + +cat >precise.yaml <] +EOF +lxc launch ubuntu-daily:precise sru-precise -c user.user-data="$(cat precise.yaml)" + +echo "Enable esm on precise" +lxc exec sru-precise ubuntu-advantage enable-esm + +echo "Dist-upgrade precise -> trusty" +VM_IP=`lxc list dev-p -c 4 | awk '/10/{print $2}'` +ssh ubuntu@$VM_IP +sudo mkdir -p /etc/update-manager/release-upgrades.d +echo -e "[Sources]\nAllowThirdParty=yes" > allow.cfg +sudo mv allow.cfg /etc/update-manager/release-upgrades.d +sudo do-release-upgrade # respond yes to any interactive prompts + +echo "Confirm ansible is available for trusty esm PPA" +apt-cache policy ansible + +echo "Upgrade u-a-t to trusty-proposed" +lxc file push ua_tools_install_from_pocket.sh sru-precise/ +lxc exec sru-precise "bash /ua_tools_install_from_pocket.sh trusty-proposed" + +lxc exec sru-precise -- dpkg -l > 5a/dpkg.list +lxc file pull -r sru-precise/etc 5a/ +lxc file pull -r sru-precise/var/lib/ubuntu-advantage 5a/var/lib +lxc stop sru-precise +lxc delete sru-precise +``` + +## b. In an identical instance, dist-upgrade to trusty with -proposed enabled. +``` +echo --- BEGIN test 5b: dist-upgrade an esm-enable precise-proposed to trusty-proposed +mkdir -p 5b/var/lib/ +echo "Launch precise container with allowing ssh access for " + +cat >precise.yaml <] +EOF +lxc launch ubuntu-daily:precise sru-precise -c user.user-data="$(cat precise.yaml)" + +echo "Enable esm on precise" +lxc exec sru-precise ubuntu-advantage enable-esm + +echo "Upgrade u-a-t to precise-proposed" # no-op +lxc file push ua_tools_install_from_pocket.sh sru-precise/ +lxc exec sru-precise "bash /ua_tools_install_from_pocket.sh sru-proposed" +lxc exec sru-precise "apt-get dist-upgrade" + +echo "Dist-upgrade precise-proposed -> trusty-proposed" +VM_IP=`lxc list dev-p -c 4 | awk '/10/{print $2}'` +ssh ubuntu@$VM_IP +sudo mkdir -p /etc/update-manager/release-upgrades.d +echo -e "[Sources]\nAllowThirdParty=yes" > allow.cfg +sudo mv allow.cfg /etc/update-manager/release-upgrades.d +sudo do-release-upgrade # respond yes to any interactive prompts + +echo "Confirm ansible is available for trusty esm PPA" +apt-cache policy ansible + +lxc exec sru-precise -- dpkg -l > 5b/dpkg.list +lxc file pull -r sru-precise/etc 5b/ +lxc file pull -r sru-precise/var/lib/ubuntu-advantage 5b/var/lib +lxc stop sru-precise +lxc delete sru-precise +``` + +## c. Confirm that the on-disk results of a) and b) are identical. +``` +echo --- BEGIN test 5c: confirm filesytem changes of test 5a and 5b are identical +dirr -urN 5a 5b +``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/1851858/esm-trusty-test-1.md ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/1851858/esm-trusty-test-1.md --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/1851858/esm-trusty-test-1.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/1851858/esm-trusty-test-1.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,97 @@ +# Test case 1: Start from x86_64 cloud-image with u-a-t installed and esm attached, upgrade to -proposed + +1. + a. Start with a fresh Ubuntu **x86_64** instance which does have u-a-t installed. Enable esm with 'ubuntu-advantage attach'. Upgrade to u-a-t from -proposed. + b. Confirm that machine remains attached, esm enabled and package installs + work + c. Confirm that machine handles ua-contract architecture deltas for esm and remains attached/enabled + +``` +export UA_CONTRACT_TOKEN= +export ARCHIVE_URL=http://archive.ubuntu.com/ubuntu + +echo -- BEGIN test 1a: enable esm via "ubuntu-advantage attach " on typical trusty-updates cloud-images which already have -updates installed + +# Launch a basic trusty cloud-image that is updated to latest ubuntu-advantage-tools from -updates +cat > update-uat-trusty.yaml < fake_contract_delta.sh << EOF +#!/bin/bash +echo "Introduce a fake architecture delta by modifying the cache machine token" +sed -i 's/"i386", "ppc64le",/"i386",/' /var/lib/ubuntu-advantage/private/machine-token.json +sed -i 's/"i386", "ppc64le",/"i386",/' /var/lib/ubuntu-advantage/private/machine-access-esm-infra.json +EOF + + +lxc launch ubuntu-daily:trusty esm-sru-1a -c user.user-data="$(cat update-uat-trusty.yaml)" + +echo "Wait for cloud-init to finish startup on trusty" +RUNLEVEL="NOTSET" +while ! [ "N 2" = "$RUNLEVEL" ]; do echo -n '.'; sleep 1; RUNLEVEL=`lxc exec esm-sru-1a runlevel`; done; echo + +echo "Confirm u-a-t is already installed" +lxc exec esm-sru-1a -- apt-cache policy ubuntu-advantage-tools + +cat > ppa-key << EOF +-----BEGIN PGP PUBLIC KEY BLOCK----- + +xo0EUs00cgEEAJJqaPue5gzQiLB1krT9slYbqVW/bSBpW9+qX8gFI44IVM/Bo3yh +9BPAs1RAzja96N0FS6SNlew4JYfk7MBT2sFDGpm3bTKt9Go7muO0JkvKv0vYgrrw +qORlWK3SfsYa6EpsCdVzZPAKvGzc8I0XywVgcJhM5okx+3J2naBaSp9NABEBAAHN +K0xhdW5jaHBhZCBQUEEgZm9yIENJIFRyYWluIFBQQSBTZXJ2aWNlIFRlYW3CuAQT +AQIAIgUCUs00cgIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQhVBBKOzx +IEy62gP/T2h98ongV+RXekM1DpgTNoH0PBHrZVj4zfrvrYKZOaxRmJ6TWtzG8tFI +uB4gPjaFeenJBhCFaZ9UncFQemS9jztQ/pA049L1N7Tijd8/BKD7gc7tM07+Fq+Q +6DT7VuUFiVlfZUwWYzk5UXEk6ctluoIRpnRWUHmh6NssuAgd1Nk= +=aPbC +-----END PGP PUBLIC KEY BLOCK----- +EOF + +# emit script to upgrade u-a-t +cat > add_uat_apt_pocket.sh << EOF +#/bin/bash +pocket_name=\$1 +if [ "\$pocket_name" = "devel" ]; then + echo deb [trusted=yes] http://ppa.launchpad.net/ci-train-ppa-service/3830/ubuntu trusty main | tee /etc/apt/sources.list.d/\$pocket_name.list + apt-key add /ppa-key +else + echo deb $ARCHIVE_URL \$pocket_name main | tee /etc/apt/sources.list.d/\$pocket_name.list +fi +EOF + +lxc file push ppa-key esm-sru-1a/ +lxc file push add_uat_apt_pocket.sh esm-sru-1a/ +lxc file push fake_contract_delta.sh esm-sru-1a/ +lxc exec esm-sru-1a chmod 755 /add_uat_apt_pocket.sh +lxc exec esm-sru-1a chmod 755 /fake_contract_delta.sh + +echo "Enable esm via ubuntu-advantage enable-esm" +lxc exec esm-sru-1a -- ubuntu-advantage attach $UA_CONTRACT_TOKEN + +echo "Confirm python-jinja2 is available for esm PPA" +lxc exec esm-sru-1a apt-cache policy python-jinja2 + +echo -- BEGIN test 1a: Confirm upgraded attached machine remains attached and esm enabled +echo "Upgrade u-a-t to trusty-proposed" +lxc exec esm-sru-1a /add_uat_apt_pocket.sh trusty-proposed # or devel +lxc exec esm-sru-1a -- apt-get update -q; +lxc exec esm-sru-1a -- apt-get install -qy ubuntu-advantage-tools; + +echo "Confirm python-jinja2 is available for esm PPA" +lxc exec esm-sru-1a apt-cache policy python-jinja2 + +lxc exec esm-sru-1a apt-get install python-jinja2 + +echo -- BEGIN test 1c: Confirm ua-contract architecture deltas don't unattach/disable esm on supported platforms +lxc exec esm-sru-1a /echo -- BEGIN test 1c: Confirm ua-contract architecture deltas do not unattach/disable esm on supported platforms +lxc exec esm-sru-1a /fake_contract_delta.sh +lxc exec esm-sru-1a ua refresh +lxc exec esm-sru-1a ua status + +``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/1851858/esm-trusty-test-2.md ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/1851858/esm-trusty-test-2.md --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/1851858/esm-trusty-test-2.md 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/1851858/esm-trusty-test-2.md 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,121 @@ +# Test case 2: Start from **pp64le** cloud-image on canonistack with u-a-t installed and esm attached, upgrade to -proposed and test architecture deltas + +2. + a. Start with a fresh Ubuntu **non-x86** instance which does have u-a-t installed. Enable esm with 'ubuntu-advantage attach'. Upgrade to u-a-t from -proposed. + b. Confirm that machine remains attached, esm gets **disabled**, and status remains **disabled**. + c. Update machine token files to represent delta in architectures from contract server. Ensure `ua refresh` retains attached, but esm status becomes **n/a** + +``` +#!/bin/bash +set -xe +NOVARC=.canonistack/csmith.novarc +source $NOVARC + +export UA_CONTRACT_TOKEN= +export ARCHIVE_URL=http://archive.ubuntu.com/ubuntu + +# Assume only 1 keypair registered +export SSH_KEY=`openstack keypair list -f json | jq -r '.[0].Name'` +export LP_USER= + +echo -- BEGIN test 2a: enable esm via "ubuntu-advantage attach " on typical trusty-updates cloud-images which already have -updates installed + +# Launch a basic trusty cloud-image that is updated to latest ubuntu-advantage-tools from -updates +cat > update-uat-trusty.yaml < images-ppc64le.json +fi + +sshopts=( -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR ) + +cat > ppa-key << EOF +-----BEGIN PGP PUBLIC KEY BLOCK----- + +xo0EUs00cgEEAJJqaPue5gzQiLB1krT9slYbqVW/bSBpW9+qX8gFI44IVM/Bo3yh +9BPAs1RAzja96N0FS6SNlew4JYfk7MBT2sFDGpm3bTKt9Go7muO0JkvKv0vYgrrw +qORlWK3SfsYa6EpsCdVzZPAKvGzc8I0XywVgcJhM5okx+3J2naBaSp9NABEBAAHN +K0xhdW5jaHBhZCBQUEEgZm9yIENJIFRyYWluIFBQQSBTZXJ2aWNlIFRlYW3CuAQT +AQIAIgUCUs00cgIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQhVBBKOzx +IEy62gP/T2h98ongV+RXekM1DpgTNoH0PBHrZVj4zfrvrYKZOaxRmJ6TWtzG8tFI +uB4gPjaFeenJBhCFaZ9UncFQemS9jztQ/pA049L1N7Tijd8/BKD7gc7tM07+Fq+Q +6DT7VuUFiVlfZUwWYzk5UXEk6ctluoIRpnRWUHmh6NssuAgd1Nk= +=aPbC +-----END PGP PUBLIC KEY BLOCK----- +EOF + +cat > add_uat_apt_pocket.sh << EOF +#/bin/bash +pocket_name=\$1 +if [ "\$pocket_name" = "devel" ]; then + echo deb [trusted=yes] http://ppa.launchpad.net/ci-train-ppa-service/3839/ubuntu trusty main | tee /etc/apt/sources.list.d/\$pocket_name.list + apt-key add /ppa-key +else + echo deb $ARCHIVE_URL \$pocket_name main | tee /etc/apt/sources.list.d/\$pocket_name.list +fi +EOF + +cat > fake_contract_delta.sh << EOF +#!/bin/bash +echo "Introduce a fake architecture delta by modifying the cache machine token" +sed -i 's/"i386", "ppc64le",/"i386",/' /var/lib/ubuntu-advantage/private/machine-token.json +sed -i 's/"i386", "ppc64le",/"i386",/' /var/lib/ubuntu-advantage/private/machine-access-esm-infra.json +EOF + + +for series in trusty; do + echo "### BEGIN $series" + # Determine image, launch instance and attach IP address + image=$(cat images-ppc64le.json | jq -r '.[]|select((.Name|contains("disk1.img")) and (.Name|contains("'$series'"))) | .ID' | tail -n 1) + openstack server create --flavor cpu1-ram2-disk20 --image $image --key-name $SSH_KEY --user-data update-uat-trusty.yaml test-$series --wait + sleep 10 + VM_IP=`openstack server show test-trusty -f json | jq -r '.addresses' | awk -F '=' '{print $NF}'` + echo "Wait for cloud-init to finish startup on trusty: $VM_IP" + RUNLEVEL="NOTSET" + while ! [ "N 2" = "$RUNLEVEL" ]; do echo -n '.'; sleep 5; RUNLEVEL=`ssh "${sshopts[@]}" ubuntu@$VM_IP runlevel`; done; echo + + echo "Confirm u-a-t is already installed" + ssh "${sshopts[@]}" ubuntu@$VM_IP -- apt-cache policy ubuntu-advantage-tools + + +# emit script to upgrade u-a-t + scp "${sshopts[@]}" ppa-key ubuntu@$VM_IP:. + scp "${sshopts[@]}" add_uat_apt_pocket.sh ubuntu@$VM_IP:. + scp "${sshopts[@]}" fake_contract_delta.sh ubuntu@$VM_IP:. + ssh "${sshopts[@]}" ubuntu@$VM_IP chmod 755 ./add_uat_apt_pocket.sh + ssh "${sshopts[@]}" ubuntu@$VM_IP chmod 755 ./fake_contract_delta.sh + echo "Enable esm via ubuntu-advantage enable-esm" + ssh "${sshopts[@]}" ubuntu@$VM_IP -- sudo ua attach $UA_CONTRACT_TOKEN + + echo "Confirm python-jinja2 is available for esm PPA" + ssh "${sshopts[@]}" ubuntu@$VM_IP apt-cache policy python-jinja2 + + echo "Upgrade u-a-t to trusty-proposed" + echo -- BEGIN test 2b: confirm machine stays attached, but esm is disabled after upgrade to -proposed + ssh "${sshopts[@]}" ubuntu@$VM_IP -- sudo ./add_uat_apt_pocket.sh trusty-proposed + ssh "${sshopts[@]}" ubuntu@$VM_IP -- sudo apt-get update; + ssh "${sshopts[@]}" ubuntu@$VM_IP -- sudo apt-get install -y ubuntu-advantage-tools; + + echo "Confirm status remains attached: non-root" + ssh "${sshopts[@]}" ubuntu@$VM_IP ua status; + echo "Confirm status remains attached: root" + ssh "${sshopts[@]}" ubuntu@$VM_IP sudo ua status; + + echo "Confirm python-jinja2 is available for esm PPA" + ssh "${sshopts[@]}" ubuntu@$VM_IP apt-cache policy python-jinja2 + ssh "${sshopts[@]}" ubuntu@$VM_IP sudo apt-get install python-jinja2 + echo "Test 2c: Confirm deltas in architectures don't break ua client" + ssh "${sshopts[@]}" ubuntu@$VM_IP sudo apt-get install python-jinja2 + ssh "${sshopts[@]}" ubuntu@$VM_IP sudo ./fake_contract_delta.sh + ssh "${sshopts[@]}" ubuntu@$VM_IP sudo ua refresh + ssh "${sshopts[@]}" ubuntu@$VM_IP sudo ua status +done +``` diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-25/trusty-hwe-livepatch.txt ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-25/trusty-hwe-livepatch.txt --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-25/trusty-hwe-livepatch.txt 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-25/trusty-hwe-livepatch.txt 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,1787 @@ +=== Begin SRU Template === +[Impact] +Livepatch can only be enabled on a trusty machine if the kernel version is the hwe one. Therefore, +we must verify that once a Trusty machine has this kernel version running, Livepatch can be enabled +and used. + +[Test Case] +``` +#!/bin/sh +set -x +# Manually deploy on a trusty lxc vm +CONTRACT_TOKEN=TOKEN +series=trusty +name=$series-uac + +cat > install_hwe_kernel.sh << EOF +sudo apt-get -yq install --install-recommends linux-generic-lts-xenial xserver-xorg-core-lts-xenial xserver-xorg-lts-xenial xserver-xorg-video-all-lts-xenial xserver-xorg-input-all-lts-xenial libwayland-egl1-mesa-lts-xenial +EOF + +cat > install_uac_from_master.sh << EOF + sudo apt-get -yq install git make + git clone https://github.com/canonical/ubuntu-advantage-client.git /tmp/uac + cd /tmp/uac/ + sudo make deps + sudo dpkg-buildpackage -us -uc +EOF + +create_base_vm() { + multipass delete $name + multipass purge + multipass launch $series --name $name +} + +install_hwe_kernel() { + multipass transfer install_hwe_kernel.sh $name:/tmp/ + multipass exec $name bash /tmp/install_hwe_kernel.sh + multipass restart $name + sleep 20 + + kernel_version=$(multipass exec $name -- uname -r) + + if [[ "$kernel_version" == 4.4.0* ]] ; then + echo "SUCCESS: kernel was successfully updated to HWE: $kernel_version" + else + echo "FAILURE: kernel was not updated to HWE: $kernel_version" + fi +} + +update_uaclient() { + name_build=$series-uac-build + pkg_name=ubuntu-advantage-tools_25.0_amd64.deb + multipass launch $series --name $name_build + multipass transfer install_uac_from_master.sh $name_build:/tmp/ + multipass exec $name_build bash /tmp/install_uac_from_master.sh + multipass transfer $name_build:/tmp/$pkg_name /tmp/ + multipass transfer /tmp/$pkg_name $name:/tmp/ + multipass exec $name -- sudo apt-get remove ubuntu-advantage-tools --assume-yes + multipass exec $name -- sudo dpkg -i /tmp/$pkg_name + + uac_version=$(multipass exec $name -- ua version) + + if [[ "$uac_version" == 25.0* ]] ; then + echo "SUCCESS: uaclient was successfully updated to: $uac_version" + else + echo "FAILURE: uaclient was not updated" + fi + + multipass delete $name_build + multipass purge +} + +check_livepatch_is_not_installed() { + multipass exec $name -- which canonical-livepatch + return_code=$(multipass exec $name -- echo $?) + + if [ "$return_code" = "1" ] ; then + echo "SUCESS: canonical-livepatch is not found before enabling it" + else + echo "FAILURE: canonical-livepatch was found before enabling it" + fi +} + +attach_token_in_uaclient() { + multipass exec $name -- sudo ua attach $CONTRACT_TOKEN +} + +enable_livepatch() { + multipass exec $name -- sudo ua enable livepatch +} + +check_livepatch() { + return_str=$(multipass exec $name -- sudo canonical-livepatch status | grep running) + expected_str=" running: true" + + if [ "$return_str" = "$expected_str" ]; then + echo "SUCCESS: livepatch was enabled and is running" + else + echo "FAILURE: livepatch is not running" + fi +} + + +create_base_vm +install_hwe_kernel +update_uaclient +check_livepatch_is_not_installed +attach_token_in_uaclient +enable_livepatch +check_livepatch +``` + +=== Verification Log === + ++ CONTRACT_TOKEN= ++ series=trusty ++ name=trusty-uac ++ cat ++ cat ++ create_base_vm ++ multipass delete trusty-uac ++ multipass purge ++ multipass launch trusty --name trusty-uac ++ multipass transfer install_hwe_kernel.sh trusty-uac:/tmp/ ++ multipass exec trusty-uac bash /tmp/install_hwe_kernel.sh +Reading package lists... +Building dependency tree... +Reading state information... +The following extra packages will be installed: + amd64-microcode crda intel-microcode iucode-tool iw libdrm-amdgpu1 + libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libegl1-mesa-lts-xenial + libepoxy0 libevdev2 libfontenc1 libgbm1-lts-xenial + libgl1-mesa-dri-lts-xenial libgl1-mesa-glx-lts-xenial + libglapi-mesa-lts-xenial libgles1-mesa-lts-xenial libgles2-mesa-lts-xenial + libice6 libllvm3.8v4 libmtdev1 libnl-3-200 libnl-genl-3-200 libpciaccess0 + libpixman-1-0 libsm6 libtxc-dxtn-s2tc0 libwayland-client0 libwayland-server0 + libx11-xcb1 libxatracker2-lts-xenial libxaw7 libxcb-dri2-0 libxcb-dri3-0 + libxcb-glx0 libxcb-present0 libxcb-sync1 libxcb-util0 libxcb-xfixes0 + libxcursor1 libxdamage1 libxfixes3 libxfont1 libxi6 libxinerama1 libxkbfile1 + libxmu6 libxpm4 libxrandr2 libxrender1 libxshmfence1 libxss1 libxt6 libxtst6 + libxv1 libxvmc1 libxxf86vm1 linux-firmware linux-headers-4.4.0-148 + linux-headers-4.4.0-148-generic linux-headers-generic-lts-xenial + linux-image-4.4.0-148-generic linux-image-generic-lts-xenial + linux-modules-4.4.0-148-generic linux-modules-extra-4.4.0-148-generic + thermald wireless-regdb x11-common x11-xkb-utils xfonts-base + xfonts-encodings xfonts-utils xserver-common + xserver-xorg-input-evdev-lts-xenial xserver-xorg-input-synaptics-lts-xenial + xserver-xorg-input-vmmouse-lts-xenial xserver-xorg-input-wacom-lts-xenial + xserver-xorg-video-amdgpu-lts-xenial xserver-xorg-video-ati-lts-xenial + xserver-xorg-video-cirrus-lts-xenial xserver-xorg-video-fbdev-lts-xenial + xserver-xorg-video-intel-lts-xenial xserver-xorg-video-mach64-lts-xenial + xserver-xorg-video-mga-lts-xenial xserver-xorg-video-neomagic-lts-xenial + xserver-xorg-video-nouveau-lts-xenial + xserver-xorg-video-openchrome-lts-xenial xserver-xorg-video-qxl-lts-xenial + xserver-xorg-video-r128-lts-xenial xserver-xorg-video-radeon-lts-xenial + xserver-xorg-video-savage-lts-xenial + xserver-xorg-video-siliconmotion-lts-xenial + xserver-xorg-video-sisusb-lts-xenial xserver-xorg-video-tdfx-lts-xenial + xserver-xorg-video-trident-lts-xenial xserver-xorg-video-vesa-lts-xenial + xserver-xorg-video-vmware-lts-xenial +Suggested packages: + fdutils linux-lts-xenial-doc-4.4.0 linux-lts-xenial-source-4.4.0 + linux-lts-xenial-tools xfs xserver xfonts-100dpi xfonts-75dpi + xfonts-scalable gpointing-device-settings touchfreeze xinput + firmware-amd-graphics firmware-linux +Recommended packages: + xserver-xorg-video-modesetting +The following NEW packages will be installed: + amd64-microcode crda intel-microcode iucode-tool iw libdrm-amdgpu1 + libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libegl1-mesa-lts-xenial + libepoxy0 libevdev2 libfontenc1 libgbm1-lts-xenial + libgl1-mesa-dri-lts-xenial libgl1-mesa-glx-lts-xenial + libglapi-mesa-lts-xenial libgles1-mesa-lts-xenial libgles2-mesa-lts-xenial + libice6 libllvm3.8v4 libmtdev1 libnl-3-200 libnl-genl-3-200 libpciaccess0 + libpixman-1-0 libsm6 libtxc-dxtn-s2tc0 libwayland-client0 + libwayland-egl1-mesa-lts-xenial libwayland-server0 libx11-xcb1 + libxatracker2-lts-xenial libxaw7 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 + libxcb-present0 libxcb-sync1 libxcb-util0 libxcb-xfixes0 libxcursor1 + libxdamage1 libxfixes3 libxfont1 libxi6 libxinerama1 libxkbfile1 libxmu6 + libxpm4 libxrandr2 libxrender1 libxshmfence1 libxss1 libxt6 libxtst6 libxv1 + libxvmc1 libxxf86vm1 linux-firmware linux-generic-lts-xenial + linux-headers-4.4.0-148 linux-headers-4.4.0-148-generic + linux-headers-generic-lts-xenial linux-image-4.4.0-148-generic + linux-image-generic-lts-xenial linux-modules-4.4.0-148-generic + linux-modules-extra-4.4.0-148-generic thermald wireless-regdb x11-common + x11-xkb-utils xfonts-base xfonts-encodings xfonts-utils xserver-common + xserver-xorg-core-lts-xenial xserver-xorg-input-all-lts-xenial + xserver-xorg-input-evdev-lts-xenial xserver-xorg-input-synaptics-lts-xenial + xserver-xorg-input-vmmouse-lts-xenial xserver-xorg-input-wacom-lts-xenial + xserver-xorg-lts-xenial xserver-xorg-video-all-lts-xenial + xserver-xorg-video-amdgpu-lts-xenial xserver-xorg-video-ati-lts-xenial + xserver-xorg-video-cirrus-lts-xenial xserver-xorg-video-fbdev-lts-xenial + xserver-xorg-video-intel-lts-xenial xserver-xorg-video-mach64-lts-xenial + xserver-xorg-video-mga-lts-xenial xserver-xorg-video-neomagic-lts-xenial + xserver-xorg-video-nouveau-lts-xenial + xserver-xorg-video-openchrome-lts-xenial xserver-xorg-video-qxl-lts-xenial + xserver-xorg-video-r128-lts-xenial xserver-xorg-video-radeon-lts-xenial + xserver-xorg-video-savage-lts-xenial + xserver-xorg-video-siliconmotion-lts-xenial + xserver-xorg-video-sisusb-lts-xenial xserver-xorg-video-tdfx-lts-xenial + xserver-xorg-video-trident-lts-xenial xserver-xorg-video-vesa-lts-xenial + xserver-xorg-video-vmware-lts-xenial +0 upgraded, 104 newly installed, 0 to remove and 0 not upgraded. +Need to get 129 MB of archives. +After this operation, 530 MB of additional disk space will be used. +Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libdrm-amdgpu1 amd64 2.4.67-1ubuntu0.14.04.2 [16.4 kB] +Get:2 http://archive.ubuntu.com/ubuntu/ trusty/main libpciaccess0 amd64 0.13.2-1 [20.4 kB] +Get:3 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libdrm-intel1 amd64 2.4.67-1ubuntu0.14.04.2 [55.3 kB] +Get:4 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libdrm-nouveau2 amd64 2.4.67-1ubuntu0.14.04.2 [16.0 kB] +Get:5 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libdrm-radeon1 amd64 2.4.67-1ubuntu0.14.04.2 [21.2 kB] +Get:6 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libwayland-client0 amd64 1.4.0-1ubuntu1.1 [22.1 kB] +Get:7 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libwayland-server0 amd64 1.4.0-1ubuntu1.1 [26.9 kB] +Get:8 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgbm1-lts-xenial amd64 11.2.0-1ubuntu2~trusty2 [24.3 kB] +Get:9 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libx11-xcb1 amd64 2:1.6.2-1ubuntu2.1 [9,350 B] +Get:10 http://archive.ubuntu.com/ubuntu/ trusty/main libxcb-dri2-0 amd64 1.10-2ubuntu1 [6,710 B] +Get:11 http://archive.ubuntu.com/ubuntu/ trusty/main libxcb-dri3-0 amd64 1.10-2ubuntu1 [5,118 B] +Get:12 http://archive.ubuntu.com/ubuntu/ trusty/main libxcb-present0 amd64 1.10-2ubuntu1 [5,254 B] +Get:13 http://archive.ubuntu.com/ubuntu/ trusty/main libxcb-sync1 amd64 1.10-2ubuntu1 [8,090 B] +Get:14 http://archive.ubuntu.com/ubuntu/ trusty/main libxcb-xfixes0 amd64 1.10-2ubuntu1 [8,486 B] +Get:15 http://archive.ubuntu.com/ubuntu/ trusty/main libxshmfence1 amd64 1.1-2 [4,644 B] +Get:16 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libllvm3.8v4 amd64 1:3.8-2ubuntu3~trusty5 [9,724 kB] +Get:17 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgl1-mesa-dri-lts-xenial amd64 11.2.0-1ubuntu2~trusty2 [4,502 kB] +Get:18 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libegl1-mesa-lts-xenial amd64 11.2.0-1ubuntu2~trusty2 [69.0 kB] +Get:19 http://archive.ubuntu.com/ubuntu/ trusty/main libfontenc1 amd64 1:1.1.2-1 [15.6 kB] +Get:20 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libglapi-mesa-lts-xenial amd64 11.2.0-1ubuntu2~trusty2 [22.7 kB] +Get:21 http://archive.ubuntu.com/ubuntu/ trusty/main libxcb-glx0 amd64 1.10-2ubuntu1 [20.0 kB] +Get:22 http://archive.ubuntu.com/ubuntu/ trusty/main libxdamage1 amd64 1:1.1.4-1ubuntu1 [7,612 B] +Get:23 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libxfixes3 amd64 1:5.0.1-1ubuntu1.1 [10.4 kB] +Get:24 http://archive.ubuntu.com/ubuntu/ trusty/main libxxf86vm1 amd64 1:1.1.3-1 [11.7 kB] +Get:25 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgl1-mesa-glx-lts-xenial amd64 11.2.0-1ubuntu2~trusty2 [123 kB] +Get:26 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgles1-mesa-lts-xenial amd64 11.2.0-1ubuntu2~trusty2 [8,946 B] +Get:27 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgles2-mesa-lts-xenial amd64 11.2.0-1ubuntu2~trusty2 [11.8 kB] +Get:28 http://archive.ubuntu.com/ubuntu/ trusty-updates/main x11-common all 1:7.7+1ubuntu8.1 [49.5 kB] +Get:29 http://archive.ubuntu.com/ubuntu/ trusty/main libice6 amd64 2:1.0.8-2 [47.0 kB] +Get:30 http://archive.ubuntu.com/ubuntu/ trusty/main libmtdev1 amd64 1.1.4-1ubuntu1 [15.3 kB] +Get:31 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libnl-3-200 amd64 3.2.21-1ubuntu4.1 [45.3 kB] +Get:32 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libnl-genl-3-200 amd64 3.2.21-1ubuntu4.1 [10.2 kB] +Get:33 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libpixman-1-0 amd64 0.30.2-2ubuntu1.2 [226 kB] +Get:34 http://archive.ubuntu.com/ubuntu/ trusty/main libsm6 amd64 2:1.2.1-2 [18.1 kB] +Get:35 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libwayland-egl1-mesa-lts-xenial amd64 11.2.0-1ubuntu2~trusty2 [5,932 B] +Get:36 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libxatracker2-lts-xenial amd64 11.2.0-1ubuntu2~trusty2 [981 kB] +Get:37 http://archive.ubuntu.com/ubuntu/ trusty/main libxt6 amd64 1:1.1.4-1 [185 kB] +Get:38 http://archive.ubuntu.com/ubuntu/ trusty/main libxmu6 amd64 2:1.1.1-1 [53.8 kB] +Get:39 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libxpm4 amd64 1:3.5.10-1ubuntu0.1 [33.2 kB] +Get:40 http://archive.ubuntu.com/ubuntu/ trusty/main libxaw7 amd64 2:1.0.12-1 [168 kB] +Get:41 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libxrender1 amd64 1:0.9.8-1build0.14.04.1 [17.9 kB] +Get:42 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libxcursor1 amd64 1:1.1.14-1ubuntu0.14.04.2 [19.8 kB] +Get:43 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libxfont1 amd64 1:1.4.7-1ubuntu0.4 [95.1 kB] +Get:44 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libxi6 amd64 2:1.7.1.901-1ubuntu1.1 [27.9 kB] +Get:45 http://archive.ubuntu.com/ubuntu/ trusty/main libxinerama1 amd64 2:1.1.3-1 [7,908 B] +Get:46 http://archive.ubuntu.com/ubuntu/ trusty/main libxkbfile1 amd64 1:1.0.8-1 [74.2 kB] +Get:47 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libxrandr2 amd64 2:1.5.0-1~trusty1 [17.5 kB] +Get:48 http://archive.ubuntu.com/ubuntu/ trusty/main libxss1 amd64 1:1.2.2-1 [8,582 B] +Get:49 http://archive.ubuntu.com/ubuntu/ trusty/main libxtst6 amd64 2:1.2.2-1 [14.1 kB] +Get:50 http://archive.ubuntu.com/ubuntu/ trusty/main libxv1 amd64 2:1.0.10-1 [10.3 kB] +Get:51 http://archive.ubuntu.com/ubuntu/ trusty/main libxvmc1 amd64 2:1.0.8-1ubuntu1 [15.6 kB] +Get:52 http://archive.ubuntu.com/ubuntu/ trusty/universe libevdev2 amd64 1.0.99.2+dfsg-2ubuntu2 [25.8 kB] +Get:53 http://archive.ubuntu.com/ubuntu/ trusty/main libtxc-dxtn-s2tc0 amd64 0~git20131104-1.1 [51.8 kB] +Get:54 http://archive.ubuntu.com/ubuntu/ trusty/main libxcb-util0 amd64 0.3.8-2ubuntu1 [11.5 kB] +Get:55 http://archive.ubuntu.com/ubuntu/ trusty/main wireless-regdb all 2013.02.13-1ubuntu1 [6,456 B] +Get:56 http://archive.ubuntu.com/ubuntu/ trusty/main crda amd64 1.1.2-1ubuntu2 [15.2 kB] +Get:57 http://archive.ubuntu.com/ubuntu/ trusty/multiverse iucode-tool amd64 1.0.1-1 [28.1 kB] +Get:58 http://archive.ubuntu.com/ubuntu/ trusty/main iw amd64 3.4-1 [51.7 kB] +Get:59 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libepoxy0 amd64 1.1-1build1 [157 kB] +Get:60 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-firmware all 1.127.24 [33.9 MB] +Get:61 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-modules-4.4.0-148-generic amd64 4.4.0-148.174~14.04.1 [11.2 MB] +Get:62 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-image-4.4.0-148-generic amd64 4.4.0-148.174~14.04.1 [6,827 kB] +Get:63 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-modules-extra-4.4.0-148-generic amd64 4.4.0-148.174~14.04.1 [36.2 MB] +Get:64 http://archive.ubuntu.com/ubuntu/ trusty-updates/main intel-microcode amd64 3.20190618.0ubuntu0.14.04.1 [1,924 kB] +Get:65 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64-microcode amd64 3.20180524.1~ubuntu0.14.04.2+really20130710.1ubuntu1 [26.3 kB] +Get:66 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-image-generic-lts-xenial amd64 4.4.0.148.130 [2,792 B] +Get:67 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-headers-4.4.0-148 all 4.4.0-148.174~14.04.1 [10.1 MB] +Get:68 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-headers-4.4.0-148-generic amd64 4.4.0-148.174~14.04.1 [824 kB] +Get:69 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-headers-generic-lts-xenial amd64 4.4.0.148.130 [2,628 B] +Get:70 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-generic-lts-xenial amd64 4.4.0.148.130 [1,804 B] +Get:71 http://archive.ubuntu.com/ubuntu/ trusty-updates/main thermald amd64 1.4.3-5~14.04.4 [202 kB] +Get:72 http://archive.ubuntu.com/ubuntu/ trusty/main x11-xkb-utils amd64 7.7+1 [156 kB] +Get:73 http://archive.ubuntu.com/ubuntu/ trusty/main xfonts-encodings all 1:1.0.4-1ubuntu1 [583 kB] +Get:74 http://archive.ubuntu.com/ubuntu/ trusty/main xfonts-utils amd64 1:7.7+1 [73.9 kB] +Get:75 http://archive.ubuntu.com/ubuntu/ trusty/main xfonts-base all 1:1.0.3 [6,180 kB] +Get:76 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-common all 2:1.15.1-0ubuntu2.11 [28.7 kB] +Get:77 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-core-lts-xenial amd64 2:1.18.3-1ubuntu2.3~trusty4 [1,297 kB] +Get:78 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-input-evdev-lts-xenial amd64 1:2.10.1-1ubuntu2~trusty1 [30.9 kB] +Get:79 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-input-synaptics-lts-xenial amd64 1.8.2-1ubuntu3~trusty1 [62.2 kB] +Get:80 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-input-vmmouse-lts-xenial amd64 1:13.1.0-1ubuntu2~trusty1 [14.2 kB] +Get:81 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-input-wacom-lts-xenial amd64 1:0.32.0-0ubuntu3~trusty1 [83.3 kB] +Get:82 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-input-all-lts-xenial amd64 1:7.7+13ubuntu3~trusty2 [4,354 B] +Get:83 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-lts-xenial amd64 1:7.7+13ubuntu3~trusty2 [4,908 B] +Get:84 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-amdgpu-lts-xenial amd64 1.1.0-1~trusty1 [50.4 kB] +Get:85 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-radeon-lts-xenial amd64 1:7.7.0-1~trusty2 [134 kB] +Get:86 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-r128-lts-xenial amd64 6.10.0-1build2~trusty1 [47.1 kB] +Get:87 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-mach64-lts-xenial amd64 6.9.5-1build2~trusty1 [57.3 kB] +Get:88 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-ati-lts-xenial amd64 1:7.7.0-1~trusty2 [6,846 B] +Get:89 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-fbdev-lts-xenial amd64 1:0.4.4-1build5~trusty1 [11.6 kB] +Get:90 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-nouveau-lts-xenial amd64 1:1.0.12-1build2~trusty1 [83.0 kB] +Get:91 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-vesa-lts-xenial amd64 1:2.3.4-1build2~trusty1 [14.5 kB] +Get:92 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-vmware-lts-xenial amd64 1:13.1.0-2ubuntu3~trusty1 [65.7 kB] +Get:93 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-cirrus-lts-xenial amd64 1:1.5.3-1ubuntu3~trusty1 [28.0 kB] +Get:94 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-mga-lts-xenial amd64 1:1.6.4-1build2~trusty1 [56.3 kB] +Get:95 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-neomagic-lts-xenial amd64 1:1.2.9-1build2~trusty1 [28.9 kB] +Get:96 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-openchrome-lts-xenial amd64 1:0.3.3+git20160310-1~trusty1 [138 kB] +Get:97 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-savage-lts-xenial amd64 1:2.3.8-1ubuntu3~trusty1 [59.5 kB] +Get:98 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-siliconmotion-lts-xenial amd64 1:1.7.8-1ubuntu6~trusty1 [47.6 kB] +Get:99 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-sisusb-lts-xenial amd64 1:0.9.6-2build5~trusty1 [36.0 kB] +Get:100 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-tdfx-lts-xenial amd64 1:1.4.6-1build2~trusty1 [28.8 kB] +Get:101 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-trident-lts-xenial amd64 1:1.3.7-1build2~trusty1 [53.3 kB] +Get:102 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-all-lts-xenial amd64 1:7.7+13ubuntu3~trusty2 [4,450 B] +Get:103 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-intel-lts-xenial amd64 2:2.99.917+git20160325-1ubuntu1~trusty1 [688 kB] +Get:104 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-qxl-lts-xenial amd64 0.1.4-3ubuntu3~trusty1 [77.8 kB] +debconf: unable to initialize frontend: Dialog +debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.) +debconf: falling back to frontend: Readline +debconf: unable to initialize frontend: Readline +debconf: (This frontend requires a controlling tty.) +debconf: falling back to frontend: Teletype +dpkg-preconfigure: unable to re-open stdin: +Fetched 129 MB in 3min 5s (693 kB/s) +Selecting previously unselected package libdrm-amdgpu1:amd64. +(Reading database ... 51418 files and directories currently installed.) +Preparing to unpack .../libdrm-amdgpu1_2.4.67-1ubuntu0.14.04.2_amd64.deb ... +Unpacking libdrm-amdgpu1:amd64 (2.4.67-1ubuntu0.14.04.2) ... +Selecting previously unselected package libpciaccess0:amd64. +Preparing to unpack .../libpciaccess0_0.13.2-1_amd64.deb ... +Unpacking libpciaccess0:amd64 (0.13.2-1) ... +Selecting previously unselected package libdrm-intel1:amd64. +Preparing to unpack .../libdrm-intel1_2.4.67-1ubuntu0.14.04.2_amd64.deb ... +Unpacking libdrm-intel1:amd64 (2.4.67-1ubuntu0.14.04.2) ... +Selecting previously unselected package libdrm-nouveau2:amd64. +Preparing to unpack .../libdrm-nouveau2_2.4.67-1ubuntu0.14.04.2_amd64.deb ... +Unpacking libdrm-nouveau2:amd64 (2.4.67-1ubuntu0.14.04.2) ... +Selecting previously unselected package libdrm-radeon1:amd64. +Preparing to unpack .../libdrm-radeon1_2.4.67-1ubuntu0.14.04.2_amd64.deb ... +Unpacking libdrm-radeon1:amd64 (2.4.67-1ubuntu0.14.04.2) ... +Selecting previously unselected package libwayland-client0:amd64. +Preparing to unpack .../libwayland-client0_1.4.0-1ubuntu1.1_amd64.deb ... +Unpacking libwayland-client0:amd64 (1.4.0-1ubuntu1.1) ... +Selecting previously unselected package libwayland-server0:amd64. +Preparing to unpack .../libwayland-server0_1.4.0-1ubuntu1.1_amd64.deb ... +Unpacking libwayland-server0:amd64 (1.4.0-1ubuntu1.1) ... +Selecting previously unselected package libgbm1-lts-xenial:amd64. +Preparing to unpack .../libgbm1-lts-xenial_11.2.0-1ubuntu2~trusty2_amd64.deb ... +Adding 'diversion of /usr/lib/x86_64-linux-gnu/libgbm.so.1.0.0 to /usr/lib/x86_64-linux-gnu/old.libgbm.so.1.0.0 by libgbm1-lts-xenial' +Adding 'diversion of /usr/lib/x86_64-linux-gnu/libgbm.so.1 to /usr/lib/x86_64-linux-gnu/old.libgbm.so.1 by libgbm1-lts-xenial' +Adding 'diversion of /usr/lib/x86_64-linux-gnu/gbm/gbm_gallium_drm.so to /usr/lib/x86_64-linux-gnu/gbm/old.gbm_gallium_drm.so by libgbm1-lts-xenial' +Unpacking libgbm1-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... +Selecting previously unselected package libx11-xcb1:amd64. +Preparing to unpack .../libx11-xcb1_2%3a1.6.2-1ubuntu2.1_amd64.deb ... +Unpacking libx11-xcb1:amd64 (2:1.6.2-1ubuntu2.1) ... +Selecting previously unselected package libxcb-dri2-0:amd64. +Preparing to unpack .../libxcb-dri2-0_1.10-2ubuntu1_amd64.deb ... +Unpacking libxcb-dri2-0:amd64 (1.10-2ubuntu1) ... +Selecting previously unselected package libxcb-dri3-0:amd64. +Preparing to unpack .../libxcb-dri3-0_1.10-2ubuntu1_amd64.deb ... +Unpacking libxcb-dri3-0:amd64 (1.10-2ubuntu1) ... +Selecting previously unselected package libxcb-present0:amd64. +Preparing to unpack .../libxcb-present0_1.10-2ubuntu1_amd64.deb ... +Unpacking libxcb-present0:amd64 (1.10-2ubuntu1) ... +Selecting previously unselected package libxcb-sync1:amd64. +Preparing to unpack .../libxcb-sync1_1.10-2ubuntu1_amd64.deb ... +Unpacking libxcb-sync1:amd64 (1.10-2ubuntu1) ... +Selecting previously unselected package libxcb-xfixes0:amd64. +Preparing to unpack .../libxcb-xfixes0_1.10-2ubuntu1_amd64.deb ... +Unpacking libxcb-xfixes0:amd64 (1.10-2ubuntu1) ... +Selecting previously unselected package libxshmfence1:amd64. +Preparing to unpack .../libxshmfence1_1.1-2_amd64.deb ... +Unpacking libxshmfence1:amd64 (1.1-2) ... +Selecting previously unselected package libllvm3.8v4:amd64. +Preparing to unpack .../libllvm3.8v4_1%3a3.8-2ubuntu3~trusty5_amd64.deb ... +Unpacking libllvm3.8v4:amd64 (1:3.8-2ubuntu3~trusty5) ... +Selecting previously unselected package libgl1-mesa-dri-lts-xenial:amd64. +Preparing to unpack .../libgl1-mesa-dri-lts-xenial_11.2.0-1ubuntu2~trusty2_amd64.deb ... +Unpacking libgl1-mesa-dri-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... +Selecting previously unselected package libegl1-mesa-lts-xenial:amd64. +Preparing to unpack .../libegl1-mesa-lts-xenial_11.2.0-1ubuntu2~trusty2_amd64.deb ... +Unpacking libegl1-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... +Selecting previously unselected package libfontenc1:amd64. +Preparing to unpack .../libfontenc1_1%3a1.1.2-1_amd64.deb ... +Unpacking libfontenc1:amd64 (1:1.1.2-1) ... +Selecting previously unselected package libglapi-mesa-lts-xenial:amd64. +Preparing to unpack .../libglapi-mesa-lts-xenial_11.2.0-1ubuntu2~trusty2_amd64.deb ... +Unpacking libglapi-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... +Selecting previously unselected package libxcb-glx0:amd64. +Preparing to unpack .../libxcb-glx0_1.10-2ubuntu1_amd64.deb ... +Unpacking libxcb-glx0:amd64 (1.10-2ubuntu1) ... +Selecting previously unselected package libxdamage1:amd64. +Preparing to unpack .../libxdamage1_1%3a1.1.4-1ubuntu1_amd64.deb ... +Unpacking libxdamage1:amd64 (1:1.1.4-1ubuntu1) ... +Selecting previously unselected package libxfixes3:amd64. +Preparing to unpack .../libxfixes3_1%3a5.0.1-1ubuntu1.1_amd64.deb ... +Unpacking libxfixes3:amd64 (1:5.0.1-1ubuntu1.1) ... +Selecting previously unselected package libxxf86vm1:amd64. +Preparing to unpack .../libxxf86vm1_1%3a1.1.3-1_amd64.deb ... +Unpacking libxxf86vm1:amd64 (1:1.1.3-1) ... +Selecting previously unselected package libgl1-mesa-glx-lts-xenial:amd64. +Preparing to unpack .../libgl1-mesa-glx-lts-xenial_11.2.0-1ubuntu2~trusty2_amd64.deb ... +Unpacking libgl1-mesa-glx-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... +Selecting previously unselected package libgles1-mesa-lts-xenial:amd64. +Preparing to unpack .../libgles1-mesa-lts-xenial_11.2.0-1ubuntu2~trusty2_amd64.deb ... +Unpacking libgles1-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... +Selecting previously unselected package libgles2-mesa-lts-xenial:amd64. +Preparing to unpack .../libgles2-mesa-lts-xenial_11.2.0-1ubuntu2~trusty2_amd64.deb ... +Unpacking libgles2-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... +Selecting previously unselected package x11-common. +Preparing to unpack .../x11-common_1%3a7.7+1ubuntu8.1_all.deb ... +debconf: unable to initialize frontend: Dialog +debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.) +debconf: falling back to frontend: Readline +debconf: unable to initialize frontend: Readline +debconf: (This frontend requires a controlling tty.) +debconf: falling back to frontend: Teletype +Unpacking x11-common (1:7.7+1ubuntu8.1) ... +Selecting previously unselected package libice6:amd64. +Preparing to unpack .../libice6_2%3a1.0.8-2_amd64.deb ... +Unpacking libice6:amd64 (2:1.0.8-2) ... +Selecting previously unselected package libmtdev1:amd64. +Preparing to unpack .../libmtdev1_1.1.4-1ubuntu1_amd64.deb ... +Unpacking libmtdev1:amd64 (1.1.4-1ubuntu1) ... +Selecting previously unselected package libnl-3-200:amd64. +Preparing to unpack .../libnl-3-200_3.2.21-1ubuntu4.1_amd64.deb ... +Unpacking libnl-3-200:amd64 (3.2.21-1ubuntu4.1) ... +Selecting previously unselected package libnl-genl-3-200:amd64. +Preparing to unpack .../libnl-genl-3-200_3.2.21-1ubuntu4.1_amd64.deb ... +Unpacking libnl-genl-3-200:amd64 (3.2.21-1ubuntu4.1) ... +Selecting previously unselected package libpixman-1-0:amd64. +Preparing to unpack .../libpixman-1-0_0.30.2-2ubuntu1.2_amd64.deb ... +Unpacking libpixman-1-0:amd64 (0.30.2-2ubuntu1.2) ... +Selecting previously unselected package libsm6:amd64. +Preparing to unpack .../libsm6_2%3a1.2.1-2_amd64.deb ... +Unpacking libsm6:amd64 (2:1.2.1-2) ... +Selecting previously unselected package libwayland-egl1-mesa-lts-xenial:amd64. +Preparing to unpack .../libwayland-egl1-mesa-lts-xenial_11.2.0-1ubuntu2~trusty2_amd64.deb ... +Unpacking libwayland-egl1-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... +Selecting previously unselected package libxatracker2-lts-xenial:amd64. +Preparing to unpack .../libxatracker2-lts-xenial_11.2.0-1ubuntu2~trusty2_amd64.deb ... +Unpacking libxatracker2-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... +Selecting previously unselected package libxt6:amd64. +Preparing to unpack .../libxt6_1%3a1.1.4-1_amd64.deb ... +Unpacking libxt6:amd64 (1:1.1.4-1) ... +Selecting previously unselected package libxmu6:amd64. +Preparing to unpack .../libxmu6_2%3a1.1.1-1_amd64.deb ... +Unpacking libxmu6:amd64 (2:1.1.1-1) ... +Selecting previously unselected package libxpm4:amd64. +Preparing to unpack .../libxpm4_1%3a3.5.10-1ubuntu0.1_amd64.deb ... +Unpacking libxpm4:amd64 (1:3.5.10-1ubuntu0.1) ... +Selecting previously unselected package libxaw7:amd64. +Preparing to unpack .../libxaw7_2%3a1.0.12-1_amd64.deb ... +Unpacking libxaw7:amd64 (2:1.0.12-1) ... +Selecting previously unselected package libxrender1:amd64. +Preparing to unpack .../libxrender1_1%3a0.9.8-1build0.14.04.1_amd64.deb ... +Unpacking libxrender1:amd64 (1:0.9.8-1build0.14.04.1) ... +Selecting previously unselected package libxcursor1:amd64. +Preparing to unpack .../libxcursor1_1%3a1.1.14-1ubuntu0.14.04.2_amd64.deb ... +Unpacking libxcursor1:amd64 (1:1.1.14-1ubuntu0.14.04.2) ... +Selecting previously unselected package libxfont1:amd64. +Preparing to unpack .../libxfont1_1%3a1.4.7-1ubuntu0.4_amd64.deb ... +Unpacking libxfont1:amd64 (1:1.4.7-1ubuntu0.4) ... +Selecting previously unselected package libxi6:amd64. +Preparing to unpack .../libxi6_2%3a1.7.1.901-1ubuntu1.1_amd64.deb ... +Unpacking libxi6:amd64 (2:1.7.1.901-1ubuntu1.1) ... +Selecting previously unselected package libxinerama1:amd64. +Preparing to unpack .../libxinerama1_2%3a1.1.3-1_amd64.deb ... +Unpacking libxinerama1:amd64 (2:1.1.3-1) ... +Selecting previously unselected package libxkbfile1:amd64. +Preparing to unpack .../libxkbfile1_1%3a1.0.8-1_amd64.deb ... +Unpacking libxkbfile1:amd64 (1:1.0.8-1) ... +Selecting previously unselected package libxrandr2:amd64. +Preparing to unpack .../libxrandr2_2%3a1.5.0-1~trusty1_amd64.deb ... +Unpacking libxrandr2:amd64 (2:1.5.0-1~trusty1) ... +Selecting previously unselected package libxss1:amd64. +Preparing to unpack .../libxss1_1%3a1.2.2-1_amd64.deb ... +Unpacking libxss1:amd64 (1:1.2.2-1) ... +Selecting previously unselected package libxtst6:amd64. +Preparing to unpack .../libxtst6_2%3a1.2.2-1_amd64.deb ... +Unpacking libxtst6:amd64 (2:1.2.2-1) ... +Selecting previously unselected package libxv1:amd64. +Preparing to unpack .../libxv1_2%3a1.0.10-1_amd64.deb ... +Unpacking libxv1:amd64 (2:1.0.10-1) ... +Selecting previously unselected package libxvmc1:amd64. +Preparing to unpack .../libxvmc1_2%3a1.0.8-1ubuntu1_amd64.deb ... +Unpacking libxvmc1:amd64 (2:1.0.8-1ubuntu1) ... +Selecting previously unselected package libevdev2. +Preparing to unpack .../libevdev2_1.0.99.2+dfsg-2ubuntu2_amd64.deb ... +Unpacking libevdev2 (1.0.99.2+dfsg-2ubuntu2) ... +Selecting previously unselected package libtxc-dxtn-s2tc0:amd64. +Preparing to unpack .../libtxc-dxtn-s2tc0_0~git20131104-1.1_amd64.deb ... +Unpacking libtxc-dxtn-s2tc0:amd64 (0~git20131104-1.1) ... +Selecting previously unselected package libxcb-util0:amd64. +Preparing to unpack .../libxcb-util0_0.3.8-2ubuntu1_amd64.deb ... +Unpacking libxcb-util0:amd64 (0.3.8-2ubuntu1) ... +Selecting previously unselected package wireless-regdb. +Preparing to unpack .../wireless-regdb_2013.02.13-1ubuntu1_all.deb ... +Unpacking wireless-regdb (2013.02.13-1ubuntu1) ... +Selecting previously unselected package crda. +Preparing to unpack .../crda_1.1.2-1ubuntu2_amd64.deb ... +Unpacking crda (1.1.2-1ubuntu2) ... +Selecting previously unselected package iucode-tool. +Preparing to unpack .../iucode-tool_1.0.1-1_amd64.deb ... +Unpacking iucode-tool (1.0.1-1) ... +Selecting previously unselected package iw. +Preparing to unpack .../archives/iw_3.4-1_amd64.deb ... +Unpacking iw (3.4-1) ... +Selecting previously unselected package libepoxy0. +Preparing to unpack .../libepoxy0_1.1-1build1_amd64.deb ... +Unpacking libepoxy0 (1.1-1build1) ... +Selecting previously unselected package linux-firmware. +Preparing to unpack .../linux-firmware_1.127.24_all.deb ... +Unpacking linux-firmware (1.127.24) ... +Selecting previously unselected package linux-modules-4.4.0-148-generic. +Preparing to unpack .../linux-modules-4.4.0-148-generic_4.4.0-148.174~14.04.1_amd64.deb ... +Unpacking linux-modules-4.4.0-148-generic (4.4.0-148.174~14.04.1) ... +Selecting previously unselected package linux-image-4.4.0-148-generic. +Preparing to unpack .../linux-image-4.4.0-148-generic_4.4.0-148.174~14.04.1_amd64.deb ... +Unpacking linux-image-4.4.0-148-generic (4.4.0-148.174~14.04.1) ... +Selecting previously unselected package linux-modules-extra-4.4.0-148-generic. +Preparing to unpack .../linux-modules-extra-4.4.0-148-generic_4.4.0-148.174~14.04.1_amd64.deb ... +Unpacking linux-modules-extra-4.4.0-148-generic (4.4.0-148.174~14.04.1) ... +Selecting previously unselected package intel-microcode. +Preparing to unpack .../intel-microcode_3.20190618.0ubuntu0.14.04.1_amd64.deb ... +Unpacking intel-microcode (3.20190618.0ubuntu0.14.04.1) ... +Selecting previously unselected package amd64-microcode. +Preparing to unpack .../amd64-microcode_3.20180524.1~ubuntu0.14.04.2+really20130710.1ubuntu1_amd64.deb ... +Unpacking amd64-microcode (3.20180524.1~ubuntu0.14.04.2+really20130710.1ubuntu1) ... +Selecting previously unselected package linux-image-generic-lts-xenial. +Preparing to unpack .../linux-image-generic-lts-xenial_4.4.0.148.130_amd64.deb ... +Unpacking linux-image-generic-lts-xenial (4.4.0.148.130) ... +Selecting previously unselected package linux-headers-4.4.0-148. +Preparing to unpack .../linux-headers-4.4.0-148_4.4.0-148.174~14.04.1_all.deb ... +Unpacking linux-headers-4.4.0-148 (4.4.0-148.174~14.04.1) ... +Selecting previously unselected package linux-headers-4.4.0-148-generic. +Preparing to unpack .../linux-headers-4.4.0-148-generic_4.4.0-148.174~14.04.1_amd64.deb ... +Unpacking linux-headers-4.4.0-148-generic (4.4.0-148.174~14.04.1) ... +Selecting previously unselected package linux-headers-generic-lts-xenial. +Preparing to unpack .../linux-headers-generic-lts-xenial_4.4.0.148.130_amd64.deb ... +Unpacking linux-headers-generic-lts-xenial (4.4.0.148.130) ... +Selecting previously unselected package linux-generic-lts-xenial. +Preparing to unpack .../linux-generic-lts-xenial_4.4.0.148.130_amd64.deb ... +Unpacking linux-generic-lts-xenial (4.4.0.148.130) ... +Selecting previously unselected package thermald. +Preparing to unpack .../thermald_1.4.3-5~14.04.4_amd64.deb ... +Unpacking thermald (1.4.3-5~14.04.4) ... +Selecting previously unselected package x11-xkb-utils. +Preparing to unpack .../x11-xkb-utils_7.7+1_amd64.deb ... +Unpacking x11-xkb-utils (7.7+1) ... +Selecting previously unselected package xfonts-encodings. +Preparing to unpack .../xfonts-encodings_1%3a1.0.4-1ubuntu1_all.deb ... +Unpacking xfonts-encodings (1:1.0.4-1ubuntu1) ... +Selecting previously unselected package xfonts-utils. +Preparing to unpack .../xfonts-utils_1%3a7.7+1_amd64.deb ... +Unpacking xfonts-utils (1:7.7+1) ... +Selecting previously unselected package xfonts-base. +Preparing to unpack .../xfonts-base_1%3a1.0.3_all.deb ... +Unpacking xfonts-base (1:1.0.3) ... +Selecting previously unselected package xserver-common. +Preparing to unpack .../xserver-common_2%3a1.15.1-0ubuntu2.11_all.deb ... +Unpacking xserver-common (2:1.15.1-0ubuntu2.11) ... +Selecting previously unselected package xserver-xorg-core-lts-xenial. +Preparing to unpack .../xserver-xorg-core-lts-xenial_2%3a1.18.3-1ubuntu2.3~trusty4_amd64.deb ... +Unpacking xserver-xorg-core-lts-xenial (2:1.18.3-1ubuntu2.3~trusty4) ... +Selecting previously unselected package xserver-xorg-input-evdev-lts-xenial. +Preparing to unpack .../xserver-xorg-input-evdev-lts-xenial_1%3a2.10.1-1ubuntu2~trusty1_amd64.deb ... +Unpacking xserver-xorg-input-evdev-lts-xenial (1:2.10.1-1ubuntu2~trusty1) ... +Selecting previously unselected package xserver-xorg-input-synaptics-lts-xenial. +Preparing to unpack .../xserver-xorg-input-synaptics-lts-xenial_1.8.2-1ubuntu3~trusty1_amd64.deb ... +Unpacking xserver-xorg-input-synaptics-lts-xenial (1.8.2-1ubuntu3~trusty1) ... +Selecting previously unselected package xserver-xorg-input-vmmouse-lts-xenial. +Preparing to unpack .../xserver-xorg-input-vmmouse-lts-xenial_1%3a13.1.0-1ubuntu2~trusty1_amd64.deb ... +Unpacking xserver-xorg-input-vmmouse-lts-xenial (1:13.1.0-1ubuntu2~trusty1) ... +Selecting previously unselected package xserver-xorg-input-wacom-lts-xenial. +Preparing to unpack .../xserver-xorg-input-wacom-lts-xenial_1%3a0.32.0-0ubuntu3~trusty1_amd64.deb ... +Unpacking xserver-xorg-input-wacom-lts-xenial (1:0.32.0-0ubuntu3~trusty1) ... +Selecting previously unselected package xserver-xorg-input-all-lts-xenial. +Preparing to unpack .../xserver-xorg-input-all-lts-xenial_1%3a7.7+13ubuntu3~trusty2_amd64.deb ... +Unpacking xserver-xorg-input-all-lts-xenial (1:7.7+13ubuntu3~trusty2) ... +Selecting previously unselected package xserver-xorg-lts-xenial. +Preparing to unpack .../xserver-xorg-lts-xenial_1%3a7.7+13ubuntu3~trusty2_amd64.deb ... +Unpacking xserver-xorg-lts-xenial (1:7.7+13ubuntu3~trusty2) ... +Selecting previously unselected package xserver-xorg-video-amdgpu-lts-xenial. +Preparing to unpack .../xserver-xorg-video-amdgpu-lts-xenial_1.1.0-1~trusty1_amd64.deb ... +Unpacking xserver-xorg-video-amdgpu-lts-xenial (1.1.0-1~trusty1) ... +Selecting previously unselected package xserver-xorg-video-radeon-lts-xenial. +Preparing to unpack .../xserver-xorg-video-radeon-lts-xenial_1%3a7.7.0-1~trusty2_amd64.deb ... +Unpacking xserver-xorg-video-radeon-lts-xenial (1:7.7.0-1~trusty2) ... +Selecting previously unselected package xserver-xorg-video-r128-lts-xenial. +Preparing to unpack .../xserver-xorg-video-r128-lts-xenial_6.10.0-1build2~trusty1_amd64.deb ... +Unpacking xserver-xorg-video-r128-lts-xenial (6.10.0-1build2~trusty1) ... +Selecting previously unselected package xserver-xorg-video-mach64-lts-xenial. +Preparing to unpack .../xserver-xorg-video-mach64-lts-xenial_6.9.5-1build2~trusty1_amd64.deb ... +Unpacking xserver-xorg-video-mach64-lts-xenial (6.9.5-1build2~trusty1) ... +Selecting previously unselected package xserver-xorg-video-ati-lts-xenial. +Preparing to unpack .../xserver-xorg-video-ati-lts-xenial_1%3a7.7.0-1~trusty2_amd64.deb ... +Unpacking xserver-xorg-video-ati-lts-xenial (1:7.7.0-1~trusty2) ... +Selecting previously unselected package xserver-xorg-video-fbdev-lts-xenial. +Preparing to unpack .../xserver-xorg-video-fbdev-lts-xenial_1%3a0.4.4-1build5~trusty1_amd64.deb ... +Unpacking xserver-xorg-video-fbdev-lts-xenial (1:0.4.4-1build5~trusty1) ... +Selecting previously unselected package xserver-xorg-video-nouveau-lts-xenial. +Preparing to unpack .../xserver-xorg-video-nouveau-lts-xenial_1%3a1.0.12-1build2~trusty1_amd64.deb ... +Unpacking xserver-xorg-video-nouveau-lts-xenial (1:1.0.12-1build2~trusty1) ... +Selecting previously unselected package xserver-xorg-video-vesa-lts-xenial. +Preparing to unpack .../xserver-xorg-video-vesa-lts-xenial_1%3a2.3.4-1build2~trusty1_amd64.deb ... +Unpacking xserver-xorg-video-vesa-lts-xenial (1:2.3.4-1build2~trusty1) ... +Selecting previously unselected package xserver-xorg-video-vmware-lts-xenial. +Preparing to unpack .../xserver-xorg-video-vmware-lts-xenial_1%3a13.1.0-2ubuntu3~trusty1_amd64.deb ... +Unpacking xserver-xorg-video-vmware-lts-xenial (1:13.1.0-2ubuntu3~trusty1) ... +Selecting previously unselected package xserver-xorg-video-cirrus-lts-xenial. +Preparing to unpack .../xserver-xorg-video-cirrus-lts-xenial_1%3a1.5.3-1ubuntu3~trusty1_amd64.deb ... +Unpacking xserver-xorg-video-cirrus-lts-xenial (1:1.5.3-1ubuntu3~trusty1) ... +Selecting previously unselected package xserver-xorg-video-mga-lts-xenial. +Preparing to unpack .../xserver-xorg-video-mga-lts-xenial_1%3a1.6.4-1build2~trusty1_amd64.deb ... +Unpacking xserver-xorg-video-mga-lts-xenial (1:1.6.4-1build2~trusty1) ... +Selecting previously unselected package xserver-xorg-video-neomagic-lts-xenial. +Preparing to unpack .../xserver-xorg-video-neomagic-lts-xenial_1%3a1.2.9-1build2~trusty1_amd64.deb ... +Unpacking xserver-xorg-video-neomagic-lts-xenial (1:1.2.9-1build2~trusty1) ... +Selecting previously unselected package xserver-xorg-video-openchrome-lts-xenial. +Preparing to unpack .../xserver-xorg-video-openchrome-lts-xenial_1%3a0.3.3+git20160310-1~trusty1_amd64.deb ... +Unpacking xserver-xorg-video-openchrome-lts-xenial (1:0.3.3+git20160310-1~trusty1) ... +Selecting previously unselected package xserver-xorg-video-savage-lts-xenial. +Preparing to unpack .../xserver-xorg-video-savage-lts-xenial_1%3a2.3.8-1ubuntu3~trusty1_amd64.deb ... +Unpacking xserver-xorg-video-savage-lts-xenial (1:2.3.8-1ubuntu3~trusty1) ... +Selecting previously unselected package xserver-xorg-video-siliconmotion-lts-xenial. +Preparing to unpack .../xserver-xorg-video-siliconmotion-lts-xenial_1%3a1.7.8-1ubuntu6~trusty1_amd64.deb ... +Unpacking xserver-xorg-video-siliconmotion-lts-xenial (1:1.7.8-1ubuntu6~trusty1) ... +Selecting previously unselected package xserver-xorg-video-sisusb-lts-xenial. +Preparing to unpack .../xserver-xorg-video-sisusb-lts-xenial_1%3a0.9.6-2build5~trusty1_amd64.deb ... +Unpacking xserver-xorg-video-sisusb-lts-xenial (1:0.9.6-2build5~trusty1) ... +Selecting previously unselected package xserver-xorg-video-tdfx-lts-xenial. +Preparing to unpack .../xserver-xorg-video-tdfx-lts-xenial_1%3a1.4.6-1build2~trusty1_amd64.deb ... +Unpacking xserver-xorg-video-tdfx-lts-xenial (1:1.4.6-1build2~trusty1) ... +Selecting previously unselected package xserver-xorg-video-trident-lts-xenial. +Preparing to unpack .../xserver-xorg-video-trident-lts-xenial_1%3a1.3.7-1build2~trusty1_amd64.deb ... +Unpacking xserver-xorg-video-trident-lts-xenial (1:1.3.7-1build2~trusty1) ... +Selecting previously unselected package xserver-xorg-video-all-lts-xenial. +Preparing to unpack .../xserver-xorg-video-all-lts-xenial_1%3a7.7+13ubuntu3~trusty2_amd64.deb ... +Unpacking xserver-xorg-video-all-lts-xenial (1:7.7+13ubuntu3~trusty2) ... +Selecting previously unselected package xserver-xorg-video-intel-lts-xenial. +Preparing to unpack .../xserver-xorg-video-intel-lts-xenial_2%3a2.99.917+git20160325-1ubuntu1~trusty1_amd64.deb ... +Unpacking xserver-xorg-video-intel-lts-xenial (2:2.99.917+git20160325-1ubuntu1~trusty1) ... +Selecting previously unselected package xserver-xorg-video-qxl-lts-xenial. +Preparing to unpack .../xserver-xorg-video-qxl-lts-xenial_0.1.4-3ubuntu3~trusty1_amd64.deb ... +Unpacking xserver-xorg-video-qxl-lts-xenial (0.1.4-3ubuntu3~trusty1) ... +Processing triggers for man-db (2.6.7.1-1ubuntu1) ... +Processing triggers for ureadahead (0.100.0-16) ... +Setting up libdrm-amdgpu1:amd64 (2.4.67-1ubuntu0.14.04.2) ... +Setting up libpciaccess0:amd64 (0.13.2-1) ... +Setting up libdrm-intel1:amd64 (2.4.67-1ubuntu0.14.04.2) ... +Setting up libdrm-nouveau2:amd64 (2.4.67-1ubuntu0.14.04.2) ... +Setting up libdrm-radeon1:amd64 (2.4.67-1ubuntu0.14.04.2) ... +Setting up libwayland-client0:amd64 (1.4.0-1ubuntu1.1) ... +Setting up libwayland-server0:amd64 (1.4.0-1ubuntu1.1) ... +Setting up libgbm1-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... +Setting up libx11-xcb1:amd64 (2:1.6.2-1ubuntu2.1) ... +Setting up libxcb-dri2-0:amd64 (1.10-2ubuntu1) ... +Setting up libxcb-dri3-0:amd64 (1.10-2ubuntu1) ... +Setting up libxcb-present0:amd64 (1.10-2ubuntu1) ... +Setting up libxcb-sync1:amd64 (1.10-2ubuntu1) ... +Setting up libxcb-xfixes0:amd64 (1.10-2ubuntu1) ... +Setting up libxshmfence1:amd64 (1.1-2) ... +Setting up libllvm3.8v4:amd64 (1:3.8-2ubuntu3~trusty5) ... +Setting up libgl1-mesa-dri-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... +Setting up libegl1-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... +update-alternatives: using /usr/lib/x86_64-linux-gnu/mesa-egl/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_EGL.conf (x86_64-linux-gnu_egl_conf) in auto mode +Setting up libfontenc1:amd64 (1:1.1.2-1) ... +Setting up libglapi-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... +Setting up libxcb-glx0:amd64 (1.10-2ubuntu1) ... +Setting up libxdamage1:amd64 (1:1.1.4-1ubuntu1) ... +Setting up libxfixes3:amd64 (1:5.0.1-1ubuntu1.1) ... +Setting up libxxf86vm1:amd64 (1:1.1.3-1) ... +Setting up libgl1-mesa-glx-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... +update-alternatives: using /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf (x86_64-linux-gnu_gl_conf) in auto mode +Setting up libgles1-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... +Setting up libgles2-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... +Setting up x11-common (1:7.7+1ubuntu8.1) ... +debconf: unable to initialize frontend: Dialog +debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.) +debconf: falling back to frontend: Readline +debconf: unable to initialize frontend: Readline +debconf: (This frontend requires a controlling tty.) +debconf: falling back to frontend: Teletype + * Setting up X socket directories... + ...done. +Setting up libmtdev1:amd64 (1.1.4-1ubuntu1) ... +Setting up libnl-3-200:amd64 (3.2.21-1ubuntu4.1) ... +Setting up libnl-genl-3-200:amd64 (3.2.21-1ubuntu4.1) ... +Setting up libpixman-1-0:amd64 (0.30.2-2ubuntu1.2) ... +Setting up libwayland-egl1-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... +Setting up libxatracker2-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... +Setting up libxpm4:amd64 (1:3.5.10-1ubuntu0.1) ... +Setting up libxrender1:amd64 (1:0.9.8-1build0.14.04.1) ... +Setting up libxcursor1:amd64 (1:1.1.14-1ubuntu0.14.04.2) ... +Setting up libxfont1:amd64 (1:1.4.7-1ubuntu0.4) ... +Setting up libxi6:amd64 (2:1.7.1.901-1ubuntu1.1) ... +Setting up libxinerama1:amd64 (2:1.1.3-1) ... +Setting up libxkbfile1:amd64 (1:1.0.8-1) ... +Setting up libxrandr2:amd64 (2:1.5.0-1~trusty1) ... +Setting up libxv1:amd64 (2:1.0.10-1) ... +Setting up libevdev2 (1.0.99.2+dfsg-2ubuntu2) ... +Setting up libtxc-dxtn-s2tc0:amd64 (0~git20131104-1.1) ... +update-alternatives: using /usr/lib/x86_64-linux-gnu/libtxc_dxtn_s2tc.so.0 to provide /usr/lib/x86_64-linux-gnu/libtxc_dxtn.so (libtxc-dxtn-x86_64-linux-gnu) in auto mode +Setting up libxcb-util0:amd64 (0.3.8-2ubuntu1) ... +Setting up wireless-regdb (2013.02.13-1ubuntu1) ... +Setting up crda (1.1.2-1ubuntu2) ... +Setting up iucode-tool (1.0.1-1) ... +Setting up iw (3.4-1) ... +Setting up libepoxy0 (1.1-1build1) ... +Setting up linux-firmware (1.127.24) ... +update-initramfs: Generating /boot/initrd.img-3.13.0-170-generic +Setting up linux-modules-4.4.0-148-generic (4.4.0-148.174~14.04.1) ... +Setting up linux-image-4.4.0-148-generic (4.4.0-148.174~14.04.1) ... +I: /vmlinuz is now a symlink to boot/vmlinuz-4.4.0-148-generic +I: /initrd.img is now a symlink to boot/initrd.img-4.4.0-148-generic +Setting up linux-modules-extra-4.4.0-148-generic (4.4.0-148.174~14.04.1) ... +Setting up intel-microcode (3.20190618.0ubuntu0.14.04.1) ... +update-initramfs: deferring update (trigger activated) +intel-microcode: microcode will be updated at next boot +Setting up amd64-microcode (3.20180524.1~ubuntu0.14.04.2+really20130710.1ubuntu1) ... +update-initramfs: deferring update (trigger activated) +Setting up linux-image-generic-lts-xenial (4.4.0.148.130) ... +Setting up linux-headers-4.4.0-148 (4.4.0-148.174~14.04.1) ... +Setting up linux-headers-4.4.0-148-generic (4.4.0-148.174~14.04.1) ... +Setting up linux-headers-generic-lts-xenial (4.4.0.148.130) ... +Setting up linux-generic-lts-xenial (4.4.0.148.130) ... +Setting up thermald (1.4.3-5~14.04.4) ... +thermald start/running, process 7285 +Processing triggers for ureadahead (0.100.0-16) ... +Setting up libice6:amd64 (2:1.0.8-2) ... +Setting up libsm6:amd64 (2:1.2.1-2) ... +Setting up libxt6:amd64 (1:1.1.4-1) ... +Setting up libxmu6:amd64 (2:1.1.1-1) ... +Setting up libxaw7:amd64 (2:1.0.12-1) ... +Setting up libxss1:amd64 (1:1.2.2-1) ... +Setting up libxtst6:amd64 (2:1.2.2-1) ... +Setting up libxvmc1:amd64 (2:1.0.8-1ubuntu1) ... +Setting up x11-xkb-utils (7.7+1) ... +Setting up xfonts-encodings (1:1.0.4-1ubuntu1) ... +Setting up xfonts-utils (1:7.7+1) ... +Setting up xfonts-base (1:1.0.3) ... +Setting up xserver-common (2:1.15.1-0ubuntu2.11) ... +Setting up xserver-xorg-core-lts-xenial (2:1.18.3-1ubuntu2.3~trusty4) ... +Setting up xserver-xorg-input-evdev-lts-xenial (1:2.10.1-1ubuntu2~trusty1) ... +Setting up xserver-xorg-input-synaptics-lts-xenial (1.8.2-1ubuntu3~trusty1) ... +Setting up xserver-xorg-input-vmmouse-lts-xenial (1:13.1.0-1ubuntu2~trusty1) ... +Setting up xserver-xorg-input-wacom-lts-xenial (1:0.32.0-0ubuntu3~trusty1) ... +Setting up xserver-xorg-input-all-lts-xenial (1:7.7+13ubuntu3~trusty2) ... +Setting up xserver-xorg-lts-xenial (1:7.7+13ubuntu3~trusty2) ... +Setting up xserver-xorg-video-amdgpu-lts-xenial (1.1.0-1~trusty1) ... +Setting up xserver-xorg-video-radeon-lts-xenial (1:7.7.0-1~trusty2) ... +Setting up xserver-xorg-video-r128-lts-xenial (6.10.0-1build2~trusty1) ... +Setting up xserver-xorg-video-mach64-lts-xenial (6.9.5-1build2~trusty1) ... +Setting up xserver-xorg-video-ati-lts-xenial (1:7.7.0-1~trusty2) ... +Setting up xserver-xorg-video-fbdev-lts-xenial (1:0.4.4-1build5~trusty1) ... +Setting up xserver-xorg-video-nouveau-lts-xenial (1:1.0.12-1build2~trusty1) ... +Setting up xserver-xorg-video-vesa-lts-xenial (1:2.3.4-1build2~trusty1) ... +Setting up xserver-xorg-video-vmware-lts-xenial (1:13.1.0-2ubuntu3~trusty1) ... +Setting up xserver-xorg-video-cirrus-lts-xenial (1:1.5.3-1ubuntu3~trusty1) ... +Setting up xserver-xorg-video-mga-lts-xenial (1:1.6.4-1build2~trusty1) ... +Setting up xserver-xorg-video-neomagic-lts-xenial (1:1.2.9-1build2~trusty1) ... +Setting up xserver-xorg-video-openchrome-lts-xenial (1:0.3.3+git20160310-1~trusty1) ... +Setting up xserver-xorg-video-savage-lts-xenial (1:2.3.8-1ubuntu3~trusty1) ... +Setting up xserver-xorg-video-siliconmotion-lts-xenial (1:1.7.8-1ubuntu6~trusty1) ... +Setting up xserver-xorg-video-sisusb-lts-xenial (1:0.9.6-2build5~trusty1) ... +Setting up xserver-xorg-video-tdfx-lts-xenial (1:1.4.6-1build2~trusty1) ... +Setting up xserver-xorg-video-trident-lts-xenial (1:1.3.7-1build2~trusty1) ... +Setting up xserver-xorg-video-all-lts-xenial (1:7.7+13ubuntu3~trusty2) ... +Setting up xserver-xorg-video-intel-lts-xenial (2:2.99.917+git20160325-1ubuntu1~trusty1) ... +Setting up xserver-xorg-video-qxl-lts-xenial (0.1.4-3ubuntu3~trusty1) ... +Processing triggers for libc-bin (2.19-0ubuntu6.15) ... +Processing triggers for linux-image-4.4.0-148-generic (4.4.0-148.174~14.04.1) ... +/etc/kernel/postinst.d/initramfs-tools: +update-initramfs: Generating /boot/initrd.img-4.4.0-148-generic +/etc/kernel/postinst.d/x-grub-legacy-ec2: +debconf: unable to initialize frontend: Dialog +debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.) +debconf: falling back to frontend: Readline +debconf: unable to initialize frontend: Readline +debconf: (This frontend requires a controlling tty.) +debconf: falling back to frontend: Teletype +Searching for GRUB installation directory ... found: /boot/grub +Searching for default file ... found: /boot/grub/default +Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst +Searching for splash image ... none found, skipping ... +Found kernel: /boot/vmlinuz-3.13.0-170-generic +Found kernel: /boot/vmlinuz-4.4.0-148-generic +Found kernel: /boot/vmlinuz-3.13.0-170-generic +Replacing config file /run/grub/menu.lst with new version +Updating /boot/grub/menu.lst ... done + +/etc/kernel/postinst.d/zz-update-grub: +Generating grub configuration file ... +Found linux image: /boot/vmlinuz-4.4.0-148-generic +Found initrd image: /boot/initrd.img-4.4.0-148-generic +Found linux image: /boot/vmlinuz-3.13.0-170-generic +Found initrd image: /boot/initrd.img-3.13.0-170-generic +done +Processing triggers for initramfs-tools (0.103ubuntu4.11) ... +update-initramfs: Generating /boot/initrd.img-4.4.0-148-generic ++ multipass restart trusty-uac +++ multipass exec trusty-uac -- uname -r ++ kernel_version=4.4.0-148-generic ++ [[ 4.4.0-148-generic == 4.4.0* ]] ++ echo 'SUCCESS: kernel was successfully updated to HWE: 4.4.0-148-generic' +SUCCESS: kernel was successfully updated to HWE: 4.4.0-148-generic ++ update_uaclient ++ name_build=trusty-uac-build ++ pkg_name=ubuntu-advantage-tools_25.0_amd64.deb ++ multipass launch trusty --name trusty-uac-build ++ multipass exec trusty-uac-build bash /tmp/install_uac_from_master.sh +Reading package lists... +Building dependency tree... +Reading state information... +The following extra packages will be installed: + git-man liberror-perl +Suggested packages: + git-daemon-run git-daemon-sysvinit git-doc git-el git-email git-gui gitk + gitweb git-arch git-bzr git-cvs git-mediawiki git-svn make-doc +The following NEW packages will be installed: + git git-man liberror-perl make +0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. +Need to get 3,578 kB of archives. +After this operation, 22.3 MB of additional disk space will be used. +Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main liberror-perl all 0.17-1.1 [21.1 kB] +Get:2 http://archive.ubuntu.com/ubuntu/ trusty-updates/main git-man all 1:1.9.1-1ubuntu0.10 [700 kB] +Get:3 http://archive.ubuntu.com/ubuntu/ trusty-updates/main git amd64 1:1.9.1-1ubuntu0.10 [2,737 kB] +Get:4 http://archive.ubuntu.com/ubuntu/ trusty/main make amd64 3.81-8.2ubuntu3 [119 kB] +debconf: unable to initialize frontend: Dialog +debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.) +debconf: falling back to frontend: Readline +debconf: unable to initialize frontend: Readline +debconf: (This frontend requires a controlling tty.) +debconf: falling back to frontend: Teletype +dpkg-preconfigure: unable to re-open stdin: +Fetched 3,578 kB in 7s (482 kB/s) +Selecting previously unselected package liberror-perl. +(Reading database ... 51418 files and directories currently installed.) +Preparing to unpack .../liberror-perl_0.17-1.1_all.deb ... +Unpacking liberror-perl (0.17-1.1) ... +Selecting previously unselected package git-man. +Preparing to unpack .../git-man_1%3a1.9.1-1ubuntu0.10_all.deb ... +Unpacking git-man (1:1.9.1-1ubuntu0.10) ... +Selecting previously unselected package git. +Preparing to unpack .../git_1%3a1.9.1-1ubuntu0.10_amd64.deb ... +Unpacking git (1:1.9.1-1ubuntu0.10) ... +Selecting previously unselected package make. +Preparing to unpack .../make_3.81-8.2ubuntu3_amd64.deb ... +Unpacking make (3.81-8.2ubuntu3) ... +Processing triggers for man-db (2.6.7.1-1ubuntu1) ... +Setting up liberror-perl (0.17-1.1) ... +Setting up git-man (1:1.9.1-1ubuntu0.10) ... +Setting up git (1:1.9.1-1ubuntu0.10) ... +Setting up make (3.81-8.2ubuntu3) ... +Cloning into '/tmp/uac'... +Missing mk-build-deps; installing devscripts, equivs. +Reading package lists... +Building dependency tree... +Reading state information... +The following extra packages will be installed: + binutils debhelper dh-apparmor dpkg-dev fakeroot gettext intltool-debian + libcroco3 libdpkg-perl libfakeroot libgomp1 libunistring0 po-debconf +Suggested packages: + binutils-doc dh-make bsd-mailx mailx build-essential cvs-buildpackage + devscripts-el gnuplot libauthen-sasl-perl libfile-desktopentry-perl + libnet-smtp-ssl-perl libterm-size-perl libyaml-syck-perl mutt + svn-buildpackage debian-keyring liblwp-protocol-https-perl libsoap-lite-perl + apparmor-easyprof gettext-doc libmail-box-perl +Recommended packages: + dctrl-tools dput dupload libdistro-info-perl libencode-locale-perl + libjson-perl libparse-debcontrol-perl liburi-perl libwww-perl lintian + patchutils python3-debian python3-magic unzip wdiff gcc c-compiler + libalgorithm-merge-perl libasprintf-dev libgettextpo-dev + libfile-fcntllock-perl libmail-sendmail-perl +The following NEW packages will be installed: + binutils debhelper devscripts dh-apparmor dpkg-dev equivs fakeroot gettext + intltool-debian libcroco3 libdpkg-perl libfakeroot libgomp1 libunistring0 + po-debconf +0 upgraded, 15 newly installed, 0 to remove and 0 not upgraded. +Need to get 5,934 kB of archives. +After this operation, 24.1 MB of additional disk space will be used. +Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main libcroco3 amd64 0.6.8-2ubuntu1 [82.4 kB] +Get:2 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgomp1 amd64 4.8.4-2ubuntu1~14.04.4 [23.1 kB] +Get:3 http://archive.ubuntu.com/ubuntu/ trusty/main libunistring0 amd64 0.9.3-5ubuntu3 [271 kB] +Get:4 http://archive.ubuntu.com/ubuntu/ trusty-updates/main binutils amd64 2.24-5ubuntu14.2 [2,076 kB] +Get:5 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libdpkg-perl all 1.17.5ubuntu5.8 [179 kB] +Get:6 http://archive.ubuntu.com/ubuntu/ trusty-updates/main dpkg-dev all 1.17.5ubuntu5.8 [726 kB] +Get:7 http://archive.ubuntu.com/ubuntu/ trusty-updates/main gettext amd64 0.18.3.1-1ubuntu3.1 [829 kB] +Get:8 http://archive.ubuntu.com/ubuntu/ trusty/main intltool-debian all 0.35.0+20060710.1 [31.6 kB] +Get:9 http://archive.ubuntu.com/ubuntu/ trusty/main po-debconf all 1.0.16+nmu2ubuntu1 [210 kB] +Get:10 http://archive.ubuntu.com/ubuntu/ trusty-updates/main dh-apparmor all 2.10.95-0ubuntu2.6~14.04.4 [11.3 kB] +Get:11 http://archive.ubuntu.com/ubuntu/ trusty/main debhelper all 9.20131227ubuntu1 [604 kB] +Get:12 http://archive.ubuntu.com/ubuntu/ trusty-updates/main devscripts amd64 2.14.1ubuntu0.1 [792 kB] +Get:13 http://archive.ubuntu.com/ubuntu/ trusty/main libfakeroot amd64 1.20-3ubuntu2 [25.4 kB] +Get:14 http://archive.ubuntu.com/ubuntu/ trusty/main fakeroot amd64 1.20-3ubuntu2 [55.0 kB] +Get:15 http://archive.ubuntu.com/ubuntu/ trusty/universe equivs all 2.0.9 [18.5 kB] +debconf: unable to initialize frontend: Dialog +debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.) +debconf: falling back to frontend: Readline +debconf: unable to initialize frontend: Readline +debconf: (This frontend requires a controlling tty.) +debconf: falling back to frontend: Teletype +dpkg-preconfigure: unable to re-open stdin: +Fetched 5,934 kB in 13s (432 kB/s) +Selecting previously unselected package libcroco3:amd64. +(Reading database ... 52178 files and directories currently installed.) +Preparing to unpack .../libcroco3_0.6.8-2ubuntu1_amd64.deb ... +Unpacking libcroco3:amd64 (0.6.8-2ubuntu1) ... +Selecting previously unselected package libgomp1:amd64. +Preparing to unpack .../libgomp1_4.8.4-2ubuntu1~14.04.4_amd64.deb ... +Unpacking libgomp1:amd64 (4.8.4-2ubuntu1~14.04.4) ... +Selecting previously unselected package libunistring0:amd64. +Preparing to unpack .../libunistring0_0.9.3-5ubuntu3_amd64.deb ... +Unpacking libunistring0:amd64 (0.9.3-5ubuntu3) ... +Selecting previously unselected package binutils. +Preparing to unpack .../binutils_2.24-5ubuntu14.2_amd64.deb ... +Unpacking binutils (2.24-5ubuntu14.2) ... +Selecting previously unselected package libdpkg-perl. +Preparing to unpack .../libdpkg-perl_1.17.5ubuntu5.8_all.deb ... +Unpacking libdpkg-perl (1.17.5ubuntu5.8) ... +Selecting previously unselected package dpkg-dev. +Preparing to unpack .../dpkg-dev_1.17.5ubuntu5.8_all.deb ... +Unpacking dpkg-dev (1.17.5ubuntu5.8) ... +Selecting previously unselected package gettext. +Preparing to unpack .../gettext_0.18.3.1-1ubuntu3.1_amd64.deb ... +Unpacking gettext (0.18.3.1-1ubuntu3.1) ... +Selecting previously unselected package intltool-debian. +Preparing to unpack .../intltool-debian_0.35.0+20060710.1_all.deb ... +Unpacking intltool-debian (0.35.0+20060710.1) ... +Selecting previously unselected package po-debconf. +Preparing to unpack .../po-debconf_1.0.16+nmu2ubuntu1_all.deb ... +Unpacking po-debconf (1.0.16+nmu2ubuntu1) ... +Selecting previously unselected package dh-apparmor. +Preparing to unpack .../dh-apparmor_2.10.95-0ubuntu2.6~14.04.4_all.deb ... +Unpacking dh-apparmor (2.10.95-0ubuntu2.6~14.04.4) ... +Selecting previously unselected package debhelper. +Preparing to unpack .../debhelper_9.20131227ubuntu1_all.deb ... +Unpacking debhelper (9.20131227ubuntu1) ... +Selecting previously unselected package devscripts. +Preparing to unpack .../devscripts_2.14.1ubuntu0.1_amd64.deb ... +Unpacking devscripts (2.14.1ubuntu0.1) ... +Selecting previously unselected package libfakeroot:amd64. +Preparing to unpack .../libfakeroot_1.20-3ubuntu2_amd64.deb ... +Unpacking libfakeroot:amd64 (1.20-3ubuntu2) ... +Selecting previously unselected package fakeroot. +Preparing to unpack .../fakeroot_1.20-3ubuntu2_amd64.deb ... +Unpacking fakeroot (1.20-3ubuntu2) ... +Selecting previously unselected package equivs. +Preparing to unpack .../archives/equivs_2.0.9_all.deb ... +Unpacking equivs (2.0.9) ... +Processing triggers for man-db (2.6.7.1-1ubuntu1) ... +Processing triggers for install-info (5.2.0.dfsg.1-2) ... +Setting up libcroco3:amd64 (0.6.8-2ubuntu1) ... +Setting up libgomp1:amd64 (4.8.4-2ubuntu1~14.04.4) ... +Setting up libunistring0:amd64 (0.9.3-5ubuntu3) ... +Setting up binutils (2.24-5ubuntu14.2) ... +Setting up libdpkg-perl (1.17.5ubuntu5.8) ... +Setting up dpkg-dev (1.17.5ubuntu5.8) ... +Setting up gettext (0.18.3.1-1ubuntu3.1) ... +Setting up intltool-debian (0.35.0+20060710.1) ... +Setting up po-debconf (1.0.16+nmu2ubuntu1) ... +Setting up dh-apparmor (2.10.95-0ubuntu2.6~14.04.4) ... +Setting up debhelper (9.20131227ubuntu1) ... +Setting up devscripts (2.14.1ubuntu0.1) ... +Setting up libfakeroot:amd64 (1.20-3ubuntu2) ... +Setting up fakeroot (1.20-3ubuntu2) ... +update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode +Setting up equivs (2.0.9) ... +Processing triggers for libc-bin (2.19-0ubuntu6.15) ... +mk-build-deps --tool "apt-get --no-install-recommends --yes" \ + --install --remove /tmp/uac//debian/control +make[1]: Entering directory `/tmp/uac/equivs.VNowxK' +dh_testdir +dh_testroot +dh_prep +dh_testdir +dh_testroot +dh_install +dh_installdocs +dh_installchangelogs +dh_compress +dh_fixperms +dh_installdeb +dh_gencontrol +sh: 1: gcc: not found +dpkg-gencontrol: warning: couldn't determine gcc system type, falling back to default (native compilation) +dpkg-gencontrol: warning: File::FcntlLock not available; using flock which is not NFS-safe +dh_md5sums +dh_builddeb +dpkg-deb: building package `ubuntu-advantage-tools-build-deps' in `../ubuntu-advantage-tools-build-deps_25.0_all.deb'. +make[1]: Leaving directory `/tmp/uac/equivs.VNowxK' + +The package has been created. +Attention, the package has been created in the current directory, +not in ".." as indicated by the message above! +Selecting previously unselected package ubuntu-advantage-tools-build-deps. +(Reading database ... 53773 files and directories currently installed.) +Preparing to unpack ubuntu-advantage-tools-build-deps_25.0_all.deb ... +Unpacking ubuntu-advantage-tools-build-deps (25.0) ... +Reading package lists... +Building dependency tree... +Reading state information... +Correcting dependencies... Done +The following extra packages will be installed: + build-essential cpp cpp-4.8 dh-systemd g++ g++-4.8 gcc gcc-4.8 + libapt-pkg-dev libasan0 libatomic1 libc-dev-bin libc6-dev libcloog-isl4 + libgcc-4.8-dev libgmp10 libisl10 libitm1 libmpc3 libmpfr4 libquadmath0 + libstdc++-4.8-dev libtsan0 linux-libc-dev pep8 pyflakes python-flake8 + python-mccabe python-setuptools python3-flake8 python3-mccabe python3-mock + python3-pep8 python3-py python3-pytest python3-setuptools zlib1g-dev +Suggested packages: + cpp-doc gcc-4.8-locales g++-multilib g++-4.8-multilib gcc-4.8-doc + libstdc++6-4.8-dbg gcc-multilib manpages-dev autoconf automake1.9 libtool + flex bison gdb gcc-doc gcc-4.8-multilib libgcc1-dbg libgomp1-dbg libitm1-dbg + libatomic1-dbg libasan0-dbg libtsan0-dbg libquadmath0-dbg glibc-doc + libstdc++-4.8-doc python-mock-doc subversion +The following NEW packages will be installed: + build-essential cpp cpp-4.8 dh-systemd g++ g++-4.8 gcc gcc-4.8 + libapt-pkg-dev libasan0 libatomic1 libc-dev-bin libc6-dev libcloog-isl4 + libgcc-4.8-dev libgmp10 libisl10 libitm1 libmpc3 libmpfr4 libquadmath0 + libstdc++-4.8-dev libtsan0 linux-libc-dev pep8 pyflakes python-flake8 + python-mccabe python-setuptools python3-flake8 python3-mccabe python3-mock + python3-pep8 python3-py python3-pytest python3-setuptools zlib1g-dev +0 upgraded, 37 newly installed, 0 to remove and 0 not upgraded. +1 not fully installed or removed. +Need to get 35.2 MB of archives. +After this operation, 102 MB of additional disk space will be used. +Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libc-dev-bin amd64 2.19-0ubuntu6.15 [68.9 kB] +Get:2 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-libc-dev amd64 3.13.0-170.220 [772 kB] +Get:3 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libc6-dev amd64 2.19-0ubuntu6.15 [1,913 kB] +Get:4 http://archive.ubuntu.com/ubuntu/ trusty/main libgmp10 amd64 2:5.1.3+dfsg-1ubuntu1 [218 kB] +Get:5 http://archive.ubuntu.com/ubuntu/ trusty/main libisl10 amd64 0.12.2-1 [419 kB] +Get:6 http://archive.ubuntu.com/ubuntu/ trusty/main libcloog-isl4 amd64 0.18.2-1 [57.5 kB] +Get:7 http://archive.ubuntu.com/ubuntu/ trusty/main libmpfr4 amd64 3.1.2-1 [203 kB] +Get:8 http://archive.ubuntu.com/ubuntu/ trusty/main libmpc3 amd64 1.0.1-1ubuntu1 [38.4 kB] +Get:9 http://archive.ubuntu.com/ubuntu/ trusty-updates/main cpp-4.8 amd64 4.8.4-2ubuntu1~14.04.4 [4,452 kB] +Get:10 http://archive.ubuntu.com/ubuntu/ trusty/main cpp amd64 4:4.8.2-1ubuntu6 [27.5 kB] +Get:11 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libitm1 amd64 4.8.4-2ubuntu1~14.04.4 [28.6 kB] +Get:12 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libatomic1 amd64 4.8.4-2ubuntu1~14.04.4 [8,630 B] +Get:13 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libasan0 amd64 4.8.4-2ubuntu1~14.04.4 [63.1 kB] +Get:14 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libtsan0 amd64 4.8.4-2ubuntu1~14.04.4 [94.8 kB] +Get:15 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libquadmath0 amd64 4.8.4-2ubuntu1~14.04.4 [126 kB] +Get:16 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgcc-4.8-dev amd64 4.8.4-2ubuntu1~14.04.4 [1,688 kB] +Get:17 http://archive.ubuntu.com/ubuntu/ trusty-updates/main gcc-4.8 amd64 4.8.4-2ubuntu1~14.04.4 [5,040 kB] +Get:18 http://archive.ubuntu.com/ubuntu/ trusty/main gcc amd64 4:4.8.2-1ubuntu6 [5,098 B] +Get:19 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libstdc++-4.8-dev amd64 4.8.4-2ubuntu1~14.04.4 [1,051 kB] +Get:20 http://archive.ubuntu.com/ubuntu/ trusty-updates/main g++-4.8 amd64 4.8.4-2ubuntu1~14.04.4 [18.0 MB] +Get:21 http://archive.ubuntu.com/ubuntu/ trusty/main g++ amd64 4:4.8.2-1ubuntu6 [1,490 B] +Get:22 http://archive.ubuntu.com/ubuntu/ trusty/main build-essential amd64 11.6ubuntu6 [4,838 B] +Get:23 http://archive.ubuntu.com/ubuntu/ trusty-updates/main zlib1g-dev amd64 1:1.2.8.dfsg-1ubuntu1.1 [166 kB] +Get:24 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libapt-pkg-dev amd64 1.0.1ubuntu2.24 [82.6 kB] +Get:25 http://archive.ubuntu.com/ubuntu/ trusty-updates/main python-setuptools all 3.3-1ubuntu2 [230 kB] +Get:26 http://archive.ubuntu.com/ubuntu/ trusty/main pep8 all 1.4.6-1.1build1 [27.4 kB] +Get:27 http://archive.ubuntu.com/ubuntu/ trusty/main pyflakes all 0.8.1-1 [31.2 kB] +Get:28 http://archive.ubuntu.com/ubuntu/ trusty/universe python-mccabe all 0.2.1-1 [6,782 B] +Get:29 http://archive.ubuntu.com/ubuntu/ trusty/universe python-flake8 amd64 2.1.0-1ubuntu1 [15.0 kB] +Get:30 http://archive.ubuntu.com/ubuntu/ trusty/universe python3-mccabe all 0.2.1-1 [6,600 B] +Get:31 http://archive.ubuntu.com/ubuntu/ trusty-updates/main python3-setuptools all 3.3-1ubuntu2 [144 kB] +Get:32 http://archive.ubuntu.com/ubuntu/ trusty/main python3-pep8 all 1.4.6-1.1build1 [26.0 kB] +Get:33 http://archive.ubuntu.com/ubuntu/ trusty/universe python3-flake8 amd64 2.1.0-1ubuntu1 [12.3 kB] +Get:34 http://archive.ubuntu.com/ubuntu/ trusty/main python3-mock all 1.0.1-3 [23.9 kB] +Get:35 http://archive.ubuntu.com/ubuntu/ trusty/main python3-py all 1.4.20-1 [62.4 kB] +Get:36 http://archive.ubuntu.com/ubuntu/ trusty/main python3-pytest all 2.5.1-1 [91.8 kB] +Get:37 http://archive.ubuntu.com/ubuntu/ trusty-updates/main dh-systemd all 1.14ubuntu1 [13.0 kB] +debconf: unable to initialize frontend: Dialog +debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.) +debconf: falling back to frontend: Readline +debconf: unable to initialize frontend: Readline +debconf: (This frontend requires a controlling tty.) +debconf: falling back to frontend: Teletype +dpkg-preconfigure: unable to re-open stdin: +Fetched 35.2 MB in 52s (667 kB/s) +Selecting previously unselected package libc-dev-bin. +(Reading database ... 53777 files and directories currently installed.) +Preparing to unpack .../libc-dev-bin_2.19-0ubuntu6.15_amd64.deb ... +Unpacking libc-dev-bin (2.19-0ubuntu6.15) ... +Selecting previously unselected package linux-libc-dev:amd64. +Preparing to unpack .../linux-libc-dev_3.13.0-170.220_amd64.deb ... +Unpacking linux-libc-dev:amd64 (3.13.0-170.220) ... +Selecting previously unselected package libc6-dev:amd64. +Preparing to unpack .../libc6-dev_2.19-0ubuntu6.15_amd64.deb ... +Unpacking libc6-dev:amd64 (2.19-0ubuntu6.15) ... +Selecting previously unselected package libgmp10:amd64. +Preparing to unpack .../libgmp10_2%3a5.1.3+dfsg-1ubuntu1_amd64.deb ... +Unpacking libgmp10:amd64 (2:5.1.3+dfsg-1ubuntu1) ... +Selecting previously unselected package libisl10:amd64. +Preparing to unpack .../libisl10_0.12.2-1_amd64.deb ... +Unpacking libisl10:amd64 (0.12.2-1) ... +Selecting previously unselected package libcloog-isl4:amd64. +Preparing to unpack .../libcloog-isl4_0.18.2-1_amd64.deb ... +Unpacking libcloog-isl4:amd64 (0.18.2-1) ... +Selecting previously unselected package libmpfr4:amd64. +Preparing to unpack .../libmpfr4_3.1.2-1_amd64.deb ... +Unpacking libmpfr4:amd64 (3.1.2-1) ... +Selecting previously unselected package libmpc3:amd64. +Preparing to unpack .../libmpc3_1.0.1-1ubuntu1_amd64.deb ... +Unpacking libmpc3:amd64 (1.0.1-1ubuntu1) ... +Selecting previously unselected package cpp-4.8. +Preparing to unpack .../cpp-4.8_4.8.4-2ubuntu1~14.04.4_amd64.deb ... +Unpacking cpp-4.8 (4.8.4-2ubuntu1~14.04.4) ... +Selecting previously unselected package cpp. +Preparing to unpack .../cpp_4%3a4.8.2-1ubuntu6_amd64.deb ... +Unpacking cpp (4:4.8.2-1ubuntu6) ... +Selecting previously unselected package libitm1:amd64. +Preparing to unpack .../libitm1_4.8.4-2ubuntu1~14.04.4_amd64.deb ... +Unpacking libitm1:amd64 (4.8.4-2ubuntu1~14.04.4) ... +Selecting previously unselected package libatomic1:amd64. +Preparing to unpack .../libatomic1_4.8.4-2ubuntu1~14.04.4_amd64.deb ... +Unpacking libatomic1:amd64 (4.8.4-2ubuntu1~14.04.4) ... +Selecting previously unselected package libasan0:amd64. +Preparing to unpack .../libasan0_4.8.4-2ubuntu1~14.04.4_amd64.deb ... +Unpacking libasan0:amd64 (4.8.4-2ubuntu1~14.04.4) ... +Selecting previously unselected package libtsan0:amd64. +Preparing to unpack .../libtsan0_4.8.4-2ubuntu1~14.04.4_amd64.deb ... +Unpacking libtsan0:amd64 (4.8.4-2ubuntu1~14.04.4) ... +Selecting previously unselected package libquadmath0:amd64. +Preparing to unpack .../libquadmath0_4.8.4-2ubuntu1~14.04.4_amd64.deb ... +Unpacking libquadmath0:amd64 (4.8.4-2ubuntu1~14.04.4) ... +Selecting previously unselected package libgcc-4.8-dev:amd64. +Preparing to unpack .../libgcc-4.8-dev_4.8.4-2ubuntu1~14.04.4_amd64.deb ... +Unpacking libgcc-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.4) ... +Selecting previously unselected package gcc-4.8. +Preparing to unpack .../gcc-4.8_4.8.4-2ubuntu1~14.04.4_amd64.deb ... +Unpacking gcc-4.8 (4.8.4-2ubuntu1~14.04.4) ... +Selecting previously unselected package gcc. +Preparing to unpack .../gcc_4%3a4.8.2-1ubuntu6_amd64.deb ... +Unpacking gcc (4:4.8.2-1ubuntu6) ... +Selecting previously unselected package libstdc++-4.8-dev:amd64. +Preparing to unpack .../libstdc++-4.8-dev_4.8.4-2ubuntu1~14.04.4_amd64.deb ... +Unpacking libstdc++-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.4) ... +Selecting previously unselected package g++-4.8. +Preparing to unpack .../g++-4.8_4.8.4-2ubuntu1~14.04.4_amd64.deb ... +Unpacking g++-4.8 (4.8.4-2ubuntu1~14.04.4) ... +Selecting previously unselected package g++. +Preparing to unpack .../g++_4%3a4.8.2-1ubuntu6_amd64.deb ... +Unpacking g++ (4:4.8.2-1ubuntu6) ... +Selecting previously unselected package build-essential. +Preparing to unpack .../build-essential_11.6ubuntu6_amd64.deb ... +Unpacking build-essential (11.6ubuntu6) ... +Selecting previously unselected package zlib1g-dev:amd64. +Preparing to unpack .../zlib1g-dev_1%3a1.2.8.dfsg-1ubuntu1.1_amd64.deb ... +Unpacking zlib1g-dev:amd64 (1:1.2.8.dfsg-1ubuntu1.1) ... +Selecting previously unselected package libapt-pkg-dev:amd64. +Preparing to unpack .../libapt-pkg-dev_1.0.1ubuntu2.24_amd64.deb ... +Unpacking libapt-pkg-dev:amd64 (1.0.1ubuntu2.24) ... +Selecting previously unselected package python-setuptools. +Preparing to unpack .../python-setuptools_3.3-1ubuntu2_all.deb ... +Unpacking python-setuptools (3.3-1ubuntu2) ... +Selecting previously unselected package pep8. +Preparing to unpack .../pep8_1.4.6-1.1build1_all.deb ... +Unpacking pep8 (1.4.6-1.1build1) ... +Selecting previously unselected package pyflakes. +Preparing to unpack .../pyflakes_0.8.1-1_all.deb ... +Unpacking pyflakes (0.8.1-1) ... +Selecting previously unselected package python-mccabe. +Preparing to unpack .../python-mccabe_0.2.1-1_all.deb ... +Unpacking python-mccabe (0.2.1-1) ... +Selecting previously unselected package python-flake8. +Preparing to unpack .../python-flake8_2.1.0-1ubuntu1_amd64.deb ... +Unpacking python-flake8 (2.1.0-1ubuntu1) ... +Selecting previously unselected package python3-mccabe. +Preparing to unpack .../python3-mccabe_0.2.1-1_all.deb ... +Unpacking python3-mccabe (0.2.1-1) ... +Selecting previously unselected package python3-setuptools. +Preparing to unpack .../python3-setuptools_3.3-1ubuntu2_all.deb ... +Unpacking python3-setuptools (3.3-1ubuntu2) ... +Selecting previously unselected package python3-pep8. +Preparing to unpack .../python3-pep8_1.4.6-1.1build1_all.deb ... +Unpacking python3-pep8 (1.4.6-1.1build1) ... +Selecting previously unselected package python3-flake8. +Preparing to unpack .../python3-flake8_2.1.0-1ubuntu1_amd64.deb ... +Unpacking python3-flake8 (2.1.0-1ubuntu1) ... +Selecting previously unselected package python3-mock. +Preparing to unpack .../python3-mock_1.0.1-3_all.deb ... +Unpacking python3-mock (1.0.1-3) ... +Selecting previously unselected package python3-py. +Preparing to unpack .../python3-py_1.4.20-1_all.deb ... +Unpacking python3-py (1.4.20-1) ... +Selecting previously unselected package python3-pytest. +Preparing to unpack .../python3-pytest_2.5.1-1_all.deb ... +Unpacking python3-pytest (2.5.1-1) ... +Selecting previously unselected package dh-systemd. +Preparing to unpack .../dh-systemd_1.14ubuntu1_all.deb ... +Unpacking dh-systemd (1.14ubuntu1) ... +Processing triggers for man-db (2.6.7.1-1ubuntu1) ... +Setting up libc-dev-bin (2.19-0ubuntu6.15) ... +Setting up linux-libc-dev:amd64 (3.13.0-170.220) ... +Setting up libc6-dev:amd64 (2.19-0ubuntu6.15) ... +Setting up libgmp10:amd64 (2:5.1.3+dfsg-1ubuntu1) ... +Setting up libisl10:amd64 (0.12.2-1) ... +Setting up libcloog-isl4:amd64 (0.18.2-1) ... +Setting up libmpfr4:amd64 (3.1.2-1) ... +Setting up libmpc3:amd64 (1.0.1-1ubuntu1) ... +Setting up cpp-4.8 (4.8.4-2ubuntu1~14.04.4) ... +Setting up cpp (4:4.8.2-1ubuntu6) ... +Setting up libitm1:amd64 (4.8.4-2ubuntu1~14.04.4) ... +Setting up libatomic1:amd64 (4.8.4-2ubuntu1~14.04.4) ... +Setting up libasan0:amd64 (4.8.4-2ubuntu1~14.04.4) ... +Setting up libtsan0:amd64 (4.8.4-2ubuntu1~14.04.4) ... +Setting up libquadmath0:amd64 (4.8.4-2ubuntu1~14.04.4) ... +Setting up libgcc-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.4) ... +Setting up gcc-4.8 (4.8.4-2ubuntu1~14.04.4) ... +Setting up gcc (4:4.8.2-1ubuntu6) ... +Setting up libstdc++-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.4) ... +Setting up g++-4.8 (4.8.4-2ubuntu1~14.04.4) ... +Setting up g++ (4:4.8.2-1ubuntu6) ... +update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode +Setting up build-essential (11.6ubuntu6) ... +Setting up zlib1g-dev:amd64 (1:1.2.8.dfsg-1ubuntu1.1) ... +Setting up libapt-pkg-dev:amd64 (1.0.1ubuntu2.24) ... +Setting up python-setuptools (3.3-1ubuntu2) ... +Setting up pep8 (1.4.6-1.1build1) ... +Setting up pyflakes (0.8.1-1) ... +Setting up python-mccabe (0.2.1-1) ... +Setting up python-flake8 (2.1.0-1ubuntu1) ... +Setting up python3-mccabe (0.2.1-1) ... +Setting up python3-setuptools (3.3-1ubuntu2) ... +Setting up python3-pep8 (1.4.6-1.1build1) ... +Setting up python3-flake8 (2.1.0-1ubuntu1) ... +Setting up python3-mock (1.0.1-3) ... +Setting up python3-py (1.4.20-1) ... +Setting up python3-pytest (2.5.1-1) ... +Setting up dh-systemd (1.14ubuntu1) ... +Setting up ubuntu-advantage-tools-build-deps (25.0) ... +Processing triggers for libc-bin (2.19-0ubuntu6.15) ... +dpkg-buildpackage: source package ubuntu-advantage-tools +dpkg-buildpackage: source version 25.0 +dpkg-buildpackage: source distribution UNRELEASED +dpkg-buildpackage: source changed by Chad Smith + dpkg-source --before-build uac +dpkg-buildpackage: host architecture amd64 + debian/rules clean +dh clean --with python3,bash-completion,systemd --buildsystem=pybuild \ + --no-start + dh_testdir -O--buildsystem=pybuild -O--no-start + debian/rules override_dh_auto_clean +make[1]: Entering directory `/tmp/uac' +dh_auto_clean + pybuild --clean -i python{version} -p 3.4 --dir . +I: pybuild base:170: python3.4 setup.py clean +running clean +removing '/tmp/uac/.pybuild/pythonX.Y_3.4/build' (and everything under it) +'build/bdist.linux-x86_64' does not exist -- can't clean it +'build/scripts-3.4' does not exist -- can't clean it + rm -rf .pybuild/ + find . -name \*.pyc -exec rm {} \; +make clean +make[2]: Entering directory `/tmp/uac' +rm -f *.build *.buildinfo *.changes .coverage *.deb *.dsc *.tar.gz *.tar.xz +rm -rf *.egg-info/ .tox/ .cache/ .mypy_cache/ +find . -type f -name '*.pyc' -delete +find . -type d -name '*__pycache__' -delete +make -C apt-hook clean +make[3]: Entering directory `/tmp/uac/apt-hook' +rm -f hook ubuntu-advantage.pot +make[3]: Leaving directory `/tmp/uac/apt-hook' +make[2]: Leaving directory `/tmp/uac' +make[1]: Leaving directory `/tmp/uac' + dh_clean -O--buildsystem=pybuild -O--no-start + rm -f debian/ubuntu-advantage-tools.substvars + rm -f debian/ubuntu-advantage-tools.*.debhelper + rm -rf debian/ubuntu-advantage-tools/ + rm -f debian/ubuntu-advantage-pro.substvars + rm -f debian/ubuntu-advantage-pro.*.debhelper + rm -rf debian/ubuntu-advantage-pro/ + rm -f debian/*.debhelper.log + rm -f debian/files + find . \( \( -type f -a \ + \( -name '#*#' -o -name '.*~' -o -name '*~' -o -name DEADJOE \ + -o -name '*.orig' -o -name '*.rej' -o -name '*.bak' \ + -o -name '.*.orig' -o -name .*.rej -o -name '.SUMS' \ + -o -name TAGS -o \( -path '*/.deps/*' -a -name '*.P' \) \ + \) -exec rm -f {} + \) -o \ + \( -type d -a -name autom4te.cache -prune -exec rm -rf {} + \) \) + rm -f *-stamp + dpkg-source -b uac +dpkg-source: info: using source format `3.0 (native)' +dpkg-source: info: building ubuntu-advantage-tools in ubuntu-advantage-tools_25.0.tar.gz +dpkg-source: info: building ubuntu-advantage-tools in ubuntu-advantage-tools_25.0.dsc + debian/rules build +dh build --with python3,bash-completion,systemd --buildsystem=pybuild \ + --no-start + dh_testdir -O--buildsystem=pybuild -O--no-start + dh_auto_configure -O--buildsystem=pybuild -O--no-start + pybuild --configure -i python{version} -p 3.4 --dir . +I: pybuild base:170: python3.4 setup.py config +running config + debian/rules override_dh_auto_build +make[1]: Entering directory `/tmp/uac' +dh_auto_build + pybuild --build -i python{version} -p 3.4 --dir . +I: pybuild base:170: /usr/bin/python3 setup.py build +running build +running build_py +creating /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient +copying uaclient/cli.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient +copying uaclient/defaults.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient +copying uaclient/exceptions.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient +copying uaclient/status.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient +copying uaclient/__init__.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient +copying uaclient/util.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient +copying uaclient/apt.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient +copying uaclient/version.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient +copying uaclient/config.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient +copying uaclient/conftest.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient +copying uaclient/serviceclient.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient +copying uaclient/gpg.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient +copying uaclient/contract.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient +copying uaclient/pip.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient +creating /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements +copying uaclient/entitlements/__init__.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements +copying uaclient/entitlements/cc.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements +copying uaclient/entitlements/esm.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements +copying uaclient/entitlements/fips.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements +copying uaclient/entitlements/repo.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements +copying uaclient/entitlements/base.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements +copying uaclient/entitlements/livepatch.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements +copying uaclient/entitlements/cis.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements +creating /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/clouds +copying uaclient/clouds/__init__.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/clouds +copying uaclient/clouds/azure.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/clouds +copying uaclient/clouds/aws.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/clouds +copying uaclient/clouds/identity.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/clouds +make -C apt-hook build +make[2]: Entering directory `/tmp/uac/apt-hook' +g++ -Wall -Wextra -pedantic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -o hook hook.cc -lapt-pkg +xgettext hook.cc -o ubuntu-advantage.pot +make[2]: Leaving directory `/tmp/uac/apt-hook' +make[1]: Leaving directory `/tmp/uac' + debian/rules override_dh_auto_test +make[1]: Entering directory `/tmp/uac' +python3 -m pytest +============================= test session starts ============================== +platform linux -- Python 3.4.3 -- pytest-2.5.1 +collected 721 items + +test-requirements.txt . +uaclient/clouds/tests/test_aws.py .............. +uaclient/clouds/tests/test_azure.py ......... +uaclient/clouds/tests/test_identity.py ..................... +uaclient/entitlements/tests/test_base.py .................................. +uaclient/entitlements/tests/test_cc.py ....... +uaclient/entitlements/tests/test_cis.py .. +uaclient/entitlements/tests/test_esm.py ........................ +uaclient/entitlements/tests/test_fips.py .................................................................................................... +uaclient/entitlements/tests/test_livepatch.py ........................................ +uaclient/entitlements/tests/test_repo.py ............................................... +uaclient/tests/test_apt.py .............................................................. +uaclient/tests/test_cli.py ................................ +uaclient/tests/test_cli_attach.py ................ +uaclient/tests/test_cli_auto_attach.py ................ +uaclient/tests/test_cli_detach.py ............... +uaclient/tests/test_cli_disable.py ................ +uaclient/tests/test_cli_enable.py .................................... +uaclient/tests/test_cli_refresh.py .... +uaclient/tests/test_cli_status.py ....... +uaclient/tests/test_config.py ......................................................................................... +uaclient/tests/test_contract.py .................... +uaclient/tests/test_gpg.py .. +uaclient/tests/test_pip.py ..... +uaclient/tests/test_serviceclient.py ... +uaclient/tests/test_status.py ..................... +uaclient/tests/test_util.py ........................................................................... +uaclient/tests/test_version.py ... + +========================= 721 passed in 29.08 seconds ========================== +# required for Trusty: flake8 does not install a __main__ for -m +# invocation +python3 /usr/bin/flake8 uaclient +make[1]: Leaving directory `/tmp/uac' + debian/rules binary +dh binary --with python3,bash-completion,systemd --buildsystem=pybuild \ + --no-start + dh_testroot -O--buildsystem=pybuild -O--no-start + dh_prep -O--buildsystem=pybuild -O--no-start + rm -f debian/ubuntu-advantage-tools.substvars + rm -f debian/ubuntu-advantage-tools.*.debhelper + rm -rf debian/ubuntu-advantage-tools/ + rm -f debian/ubuntu-advantage-pro.substvars + rm -f debian/ubuntu-advantage-pro.*.debhelper + rm -rf debian/ubuntu-advantage-pro/ + debian/rules override_dh_auto_install +make[1]: Entering directory `/tmp/uac' +dh_auto_install --destdir=debian/ubuntu-advantage-tools + install -d debian/ubuntu-advantage-tools + install -d debian/ubuntu-advantage-pro + pybuild --install -i python{version} -p 3.4 --dir . --dest-dir /tmp/uac/debian/ubuntu-advantage-tools +I: pybuild base:170: /usr/bin/python3 setup.py install --root /tmp/uac/debian/ubuntu-advantage-tools +running install +running build +running build_py +running install_lib +creating /tmp/uac/debian/ubuntu-advantage-tools/usr +creating /tmp/uac/debian/ubuntu-advantage-tools/usr/lib +creating /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4 +creating /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages +creating /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/cli.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/defaults.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/exceptions.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/status.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/__init__.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/util.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/apt.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/version.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/config.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/conftest.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/serviceclient.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/gpg.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient +creating /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements/__init__.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements/cc.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements/esm.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements/fips.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements/repo.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements/base.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements/livepatch.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements/cis.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/contract.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient +creating /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/clouds +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/clouds/__init__.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/clouds +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/clouds/azure.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/clouds +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/clouds/aws.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/clouds +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/clouds/identity.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/clouds +copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/pip.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/cli.py to cli.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/defaults.py to defaults.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/exceptions.py to exceptions.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/status.py to status.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/__init__.py to __init__.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/util.py to util.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/apt.py to apt.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/version.py to version.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/config.py to config.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/conftest.py to conftest.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/serviceclient.py to serviceclient.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/gpg.py to gpg.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements/__init__.py to __init__.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements/cc.py to cc.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements/esm.py to esm.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements/fips.py to fips.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements/repo.py to repo.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements/base.py to base.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements/livepatch.py to livepatch.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements/cis.py to cis.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/contract.py to contract.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/clouds/__init__.py to __init__.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/clouds/azure.py to azure.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/clouds/aws.py to aws.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/clouds/identity.py to identity.cpython-34.pyc +byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/pip.py to pip.cpython-34.pyc +running install_data +creating /tmp/uac/debian/ubuntu-advantage-tools/etc +creating /tmp/uac/debian/ubuntu-advantage-tools/etc/ubuntu-advantage +copying uaclient.conf -> /tmp/uac/debian/ubuntu-advantage-tools/etc/ubuntu-advantage +creating /tmp/uac/debian/ubuntu-advantage-tools/usr/share +creating /tmp/uac/debian/ubuntu-advantage-tools/usr/share/keyrings +copying keyrings/ubuntu-advantage-esm-apps.gpg -> /tmp/uac/debian/ubuntu-advantage-tools/usr/share/keyrings +copying keyrings/ubuntu-advantage-fips.gpg -> /tmp/uac/debian/ubuntu-advantage-tools/usr/share/keyrings +copying keyrings/ubuntu-advantage-esm-infra-trusty.gpg -> /tmp/uac/debian/ubuntu-advantage-tools/usr/share/keyrings +creating /tmp/uac/debian/ubuntu-advantage-tools/var +creating /tmp/uac/debian/ubuntu-advantage-tools/var/lib +creating /tmp/uac/debian/ubuntu-advantage-tools/var/lib/ubuntu-advantage +creating /tmp/uac/debian/ubuntu-advantage-tools/etc/apt +creating /tmp/uac/debian/ubuntu-advantage-tools/etc/apt/apt.conf.d +copying apt.conf.d/51ubuntu-advantage-esm -> /tmp/uac/debian/ubuntu-advantage-tools/etc/apt/apt.conf.d +creating /tmp/uac/debian/ubuntu-advantage-tools/etc/init +copying upstart/ua-auto-attach.conf -> /tmp/uac/debian/ubuntu-advantage-tools/etc/init +running install_egg_info +running egg_info +creating ubuntu_advantage_tools.egg-info +writing top-level names to ubuntu_advantage_tools.egg-info/top_level.txt +writing ubuntu_advantage_tools.egg-info/PKG-INFO +writing entry points to ubuntu_advantage_tools.egg-info/entry_points.txt +writing requirements to ubuntu_advantage_tools.egg-info/requires.txt +writing dependency_links to ubuntu_advantage_tools.egg-info/dependency_links.txt +writing manifest file 'ubuntu_advantage_tools.egg-info/SOURCES.txt' +reading manifest file 'ubuntu_advantage_tools.egg-info/SOURCES.txt' +reading manifest template 'MANIFEST.in' +writing manifest file 'ubuntu_advantage_tools.egg-info/SOURCES.txt' +Copying ubuntu_advantage_tools.egg-info to /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/ubuntu_advantage_tools-20.3.egg-info +running install_scripts +Installing ubuntu-advantage script to /tmp/uac/debian/ubuntu-advantage-tools/usr/bin +Installing ua script to /tmp/uac/debian/ubuntu-advantage-tools/usr/bin +flist=$(find /tmp/uac/debian/ -type f -name version.py) && sed -i 's,@@PACKAGED_VERSION@@,25.0,' ${flist:-did-not-find-version-py-for-replacement} +make -C apt-hook DESTDIR=/tmp/uac/debian/ubuntu-advantage-tools install +make[2]: Entering directory `/tmp/uac/apt-hook' +install -D -m 644 20apt-esm-hook.conf /tmp/uac/debian/ubuntu-advantage-tools/etc/apt/apt.conf.d/20apt-esm-hook.conf +install -D -m 755 hook /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/ubuntu-advantage/apt-esm-hook +make[2]: Leaving directory `/tmp/uac/apt-hook' +# Move ua-auto-attach.conf to ubuntu-advantage-pro +mkdir -p debian/ubuntu-advantage-pro/etc/init +mv debian/ubuntu-advantage-tools/etc/init/ua-auto-attach.conf debian/ubuntu-advantage-pro/etc/init/ +rmdir debian/ubuntu-advantage-tools/etc/init +make[1]: Leaving directory `/tmp/uac' + dh_installdocs -O--buildsystem=pybuild -O--no-start + install -g 0 -o 0 -d debian/ubuntu-advantage-tools/usr/share/doc/ubuntu-advantage-tools + install -g 0 -o 0 -m 644 -p debian/copyright debian/ubuntu-advantage-tools/usr/share/doc/ubuntu-advantage-tools/copyright + install -g 0 -o 0 -d debian/ubuntu-advantage-pro/usr/share/doc/ubuntu-advantage-pro + install -g 0 -o 0 -m 644 -p debian/copyright debian/ubuntu-advantage-pro/usr/share/doc/ubuntu-advantage-pro/copyright + dh_installchangelogs -O--buildsystem=pybuild -O--no-start + install -o 0 -g 0 -p -m644 debian/changelog debian/ubuntu-advantage-tools/usr/share/doc/ubuntu-advantage-tools/changelog + install -o 0 -g 0 -p -m644 debian/changelog debian/ubuntu-advantage-pro/usr/share/doc/ubuntu-advantage-pro/changelog + dh_installman -O--buildsystem=pybuild -O--no-start + install -d debian/ubuntu-advantage-tools/usr/share/man/man1/ + install -p -m644 ubuntu-advantage.1 debian/ubuntu-advantage-tools/usr/share/man/man1/ubuntu-advantage.1 + man --recode UTF-8 ./ubuntu\-advantage\.1 > ubuntu\-advantage\.1\.new + chmod 644 ubuntu-advantage.1.new + mv -f ubuntu-advantage.1.new ubuntu-advantage.1 + dh_bash-completion -O--buildsystem=pybuild -O--no-start + install -d debian/ubuntu-advantage-tools/etc/bash_completion.d + installing tools/ua.bash as ua + install -p -m644 ./tools/ua.bash debian/ubuntu-advantage-tools/etc/bash_completion.d/ua + dh_installdebconf -O--buildsystem=pybuild -O--no-start + install -o 0 -g 0 -d debian/ubuntu-advantage-tools/DEBIAN + install -o 0 -g 0 -m 644 -p debian/ubuntu-advantage-tools.templates debian/ubuntu-advantage-tools/DEBIAN/templates + (grep -s -v misc:Depends debian/ubuntu-advantage-tools.substvars; echo "misc:Depends=debconf (>= 0.5) | debconf-2.0") > debian/ubuntu-advantage-tools.substvars.new + mv debian/ubuntu-advantage-tools.substvars.new debian/ubuntu-advantage-tools.substvars + echo "# Automatically added by dh_installdebconf">> debian/ubuntu-advantage-tools.postrm.debhelper + sed "" /usr/share/debhelper/autoscripts/postrm-debconf >> debian/ubuntu-advantage-tools.postrm.debhelper + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postrm.debhelper + install -o 0 -g 0 -d debian/ubuntu-advantage-pro/DEBIAN + dh_python3 -O--buildsystem=pybuild -O--no-start +D: dh_python3 dh_python3:149: version: 1.20140128-1ubuntu8.2 +D: dh_python3 dh_python3:150: argv: ['/usr/bin/dh_python3', '-O--buildsystem=pybuild', '-O--no-start'] +D: dh_python3 dh_python3:151: options: {'arch': None, 'ignore_shebangs': False, 'suggests': None, 'clean_dbg_pkg': True, 'package': None, 'vrange': None, 'compile_all': False, 'O': '--no-start', 'skip_private': False, 'verbose': False, 'no_package': None, 'depends': None, 'recommends': None, 'guess_deps': True, 'no_ext_rename': False, 'requires': None, 'no_shebang_rewrite': False, 'regexpr': None, 'shebang': None} +D: dh_python3 dh_python3:152: args: [] +D: dh_python3 dh_python3:154: supported Python versions: 3.4 (default=3.4) +D: dh_python3 debhelper:98: source=ubuntu-advantage-tools, binary packages=['ubuntu-advantage-tools', 'ubuntu-advantage-pro'] +D: dh_python3 dh_python3:171: processing package ubuntu-advantage-tools... +D: dh_python3 fs:47: moving files from debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages to debian/ubuntu-advantage-tools/usr/lib/python3/dist-packages/ +D: dh_python3 fs:219: package ubuntu-advantage-tools details = {'nsp.txt': set(), 'ext_vers': set(), 'compile': True, 'public_vers': {Version('3')}, 'private_dirs': {}, 'ext_no_version': set(), 'shebangs': {/usr/bin/python3, /usr/bin/python3}, 'requires.txt': {'debian/ubuntu-advantage-tools/usr/lib/python3/dist-packages/ubuntu_advantage_tools-20.3.egg-info/requires.txt'}} +D: dh_python3 depends:107: generating dependencies for package ubuntu-advantage-tools +D: dh_python3 pydist:119: trying to guess dependency for pyyaml (python=None) +D: dh_python3 depends:236: D={'python3', 'python3-yaml', 'python3:any (>= 3.3.2-2~)'}; R=[]; S=[]; E=[], B=[]; RT=[] +D: dh_python3 dh_python3:171: processing package ubuntu-advantage-pro... +D: dh_python3 fs:219: package ubuntu-advantage-pro details = {'nsp.txt': set(), 'ext_vers': set(), 'compile': False, 'public_vers': set(), 'private_dirs': {}, 'ext_no_version': set(), 'shebangs': set(), 'requires.txt': set()} +D: dh_python3 depends:107: generating dependencies for package ubuntu-advantage-pro +D: dh_python3 depends:236: D=set(); R=[]; S=[]; E=[], B=[]; RT=[] + dh_systemd_enable -O--buildsystem=pybuild -O--no-start + dh_systemd_start -O--buildsystem=pybuild -O--no-start + dh_installlogrotate -O--buildsystem=pybuild -O--no-start + install -o 0 -g 0 -d debian/ubuntu-advantage-tools/etc/logrotate.d + install -m 644 debian/ubuntu-advantage-tools.logrotate debian/ubuntu-advantage-tools/etc/logrotate.d/ubuntu-advantage-tools + dh_perl -O--buildsystem=pybuild -O--no-start + dh_link -O--buildsystem=pybuild -O--no-start + rm -f debian/ubuntu-advantage-tools/usr/share/man/man1/ua.1 + ln -sf ubuntu-advantage.1 debian/ubuntu-advantage-tools/usr/share/man/man1/ua.1 + rm -f debian/ubuntu-advantage-tools/usr/bin/ua + ln -sf ubuntu-advantage debian/ubuntu-advantage-tools/usr/bin/ua + dh_compress -O--buildsystem=pybuild -O--no-start + cd debian/ubuntu-advantage-tools + chmod a-x usr/share/man/man1/ubuntu-advantage.1 usr/share/doc/ubuntu-advantage-tools/changelog + gzip -9nf usr/share/man/man1/ubuntu-advantage.1 usr/share/doc/ubuntu-advantage-tools/changelog + cd '/tmp/uac' + rm -f debian/ubuntu-advantage-tools/usr/share/man/man1/ua.1 + ln -sf ubuntu-advantage.1.gz debian/ubuntu-advantage-tools/usr/share/man/man1/ua.1.gz + cd debian/ubuntu-advantage-pro + chmod a-x usr/share/doc/ubuntu-advantage-pro/changelog + gzip -9nf usr/share/doc/ubuntu-advantage-pro/changelog + cd '/tmp/uac' + dh_fixperms -O--buildsystem=pybuild -O--no-start + find debian/ubuntu-advantage-tools -print0 2>/dev/null | xargs -0r chown --no-dereference 0:0 + find debian/ubuntu-advantage-tools ! -type l -print0 2>/dev/null | xargs -0r chmod go=rX,u+rw,a-s + find debian/ubuntu-advantage-tools/usr/share/doc -type f ! -regex 'debian/ubuntu-advantage-tools/usr/share/doc/[^/]*/examples/.*' -print0 2>/dev/null | xargs -0r chmod 644 + find debian/ubuntu-advantage-tools/usr/share/doc -type d -print0 2>/dev/null | xargs -0r chmod 755 + find debian/ubuntu-advantage-tools/usr/share/man debian/ubuntu-advantage-tools/usr/man/ debian/ubuntu-advantage-tools/usr/X11*/man/ -type f -print0 2>/dev/null | xargs -0r chmod 644 + find debian/ubuntu-advantage-tools -perm -5 -type f \( -name '*.so.*' -or -name '*.so' -or -name '*.la' -or -name '*.a' \) -print0 2>/dev/null | xargs -0r chmod 644 + find debian/ubuntu-advantage-tools/usr/include -type f -print0 2>/dev/null | xargs -0r chmod 644 + find debian/ubuntu-advantage-tools/usr/share/applications -type f -print0 2>/dev/null | xargs -0r chmod 644 + find debian/ubuntu-advantage-tools -perm -5 -type f \( -name '*.cmxs' \) -print0 2>/dev/null | xargs -0r chmod 644 + find debian/ubuntu-advantage-tools/usr/lib/perl5 debian/ubuntu-advantage-tools/usr/share/perl5 -type f -perm -5 -name '*.pm' -print0 2>/dev/null | xargs -0r chmod a-X + find debian/ubuntu-advantage-tools/usr/bin -type f -print0 2>/dev/null | xargs -0r chmod a+x + find debian/ubuntu-advantage-tools/usr/lib -type f -name '*.ali' -print0 2>/dev/null | xargs -0r chmod uga-w + find debian/ubuntu-advantage-pro -print0 2>/dev/null | xargs -0r chown --no-dereference 0:0 + find debian/ubuntu-advantage-pro ! -type l -print0 2>/dev/null | xargs -0r chmod go=rX,u+rw,a-s + find debian/ubuntu-advantage-pro/usr/share/doc -type f ! -regex 'debian/ubuntu-advantage-pro/usr/share/doc/[^/]*/examples/.*' -print0 2>/dev/null | xargs -0r chmod 644 + find debian/ubuntu-advantage-pro/usr/share/doc -type d -print0 2>/dev/null | xargs -0r chmod 755 + find debian/ubuntu-advantage-pro/usr/share/man debian/ubuntu-advantage-pro/usr/man/ debian/ubuntu-advantage-pro/usr/X11*/man/ -type f -print0 2>/dev/null | xargs -0r chmod 644 + find debian/ubuntu-advantage-pro -perm -5 -type f \( -name '*.so.*' -or -name '*.so' -or -name '*.la' -or -name '*.a' \) -print0 2>/dev/null | xargs -0r chmod 644 + find debian/ubuntu-advantage-pro/usr/include -type f -print0 2>/dev/null | xargs -0r chmod 644 + find debian/ubuntu-advantage-pro/usr/share/applications -type f -print0 2>/dev/null | xargs -0r chmod 644 + find debian/ubuntu-advantage-pro -perm -5 -type f \( -name '*.cmxs' \) -print0 2>/dev/null | xargs -0r chmod 644 + find debian/ubuntu-advantage-pro/usr/lib/perl5 debian/ubuntu-advantage-pro/usr/share/perl5 -type f -perm -5 -name '*.pm' -print0 2>/dev/null | xargs -0r chmod a-X + find debian/ubuntu-advantage-pro/usr/lib -type f -name '*.ali' -print0 2>/dev/null | xargs -0r chmod uga-w + dh_strip -O--buildsystem=pybuild -O--no-start + strip --remove-section=.comment --remove-section=.note debian/ubuntu-advantage-tools/usr/lib/ubuntu-advantage/apt-esm-hook + dh_makeshlibs -O--buildsystem=pybuild -O--no-start + rm -f debian/ubuntu-advantage-tools/DEBIAN/shlibs + rm -f debian/ubuntu-advantage-pro/DEBIAN/shlibs + dh_shlibdeps -O--buildsystem=pybuild -O--no-start + dpkg-shlibdeps -Tdebian/ubuntu-advantage-tools.substvars debian/ubuntu-advantage-tools/usr/lib/ubuntu-advantage/apt-esm-hook + dh_installdeb -O--buildsystem=pybuild -O--no-start + echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.postinst.debhelper + sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/99-esm 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postinst.debhelper + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postinst.debhelper + echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.preinst.debhelper + sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/99-esm 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.preinst.debhelper + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.preinst.debhelper + echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.prerm.debhelper.new + sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/99-esm 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.prerm.debhelper.new + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.prerm.debhelper.new + cat debian/ubuntu-advantage-tools.prerm.debhelper >> debian/ubuntu-advantage-tools.prerm.debhelper.new + mv debian/ubuntu-advantage-tools.prerm.debhelper.new debian/ubuntu-advantage-tools.prerm.debhelper + echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.postrm.debhelper.new + sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/99-esm 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postrm.debhelper.new + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postrm.debhelper.new + cat debian/ubuntu-advantage-tools.postrm.debhelper >> debian/ubuntu-advantage-tools.postrm.debhelper.new + mv debian/ubuntu-advantage-tools.postrm.debhelper.new debian/ubuntu-advantage-tools.postrm.debhelper + echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.postinst.debhelper + sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/80-esm 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postinst.debhelper + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postinst.debhelper + echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.preinst.debhelper + sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/80-esm 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.preinst.debhelper + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.preinst.debhelper + echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.prerm.debhelper.new + sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/80-esm 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.prerm.debhelper.new + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.prerm.debhelper.new + cat debian/ubuntu-advantage-tools.prerm.debhelper >> debian/ubuntu-advantage-tools.prerm.debhelper.new + mv debian/ubuntu-advantage-tools.prerm.debhelper.new debian/ubuntu-advantage-tools.prerm.debhelper + echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.postrm.debhelper.new + sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/80-esm 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postrm.debhelper.new + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postrm.debhelper.new + cat debian/ubuntu-advantage-tools.postrm.debhelper >> debian/ubuntu-advantage-tools.postrm.debhelper.new + mv debian/ubuntu-advantage-tools.postrm.debhelper.new debian/ubuntu-advantage-tools.postrm.debhelper + echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.postinst.debhelper + sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/80-livepatch 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postinst.debhelper + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postinst.debhelper + echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.preinst.debhelper + sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/80-livepatch 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.preinst.debhelper + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.preinst.debhelper + echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.prerm.debhelper.new + sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/80-livepatch 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.prerm.debhelper.new + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.prerm.debhelper.new + cat debian/ubuntu-advantage-tools.prerm.debhelper >> debian/ubuntu-advantage-tools.prerm.debhelper.new + mv debian/ubuntu-advantage-tools.prerm.debhelper.new debian/ubuntu-advantage-tools.prerm.debhelper + echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.postrm.debhelper.new + sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/80-livepatch 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postrm.debhelper.new + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postrm.debhelper.new + cat debian/ubuntu-advantage-tools.postrm.debhelper >> debian/ubuntu-advantage-tools.postrm.debhelper.new + mv debian/ubuntu-advantage-tools.postrm.debhelper.new debian/ubuntu-advantage-tools.postrm.debhelper + echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.postinst.debhelper + sed "s!#PARAMS#!rm_conffile /etc/cron.daily/ubuntu-advantage-tools 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postinst.debhelper + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postinst.debhelper + echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.preinst.debhelper + sed "s!#PARAMS#!rm_conffile /etc/cron.daily/ubuntu-advantage-tools 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.preinst.debhelper + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.preinst.debhelper + echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.prerm.debhelper.new + sed "s!#PARAMS#!rm_conffile /etc/cron.daily/ubuntu-advantage-tools 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.prerm.debhelper.new + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.prerm.debhelper.new + cat debian/ubuntu-advantage-tools.prerm.debhelper >> debian/ubuntu-advantage-tools.prerm.debhelper.new + mv debian/ubuntu-advantage-tools.prerm.debhelper.new debian/ubuntu-advantage-tools.prerm.debhelper + echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.postrm.debhelper.new + sed "s!#PARAMS#!rm_conffile /etc/cron.daily/ubuntu-advantage-tools 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postrm.debhelper.new + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postrm.debhelper.new + cat debian/ubuntu-advantage-tools.postrm.debhelper >> debian/ubuntu-advantage-tools.postrm.debhelper.new + mv debian/ubuntu-advantage-tools.postrm.debhelper.new debian/ubuntu-advantage-tools.postrm.debhelper + echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.postinst.debhelper + sed "s!#PARAMS#!rm_conffile /etc/init/ua-auto-attach.conf 20.2\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postinst.debhelper + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postinst.debhelper + echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.preinst.debhelper + sed "s!#PARAMS#!rm_conffile /etc/init/ua-auto-attach.conf 20.2\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.preinst.debhelper + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.preinst.debhelper + echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.prerm.debhelper.new + sed "s!#PARAMS#!rm_conffile /etc/init/ua-auto-attach.conf 20.2\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.prerm.debhelper.new + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.prerm.debhelper.new + cat debian/ubuntu-advantage-tools.prerm.debhelper >> debian/ubuntu-advantage-tools.prerm.debhelper.new + mv debian/ubuntu-advantage-tools.prerm.debhelper.new debian/ubuntu-advantage-tools.prerm.debhelper + echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.postrm.debhelper.new + sed "s!#PARAMS#!rm_conffile /etc/init/ua-auto-attach.conf 20.2\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postrm.debhelper.new + echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postrm.debhelper.new + cat debian/ubuntu-advantage-tools.postrm.debhelper >> debian/ubuntu-advantage-tools.postrm.debhelper.new + mv debian/ubuntu-advantage-tools.postrm.debhelper.new debian/ubuntu-advantage-tools.postrm.debhelper + perl -pe 's~#DEBHELPER#~qx{cat debian/ubuntu-advantage-tools.postinst.debhelper}~eg' < debian/postinst > debian/ubuntu-advantage-tools/DEBIAN/postinst + chown 0:0 debian/ubuntu-advantage-tools/DEBIAN/postinst + chmod 755 debian/ubuntu-advantage-tools/DEBIAN/postinst + printf '#!/bin/sh +set -e +' > debian/ubuntu-advantage-tools/DEBIAN/preinst + cat debian/ubuntu-advantage-tools.preinst.debhelper >> debian/ubuntu-advantage-tools/DEBIAN/preinst + chown 0:0 debian/ubuntu-advantage-tools/DEBIAN/preinst + chmod 755 debian/ubuntu-advantage-tools/DEBIAN/preinst + perl -pe 's~#DEBHELPER#~qx{cat debian/ubuntu-advantage-tools.prerm.debhelper}~eg' < debian/prerm > debian/ubuntu-advantage-tools/DEBIAN/prerm + chown 0:0 debian/ubuntu-advantage-tools/DEBIAN/prerm + chmod 755 debian/ubuntu-advantage-tools/DEBIAN/prerm + perl -pe 's~#DEBHELPER#~qx{cat debian/ubuntu-advantage-tools.postrm.debhelper}~eg' < debian/postrm > debian/ubuntu-advantage-tools/DEBIAN/postrm + chown 0:0 debian/ubuntu-advantage-tools/DEBIAN/postrm + chmod 755 debian/ubuntu-advantage-tools/DEBIAN/postrm + find debian/ubuntu-advantage-tools/etc -type f -printf '/etc/%P +' >> debian/ubuntu-advantage-tools/DEBIAN/conffiles + chmod 644 debian/ubuntu-advantage-tools/DEBIAN/conffiles + find debian/ubuntu-advantage-pro/etc -type f -printf '/etc/%P +' >> debian/ubuntu-advantage-pro/DEBIAN/conffiles + chmod 644 debian/ubuntu-advantage-pro/DEBIAN/conffiles + debian/rules override_dh_gencontrol +make[1]: Entering directory `/tmp/uac' +[ -z '"apt (>= 1.0.1ubuntu2.23), apt-transport-https (>= 1.0.1ubuntu2.23), apt-utils (>= 1.0.1ubuntu2.23), libapt-inst1.5 (>= 1.0.1ubuntu2.23), libapt-pkg4.12 (>= 1.0.1ubuntu2.23) "' ] || echo extra:Depends="apt (>= 1.0.1ubuntu2.23), apt-transport-https (>= 1.0.1ubuntu2.23), apt-utils (>= 1.0.1ubuntu2.23), libapt-inst1.5 (>= 1.0.1ubuntu2.23), libapt-pkg4.12 (>= 1.0.1ubuntu2.23) " >> debian/ubuntu-advantage-tools.substvars +dh_gencontrol + dpkg-gencontrol -pubuntu-advantage-tools -ldebian/changelog -Tdebian/ubuntu-advantage-tools.substvars -Pdebian/ubuntu-advantage-tools +dpkg-gencontrol: warning: File::FcntlLock not available; using flock which is not NFS-safe + chmod 644 debian/ubuntu-advantage-tools/DEBIAN/control + chown 0:0 debian/ubuntu-advantage-tools/DEBIAN/control + echo misc:Depends= >> debian/ubuntu-advantage-pro.substvars + dpkg-gencontrol -pubuntu-advantage-pro -ldebian/changelog -Tdebian/ubuntu-advantage-pro.substvars -Pdebian/ubuntu-advantage-pro +dpkg-gencontrol: warning: File::FcntlLock not available; using flock which is not NFS-safe + chmod 644 debian/ubuntu-advantage-pro/DEBIAN/control + chown 0:0 debian/ubuntu-advantage-pro/DEBIAN/control +make[1]: Leaving directory `/tmp/uac' + dh_md5sums -O--buildsystem=pybuild -O--no-start + (cd debian/ubuntu-advantage-tools >/dev/null ; find . -type f ! -path "./etc/ubuntu-advantage/uaclient.conf" ! -path "./etc/bash_completion.d/ua" ! -path "./etc/apt/apt.conf.d/20apt-esm-hook.conf" ! -path "./etc/apt/apt.conf.d/51ubuntu-advantage-esm" ! -path "./etc/logrotate.d/ubuntu-advantage-tools" ! -regex './DEBIAN/.*' -printf '%P\0' | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums) >/dev/null + chmod 644 debian/ubuntu-advantage-tools/DEBIAN/md5sums + chown 0:0 debian/ubuntu-advantage-tools/DEBIAN/md5sums + (cd debian/ubuntu-advantage-pro >/dev/null ; find . -type f ! -path "./etc/init/ua-auto-attach.conf" ! -regex './DEBIAN/.*' -printf '%P\0' | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums) >/dev/null + chmod 644 debian/ubuntu-advantage-pro/DEBIAN/md5sums + chown 0:0 debian/ubuntu-advantage-pro/DEBIAN/md5sums + dh_builddeb -O--buildsystem=pybuild -O--no-start + dpkg-deb --build debian/ubuntu-advantage-tools .. +dpkg-deb: building package `ubuntu-advantage-tools' in `../ubuntu-advantage-tools_25.0_amd64.deb'. + dpkg-deb --build debian/ubuntu-advantage-pro .. +dpkg-deb: building package `ubuntu-advantage-pro' in `../ubuntu-advantage-pro_25.0_amd64.deb'. + dpkg-genchanges >../ubuntu-advantage-tools_25.0_amd64.changes +dpkg-genchanges: including full source code in upload + dpkg-source --after-build uac +dpkg-buildpackage: full upload; Debian-native package (full source is included) ++ multipass transfer trusty-uac-build:/tmp/ubuntu-advantage-tools_25.0_amd64.deb /tmp/ ++ multipass transfer /tmp/ubuntu-advantage-tools_25.0_amd64.deb trusty-uac:/tmp/ ++ multipass exec trusty-uac -- sudo apt-get remove ubuntu-advantage-tools --assume-yes +Reading package lists... +Building dependency tree... +Reading state information... +The following packages were automatically installed and are no longer required: + python3-pkg-resources python3-yaml +Use 'apt-get autoremove' to remove them. +The following packages will be REMOVED: + ubuntu-advantage-tools ubuntu-minimal +0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded. +After this operation, 338 kB disk space will be freed. +(Reading database ... 86407 files and directories currently installed.) +Removing ubuntu-minimal (1.325.1) ... +Removing ubuntu-advantage-tools (19.6~ubuntu14.04.3) ... +Processing triggers for man-db (2.6.7.1-1ubuntu1) ... ++ multipass exec trusty-uac -- sudo dpkg -i /tmp/ubuntu-advantage-tools_25.0_amd64.deb +Selecting previously unselected package ubuntu-advantage-tools. +(Reading database ... 86364 files and directories currently installed.) +Preparing to unpack .../ubuntu-advantage-tools_25.0_amd64.deb ... +Unpacking ubuntu-advantage-tools (25.0) ... +Setting up ubuntu-advantage-tools (25.0) ... +Installing new version of config file /etc/apt/apt.conf.d/51ubuntu-advantage-esm ... +Processing triggers for man-db (2.6.7.1-1ubuntu1) ... +++ multipass exec trusty-uac -- ua version ++ uac_version=25.0 ++ [[ 25.0 == 25.0* ]] ++ echo 'SUCCESS: uaclient was successfully updated to: 25.0' +SUCCESS: uaclient was successfully updated to: 25.0 ++ multipass delete trusty-uac-build ++ multipass purge ++ check_livepatch_is_not_installed ++ multipass exec trusty-uac -- which canonical-livepatch +++ multipass exec trusty-uac -- echo 1 ++ return_code=1 ++ '[' 1 = 1 ']' ++ echo 'SUCESS: canonical-livepatch is not found before enabling it' +SUCESS: canonical-livepatch is not found before enabling it ++ attach_token_in_uaclient ++ multipass exec trusty-uac -- sudo ua attach +Enabling default service esm-infra +Updating package lists +ESM Infra enabled +This machine is now attached to 'lucas.moura128128@gmail.com' + +SERVICE ENTITLED STATUS DESCRIPTION +esm-apps no — UA Apps: Extended Security Maintenance +esm-infra yes enabled UA Infra: Extended Security Maintenance +livepatch yes disabled Canonical Livepatch service + +Enable services with: ua enable + + Account: lucas.moura128128@gmail.com +Subscription: lucas.moura128128@gmail.com ++ enable_livepatch ++ multipass exec trusty-uac -- sudo ua enable livepatch +One moment, checking your subscription first +Installing snapd +Updating package lists +Installing canonical-livepatch snap +Canonical livepatch enabled. ++ check_livepatch +++ multipass exec trusty-uac -- sudo canonical-livepatch status +++ grep running ++ return_str=' running: true' ++ expected_str=' running: true' ++ '[' ' running: true' = ' running: true' ']' ++ echo 'SUCCESS: livepatch was enabled and is running' +SUCCESS: livepatch was enabled and is running diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-26/xenial-enable-fips ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-26/xenial-enable-fips --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-26/xenial-enable-fips 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-26/xenial-enable-fips 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,188 @@ +=== Begin SRU Template === +[Impact] +When enabling FIPS in a system we expect it to also update the current kernel to a FIPS supported +one. We are now testing for Xenial if that is the scenario that we land up with after enabling FIPS +using uaclient. + +[Test Case] +``` +#!/bin/sh +set -x + +STAGING_CONTRACT_TOKEN= +series=xenial +name=$series-fips + +install_uac_from_branch() { + branch=$1 + pkg_name=ubuntu-advantage-tools_26.0_amd64.deb + + multipass exec $name -- sudo apt-get -yq update + multipass exec $name -- sudo apt-get -yq install git make + multipass exec $name -- git clone https://github.com/canonical/ubuntu-advantage-client.git /tmp/uac + multipass exec $name -- sh -c "cd /tmp/uac/ && git checkout $branch" + multipass exec $name -- sudo sh -c "cd /tmp/uac/ && make deps > /dev/null" + multipass exec $name -- sudo sh -c "cd /tmp/uac/ && dpkg-buildpackage -us -uc > /dev/null" + multipass exec $name -- sudo dpkg -i /tmp/$pkg_name +} + +configure_uac_to_use_staging_contract() { + multipass exec $name -- sudo sed -i 's/contracts.can/contracts.staging.can/' /etc/ubuntu-advantage/uaclient.conf +} + +enable_fips() { + multipass exec $name -- sudo ua attach $STAGING_CONTRACT_TOKEN + multipass exec $name -- sudo ua disable livepatch + multipass exec $name -- sudo ua enable fips --beta --assume-yes + multipass exec $name -- sudo apt update + + traceback_out=$(multipass exec $name -- grep Traceback /var/log/ubuntu-advantage.log) + + if [ -z "$traceback_out" ]; then + echo "SUCCESS: No Tracebacks found on ubuntu-advantage.log" + else + echo "FAILURE: Tracebacks found on ubuntu-advantage.log" + fi +} + +check_kernel_for_fips() { + kernel_version=$(multipass exec $name -- sh -c "uname -r | grep -o fips") + if [ "$kernel_version" = "fips" ]; then + echo "SUCCESS: Xenial kernel was updated to fips version" + else + echo "FAILURE: Xenial kernel was not updated to fips version" + fi + + fips_enabled=$(multipass exec $name -- cat /proc/sys/crypto/fips_enabled) + + if [ "$fips_enabled" = "1" ]; then + echo "SUCCESS: FIPS is shown as enabled in the system" + else + echo "FAILURE: FIPS is not shown as enabled in the system" + fi +} + +multipass delete $name +multipass purge +multipass launch $series --name $name + +install_uac_from_branch "update-fips" +configure_uac_to_use_staging_contract +enable_fips + +multipass exec $name -- sudo reboot +sleep 20 +multipass exec $name -- sudo ua status --all + +check_kernel_for_fips +``` + +=== Verification Log === + +Creating xenial-fips +Configuring xenial-fips +Starting xenial-fips +Waiting for initialization to complete +Launched: xenial-fips +Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB] +Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease +Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB] +Get:4 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [1,476 kB] +Get:5 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB] +Get:6 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7,532 kB] +Get:7 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [350 kB] +Get:8 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [773 kB] +Get:9 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [218 kB] +Get:10 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [8,236 B] +Get:11 http://security.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [2,888 B] +Get:12 http://archive.ubuntu.com/ubuntu xenial/universe Translation-en [4,354 kB] +Get:13 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [144 kB] +Get:14 http://archive.ubuntu.com/ubuntu xenial/multiverse Translation-en [106 kB] +Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [1,880 kB] +Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [454 kB] +Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [1,195 kB] +Get:18 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [348 kB] +Get:19 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [23.0 kB] +Get:20 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [8,632 B] +Get:21 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [9,812 B] +Get:22 http://archive.ubuntu.com/ubuntu xenial-backports/main Translation-en [4,456 B] +Get:23 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [11.3 kB] +Get:24 http://archive.ubuntu.com/ubuntu xenial-backports/universe Translation-en [4,476 B] +Fetched 19.2 MB in 5s (3,437 kB/s) +Reading package lists... +Reading package lists... +Building dependency tree... +Reading state information... +git is already the newest version (1:2.7.4-0ubuntu1.9). +Suggested packages: + make-doc +The following NEW packages will be installed: + make +0 upgraded, 1 newly installed, 0 to remove and 20 not upgraded. +Need to get 151 kB of archives. +After this operation, 365 kB of additional disk space will be used. +Get:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 make amd64 4.1-6 [151 kB] +Fetched 151 kB in 1s (111 kB/s) +Selecting previously unselected package make. +Preparing to unpack .../archives/make_4.1-6_amd64.deb ... +Unpacking make (4.1-6) ... +Processing triggers for man-db (2.7.5-1) ... +Setting up make (4.1-6) ... +Branch update-fips set up to track remote branch update-fips from origin. +(Reading database ... 59834 files and directories currently installed.) +Preparing to unpack .../ubuntu-advantage-tools_26.0_amd64.deb ... +Unpacking ubuntu-advantage-tools (26.0) over (10ubuntu0.16.04.1) ... +Setting up ubuntu-advantage-tools (26.0) ... +Removing obsolete conffile /etc/update-motd.d/99-esm ... +Processing triggers for man-db (2.7.5-1) ... +Updating package lists +ESM Apps enabled +Installing canonical-livepatch snap +Canonical livepatch enabled. +This machine is now attached to 'server-team-ua-client-ci-uaa' + +SERVICE ENTITLED STATUS DESCRIPTION +esm-infra no — UA Infra: Extended Security Maintenance (ESM) +livepatch yes enabled Canonical Livepatch service + +Enable services with: ua enable + + Account: server-team-ua-client-ci + Subscription: server-team-ua-client-ci-uaa + Valid until: n/a +Technical support level: essential +One moment, checking your subscription first +Updating package lists +Installing FIPS packages +FIPS enabled +A reboot is required to complete install +Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease +Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease +Hit:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease +Hit:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease +Hit:5 https://esm.staging.ubuntu.com/apps/ubuntu xenial-apps-security InRelease +Hit:6 https://esm.staging.ubuntu.com/apps/ubuntu xenial-apps-updates InRelease +Hit:7 https://esm.staging.ubuntu.com/fips/ubuntu xenial InRelease +Reading package lists... +Building dependency tree... +Reading state information... +5 of the updates are from UA Apps: ESM. +28 packages can be upgraded. Run 'apt list --upgradable' to see them. +SUCCESS: No Tracebacks found on ubuntu-advantage.log +SERVICE ENTITLED STATUS DESCRIPTION +cc-eal yes disabled Common Criteria EAL2 Provisioning Packages +cis-audit no — Center for Internet Security Audit Tools +esm-apps yes enabled UA Apps: Extended Security Maintenance (ESM) +esm-infra no — UA Infra: Extended Security Maintenance (ESM) +fips yes enabled NIST-certified FIPS modules +fips-updates yes disabled Uncertified security updates to FIPS modules +livepatch yes n/a Canonical Livepatch service + +Enable services with: ua enable + + Account: server-team-ua-client-ci + Subscription: server-team-ua-client-ci-uaa + Valid until: n/a +Technical support level: essential +SUCCESS: Xenial kernel was updated to fips version +SUCCESS: FIPS is shown as enabled in the system diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27/test_trusty_upgrade_to_xenial.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27/test_trusty_upgrade_to_xenial.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27/test_trusty_upgrade_to_xenial.sh 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27/test_trusty_upgrade_to_xenial.sh 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,47 @@ +#!/bin/sh + +# Test if upgrading from trusty machine already attached to xenial will keep +# services still enabled after the do-release-upgrade operation. Currently, +# this will not happen because the latest version of uaclient in trusty does +# not enable do-release-upgrade to run a post script that handles the services +# migration when performing an upgrade. +# This script is adding a solution for that problem by manually adding the necessary +# configs for do-release-upgrade (This configurations are done for release 26 forward) +set -x + +series=trusty +name=$series-upgrade-lxd + +function fix_upgrade_for_esm_infra() { + # This fix is better documented here: + # https://github.com/canonical/ubuntu-advantage-client/issues/1590 + multipass exec $name -- sh -c "echo 'Pockets=security,updates,proposed,backports,infra-security,infra-updates,apps-security,apps-updates' >> allow.cfg" + multipass exec $name -- sh -c "echo '[Distro]\nPostInstallScripts=./xorg_fix_proprietary.py, /usr/lib/ubuntu-advantage/upgrade_lts_contract.py' >> allow.cfg" +} + + +multipass delete $name +multipass purge +multipass launch $series --name $name + +multipass exec $name -- sudo apt-get upgrade -y +multipass exec $name -- sudo apt-get dist-upgrade -y +multipass exec $name -- ua version +multipass exec $name -- sudo ua attach $UACLIENT_BEHAVE_CONTRACT_TOKEN +multipass exec $name -- sudo ua status +multipass exec $name -- sudo sh -c "cat </etc/apt/sources.list.d/ubuntu-$series-proposed.list +deb http://archive.ubuntu.com/ubuntu/ $series-proposed restricted main multiverse universe" +multipass exec $name -- sudo apt-get update +multipass exec $name -- sudo mkdir -p /etc/update-manager/release-upgrades.d +multipass exec $name -- sh -c "echo '[Sources]\nAllowThirdParty=yes' > allow.cfg" + +fix_upgrade_for_esm_infra + +multipass exec $name -- sudo mv allow.cfg /etc/update-manager/release-upgrades.d +multipass exec $name -- sudo do-release-upgrade --frontend DistUpgradeViewNonInteractive +multipass exec $name -- sudo ua status +multipass exec $name -- sudo reboot + +multipass exec $name -- sudo reboot +sleep 60 +multipass exec $name -- sudo ua status --wait diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27/test_xenial_upgrade.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27/test_xenial_upgrade.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27/test_xenial_upgrade.sh 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27/test_xenial_upgrade.sh 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,226 @@ +#!/usr/bin/bash + +set -x +set -e +name=test-xenial-ua-upgrade +series=xenial + +function h1() { + set +x + echo "" + echo "" + echo "" + echo "############################################################################" + echo "## $1" + echo "############################################################################" + echo "" + set -x +} +function h2() { + set +x + echo "" + echo "" + echo "-> $1" + echo "----------------------------------------------------------------------------" + echo "" + set -x +} + + +function setup() { + tool=$1 + + h2 "Make sure we're up to date" + $tool exec $name -- sudo apt update + $tool exec $name -- sudo apt upgrade -y + $tool exec $name -- sudo apt install ubuntu-advantage-tools -y + + h2 "Initial State" + $tool exec $name -- apt-cache policy ubuntu-advantage-tools + $tool exec $name -- sudo ubuntu-advantage status + $tool exec $name -- dpkg-query -L ubuntu-advantage-tools +} +function setup_container() { + h1 "Setting up fresh container" + lxc delete --force $name || true + lxc launch ubuntu-daily:xenial $name + sleep 10 + + setup lxc +} +function setup_vm() { + h1 "Setting up fresh vm" + multipass delete -p $name || true + multipass launch -n $name xenial + sleep 10 + + setup multipass +} +function teardown_container() { + lxc delete --force $name || true +} +function teardown_vm() { + multipass delete -p $name || true +} + +function install_new_ua() { + tool=$1 + h2 "Set up to use daily ppa" + $tool exec $name -- sudo sh -c "cat </etc/apt/sources.list.d/ubuntu-$series-proposed.list + deb http://archive.ubuntu.com/ubuntu/ $series-proposed restricted main multiverse universe" + $tool exec $name -- sudo apt update + + h2 "Actually install - verify there are no errors" + $tool exec $name -- sudo apt install ubuntu-advantage-tools -y +} + +function attach_ua() { + tool=$1 + set +x + echo "+ $tool exec $name -- sudo ua attach \$UACLIENT_BEHAVE_CONTRACT_TOKEN" + $tool exec $name -- sudo ua attach $UACLIENT_BEHAVE_CONTRACT_TOKEN + set -x +} + + + + +function test_upgrade_in_container() { + setup_container + + h1 "Upgrade to UA 27 while unattached" + + install_new_ua lxc + + h2 "Check for leftover files from old version - verify nothing unexpected is left behind" + lxc exec $name -- ls -l /etc/update-motd.d/99-esm /usr/share/keyrings/ubuntu-esm-keyring.gpg /usr/share/keyrings/ubuntu-fips-keyring.gpg /usr/share/man/man1/ubuntu-advantage.1.gz /usr/share/doc/ubuntu-advantage-tools/copyright /usr/share/doc/ubuntu-advantage-tools/changelog.gz /usr/bin/ubuntu-advantage || true + + h2 "New Status - verify esm-infra available but not enabled; esm-apps not visible" + lxc exec $name -- ua status + + h2 "Attach - verify esm-infra automatically enabled; esm-apps not visible" + attach_ua lxc + + h2 "Detaching before destruction" + lxc exec $name -- ua detach --assume-yes + + teardown_container +} + + +function test_upgrade_with_livepatch_in_vm() { + + setup_vm + + h1 "Upgrade to UA 27 while old version has livepatch enabled" + + h2 "Enable livepatch on old version" + set +x + echo "+ multipass exec $name -- ubuntu-advantage enable-livepatch \$LIVEPATCH_TOKEN" + multipass exec $name -- sudo ubuntu-advantage enable-livepatch $LIVEPATCH_TOKEN + set -x + + h2 "Status before - old UA and livepatch say enabled" + multipass exec $name -- sudo canonical-livepatch status + multipass exec $name -- sudo ubuntu-advantage status + + install_new_ua multipass + + h2 "Status after upgrade - livepatch still enabled but new UA doesn't report it" + multipass exec $name -- sudo canonical-livepatch status + multipass exec $name -- sudo ua status + + h2 "Attach - verify that livepatch is disabled and re-enabled" + attach_ua multipass + + h2 "Status after attach - both livepatch and UA should say enabled" + multipass exec $name -- sudo canonical-livepatch status + multipass exec $name -- sudo ua status + + h2 "Detaching before destruction" + multipass exec $name -- sudo ua detach --assume-yes + + teardown_vm +} + +function test_upgrade_with_fips_in_vm() { + + setup_vm + + h1 "Upgrade to UA 27 while old version has fips enabled" + + h2 "Manual fips check says disabled (file doesn't exist)" + multipass exec $name -- sudo cat /proc/sys/crypto/fips_enabled || true + + h2 "Enable fips on old version" + set +x + echo "+ multipass exec $name -- ubuntu-advantage enable-fips \$FIPS_CREDS" + multipass exec $name -- sudo ubuntu-advantage enable-fips $FIPS_CREDS + set -x + + h2 "Reboot to finish fips activation" + multipass exec $name -- sudo reboot || true + sleep 20 + + h2 "Status before upgrade - old UA says fips is enabled, manual check agrees" + multipass exec $name -- sudo ubuntu-advantage status + multipass exec $name -- sudo cat /proc/sys/crypto/fips_enabled + + h2 "Source added by old client is present" + multipass exec $name -- sudo ls /etc/apt/sources.list.d + multipass exec $name -- sudo grep -o private-ppa.launchpad.net/ubuntu-advantage/fips/ubuntu /etc/apt/sources.list.d/ubuntu-fips-xenial.list + + install_new_ua multipass + + h2 "Status after upgrade - new UA won't say anything is enabled, but a manual check still says fips is enabled" + multipass exec $name -- sudo ua status + multipass exec $name -- sudo cat /proc/sys/crypto/fips_enabled + + h2 "Source file added by old client is renamed but contents left unchanged" + multipass exec $name -- sudo ls /etc/apt/sources.list.d + multipass exec $name -- sudo grep -o private-ppa.launchpad.net/ubuntu-advantage/fips/ubuntu /etc/apt/sources.list.d/ubuntu-fips.list + + h2 "Attach - only esm-infra will be auto-enabled" + attach_ua multipass + + h2 "Status after attach - new UA will say fips is disabled, livepatch is n/a, and there is a notice to enable fips" + multipass exec $name -- sudo ua status + multipass exec $name -- sudo cat /proc/sys/crypto/fips_enabled + + h2 "Enable fips on new UA - This will re-install fips packages and ask to reboot again" + multipass exec $name -- sudo ua enable fips --assume-yes + + + h2 "Status after enabled but before reboot - UA says fips enabled, notice to enable fips is gone" + multipass exec $name -- sudo ua status + multipass exec $name -- sudo cat /proc/sys/crypto/fips_enabled + + h2 "Source added by old client is replaced with new source" + set +x + echo "multipass exec $name -- sudo grep \$FIPS_CREDS /etc/apt/sources.list.d/ubuntu-fips.list && echo \"FAIL: found oldclient FIPS creds\" || echo \"SUCCESS: Migrated to new client creds\"" + multipass exec $name -- sudo grep $FIPS_CREDS /etc/apt/sources.list.d/ubuntu-fips.list && echo "FAIL: found oldclient FIPS creds" || echo "SUCCESS: Migrated to new client creds" + set -x + multipass exec $name -- sudo ls /etc/apt/sources.list.d + multipass exec $name -- sudo cat /etc/apt/sources.list.d/ubuntu-fips.list + multipass exec $name -- sudo apt update + + h2 "Check to make sure we have a valid ubuntu-*-fips metapackage installed" + multipass exec $name -- sudo grep "install" /var/log/ubuntu-advantage.log + + h2 "Reboot to finish second fips activation" + multipass exec $name -- sudo reboot || true + sleep 20 + + h2 "Status after reboot - new UA will say fips is enabled, manual check agrees" + multipass exec $name -- sudo ua status + multipass exec $name -- sudo cat /proc/sys/crypto/fips_enabled + + h2 "Detaching before destruction" + multipass exec $name -- sudo ua detach --assume-yes + + teardown_vm +} + +test_upgrade_in_container +test_upgrade_with_livepatch_in_vm +test_upgrade_with_fips_in_vm diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.3/gcp_auto_attach_test.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.3/gcp_auto_attach_test.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.3/gcp_auto_attach_test.sh 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.3/gcp_auto_attach_test.sh 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,35 @@ +#!/bin/sh +ZONE="us-east1-b" +INSTANCE_NAME="test-auto-attach" +INSTANCE_TYPE="n1-standard-1" +DISK_NAME="persistent-disk-0" + +set -x + +gcloud compute instances create $INSTANCE_NAME \ + --image="ubuntu-1604-xenial-v20210429" \ + --image-project="ubuntu-os-cloud" \ + --machine-type=$INSTANCE_TYPE \ + --zone=$ZONE +sleep 30 + +gcloud compute scp ubuntu-advantage-tools.deb $INSTANCE_NAME:/tmp/ +gcloud compute ssh $INSTANCE_NAME -- "sudo apt update" +gcloud compute ssh $INSTANCE_NAME -- "sudo apt install ubuntu-advantage-tools -y" +gcloud compute ssh $INSTANCE_NAME -- "sudo dpkg -i /tmp/ubuntu-advantage-tools.deb" +gcloud compute ssh $INSTANCE_NAME -- "sudo sed -i 's/pass/pass\n else:\n print(\"pro license not present\")/' /usr/lib/python3/dist-packages/uaclient/jobs/license_check.py" +# Without the license, it will not try to auto_attach +gcloud compute ssh $INSTANCE_NAME -- "sudo python3 /usr/lib/ubuntu-advantage/license_check.py" +gcloud compute ssh $INSTANCE_NAME -- "sudo ua status --wait" + +gcloud compute instances stop $INSTANCE_NAME +gcloud beta compute disks update $INSTANCE_NAME --zone=$ZONE --update-user-licenses="https://www.googleapis.com/compute/v1/projects/ubuntu-os-pro-cloud/global/licenses/ubuntu-pro-1604-lts" +gcloud compute instances start $INSTANCE_NAME +sleep 30 + +# Now with the license, it will succeed auto_attaching +gcloud compute ssh $INSTANCE_NAME -- "sudo python3 /usr/lib/ubuntu-advantage/license_check.py" +gcloud compute ssh $INSTANCE_NAME -- "sudo ua status --wait" +gcloud compute ssh $INSTANCE_NAME -- "sudo ua detach --assume-yes" + +gcloud compute instances delete $INSTANCE_NAME diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.3/ua-messaging-disabled.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.3/ua-messaging-disabled.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.3/ua-messaging-disabled.sh 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.3/ua-messaging-disabled.sh 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,28 @@ +#!/bin/sh + +series=$1 +name="test-systemd-$series" +DEB_PATH=$2 + +lxc launch ubuntu-daily:$series $name +sleep 5 +lxc file push $DEB_PATH $name/tmp/ua.deb +echo "List timers in default state" +echo "--------------------------" +lxc exec $name -- sudo systemctl list-timers --all +echo "--------------------------" +echo "Disabling ua-messaging.timer" +echo "--------------------------" +lxc exec $name -- sudo systemctl stop ua-messaging.timer +lxc exec $name -- sudo systemctl disable ua-messaging.timer +lxc exec $name -- sudo systemctl list-timers --all +sleep 2 +echo "--------------------------" +echo "Installing new UA package" +echo "--------------------------" +lxc exec $name -- sudo dpkg -i /tmp/ua.deb +echo "--------------------------" +echo "Verifying ua-timer.timer is disabled" +lxc exec $name -- sudo systemctl list-timers --all +echo "--------------------------" +lxc delete $name --force diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.4/test-unattached-status-job.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.4/test-unattached-status-job.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.4/test-unattached-status-job.sh 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.4/test-unattached-status-job.sh 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,40 @@ +series=$1 +set -x +lxc launch ubuntu-daily:$series test >/dev/null 2>&1 +sleep 10 + +echo +echo "showing the network call in current ua version 27.3" +lxc exec test -- apt-get update >/dev/null +lxc exec test -- apt-get install -y ubuntu-advantage-tools >/dev/null +lxc exec test -- ua version +echo "disable all jobs but the status job" +lxc exec test -- ua config set metering_timer=0 +lxc exec test -- ua config set update_messaging_timer=0 +echo "run the status update timer job by removing current timer state and executing the timer script" +echo "and run tcpdump while executing the script, filtering by the current IPs of contracts.canonical.com" +lxc exec test -- rm -f /var/lib/ubuntu-advantage/jobs-status.json +lxc exec test -- sh -c "tcpdump \"(host 91.189.92.68 or host 91.189.92.69)\" & pid=\$! && sleep 5 && python3 /usr/lib/ubuntu-advantage/timer.py && kill \$pid" +echo "Verify that tcpdump saw packets in above output" +echo "Verify that the job was actually processed by the timer: update_status should be there." +lxc exec test -- grep "update_status" /var/lib/ubuntu-advantage/jobs-status.json + + +echo +echo +echo "installing new version from proposed" +lxc exec test -- sh -c "echo \"deb http://archive.ubuntu.com/ubuntu $series-proposed main\" | tee /etc/apt/sources.list.d/proposed.list" +lxc exec test -- apt-get update >/dev/null +lxc exec test -- sh -c "DEBIAN_FRONTEND=noninteractive apt-get install -o Dpkg::Options::=\"--force-confdef\" -o Dpkg::Options::=\"--force-confold\" -y ubuntu-advantage-tools" > /dev/null +lxc exec test -- ua version + + +echo "run the status update timer job by removing current timer state and executing the timer script" +echo "and run tcpdump while executing the script, filtering by the current IPs of contracts.canonical.com" +lxc exec test -- rm -f /var/lib/ubuntu-advantage/jobs-status.json +lxc exec test -- sh -c "tcpdump \"(host 91.189.92.68 or host 91.189.92.69)\" & pid=\$! && sleep 5 && python3 /usr/lib/ubuntu-advantage/timer.py && kill \$pid" +echo "Verify that tcpdump DID NOT see packets in above output" +echo "Verify that the job was actually processed by the timer: update_status should be there." +lxc exec test -- grep "update_status" /var/lib/ubuntu-advantage/jobs-status.json + +lxc delete test --force diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.4.2/test-postinst-check-service-is-enabled-fix.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.4.2/test-postinst-check-service-is-enabled-fix.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.4.2/test-postinst-check-service-is-enabled-fix.sh 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.4.2/test-postinst-check-service-is-enabled-fix.sh 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,34 @@ +series=$1 +name=test-$series +set -x +lxc launch ubuntu-daily:$series $name >/dev/null 2>&1 +sleep 3 + +echo "Confirming we are runnign a ${series} machine" +lxc exec $name -- lsb_release -a + +echo "Updating to the latest version of UA" +lxc exec $name -- apt-get update >/dev/null +lxc exec $name -- apt-get install -y ubuntu-advantage-tools >/dev/null +lxc exec $name -- ua version +echo "Running ua status to persist cache" +lxc exec $name -- ua status +echo "Modifying ESM_SUPPORTED_ARCHS to emulate the issue" +lxc exec $name -- sed -i "s/ESM_SUPPORTED_ARCHS=\"i386 amd64\"/ESM_SUPPORTED_ARCHS=\"\"/" /var/lib/dpkg/info/ubuntu-advantage-tools.postinst +echo "Re-running the postinst script. Confirming that KeyError is reported on stdout" +lxc exec $name -- dpkg-reconfigure ubuntu-advantage-tools + +echo "Updating UA to the version with the fix" +lxc exec $name -- sh -c "echo \"deb http://archive.ubuntu.com/ubuntu $series-proposed main\" | tee /etc/apt/sources.list.d/proposed.list" +lxc exec $name -- apt-get update >/dev/null +lxc exec $name -- apt-get install -y ubuntu-advantage-tools >/dev/null +lxc exec $name -- ua version + +echo "Running ua status to persist cache" +lxc exec $name -- ua status +echo "Modifying ESM_SUPPORTED_ARCHS to emulate the issue" +lxc exec $name -- sed -i "s/ESM_SUPPORTED_ARCHS=\"i386 amd64\"/ESM_SUPPORTED_ARCHS=\"\"/" /var/lib/dpkg/info/ubuntu-advantage-tools.postinst +echo "Re-running the postinst script. Confirming that KeyError is no longer reported" +lxc exec $name -- dpkg-reconfigure ubuntu-advantage-tools + +lxc delete --force $name diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.5/test-aws-ipv6.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.5/test-aws-ipv6.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.5/test-aws-ipv6.sh 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.5/test-aws-ipv6.sh 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,66 @@ +#!/bin/sh + +set -e + +KEY_PATH=$1 +DEB_PATH=$2 +sshopts=( -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR ) + +REGION=us-west-2 +INSTANCE_TYPE=t3.micro +KEY_NAME=test-ipv6 +PRO_IMAGE_ID=ami-07e00b8a1a054fdbf # bionic PRO image for us-west-2 + +# You need to have a subnet that supports IPv6. The easiest path here is to launch an ec2 +# instance through pycloudlib, which will already create a VPC with a subnet that supports +# IPv6. You can also use the security group created by pycloudlib +SUBNET_ID= +SECURITY_GROUP_ID= + +# Make sure that the awscli being used has support for the --metadata-options params, otherwise the +# IPv6 endpoint will not work as expected +instance_info=$(aws --region $REGION ec2 run-instances --instance-type $INSTANCE_TYPE --image-id $PRO_IMAGE_ID --subnet-id $SUBNET_ID --key-name $KEY_NAME --associate-public-ip-address --ipv6-address-count 1 --metadata-options HttpEndpoint=enabled,HttpProtocolIpv6=enabled --security-group-ids $SECURITY_GROUP_ID) +instance_id=$(echo $instance_info | jq -r ".Instances[0].InstanceId") +instance_ip=$(aws ec2 describe-instances --region $REGION --instance-ids $instance_id --query 'Reservations[*].Instances[*].PublicIpAddress' --output text) + +echo "---------------------------------------------" +echo "Checking instance info" +ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- lsb_release -a +ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo ua status --wait +echo "---------------------------------------------" +echo -e "\n" + +echo "---------------------------------------------" +echo "Detaching PRO instance" +ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo ua detach --assume-yes +echo "---------------------------------------------" +echo -e "\n" + +echo "---------------------------------------------" +echo "Installing package with IPv6 support" +scp "${sshopts[@]}" -i $KEY_PATH $DEB_PATH ubuntu@$instance_ip:/home/ubuntu/ua.deb +ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo dpkg -i ua.deb +ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- ua version +ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo ua status --wait +echo "---------------------------------------------" +echo -e "\n" + +echo "---------------------------------------------" +echo "Modifying IPv4 address to make it fail" +ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo rm /var/log/ubuntu-advantage.log +ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo sed -i "s/169.254.169.254/169.254.169.1/g" /usr/lib/python3/dist-packages/uaclient/clouds/aws.py +echo "---------------------------------------------" +echo -e "\n" + +echo "---------------------------------------------" +echo "Verify that auto-attach still works and IPv6 route was used instead" +ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo ua auto-attach +ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo ua status +ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo grep -F \"Could not reach AWS IMDS at http://169.254.169.1\" /var/log/ubuntu-advantage.log +ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo grep -F \"URL [PUT]: http://169.254.169.1/latest/api/token\" /var/log/ubuntu-advantage.log +ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo grep -F \"URL [PUT]: http://[fd00:ec2::254]/latest/api/token\" /var/log/ubuntu-advantage.log +ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo grep -F \"URL [PUT] response: http://[fd00:ec2::254]/latest/api/token\" /var/log/ubuntu-advantage.log +ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo grep -F \"URL [GET]: http://[fd00:ec2::254]/latest/dynamic/instance-identity/pkcs7\" /var/log/ubuntu-advantage.log +ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo grep -F \"URL [GET] response: http://[fd00:ec2::254]/latest/dynamic/instance-identity/pkcs7\" /var/log/ubuntu-advantage.log +echo "---------------------------------------------" +echo -e "\n" diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.7/test_world_readable_logs.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.7/test_world_readable_logs.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.7/test_world_readable_logs.sh 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.7/test_world_readable_logs.sh 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,66 @@ +series=$1 +deb=$2 + +set -eE + +GREEN="\e[32m" +RED="\e[31m" +BLUE="\e[36m" +END_COLOR="\e[0m" + +function cleanup { + lxc delete test --force +} + +function on_err { + echo -e "${RED}Test Failed${END_COLOR}" + cleanup + exit 1 +} + +trap on_err ERR + +function print_and_run_cmd { + echo -e "${BLUE}Running:${END_COLOR}" "$@" + echo -e "${BLUE}Output:${END_COLOR}" + lxc exec test -- sh -c "$@" + echo +} + +function explanatory_message { + echo -e "${BLUE}$@${END_COLOR}" +} + +explanatory_message "Starting $series container and updating ubuntu-advantage-tools" +lxc launch ubuntu-daily:$series test >/dev/null 2>&1 +sleep 10 + +explanatory_message "Check that log is not world readable" +print_and_run_cmd "ua version" +print_and_run_cmd "head /var/log/ubuntu-advantage.log" +print_and_run_cmd "find /var/log/ -name ubuntu-advantage.log -perm 0600 | grep -qz ." + +lxc exec test -- apt-get update >/dev/null +explanatory_message "installing new version of ubuntu-advantage-tools from local copy" +lxc file push $deb test/tmp/ua.deb > /dev/null +print_and_run_cmd "dpkg -i /tmp/ua.deb" +print_and_run_cmd "ua version" + +explanatory_message "Check that log files permissions are still the same" +print_and_run_cmd "find /var/log/ -name ubuntu-advantage.log -perm 0600 | grep -qz ." + +explanatory_message "Check that logrotate command will create world readable files" +print_and_run_cmd "logrotate --force /etc/logrotate.d/ubuntu-advantage-tools" +print_and_run_cmd "find /var/log/ -name ubuntu-advantage.log -perm 0644 | grep -qz ." +print_and_run_cmd "find /var/log/ -name ubuntu-advantage.log.1 -perm 0600 | grep -qz ." + +explanatory_message "Check that running logrotate again will stil make world readable files" +# Just to add new entry to the log +print_and_run_cmd "ua version" +print_and_run_cmd "logrotate --force /etc/logrotate.d/ubuntu-advantage-tools" +print_and_run_cmd "find /var/log/ -name ubuntu-advantage.log -perm 0644 | grep -qz ." +print_and_run_cmd "find /var/log/ -name ubuntu-advantage.log.1 -perm 0644 | grep -qz ." +print_and_run_cmd "find /var/log/ -name ubuntu-advantage.log.2.gz -perm 0600 | grep -qz ." + +echo -e "${GREEN}Test Passed${END_COLOR}" +cleanup diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.9/cleanup_cloud_id_shim_ppa.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.9/cleanup_cloud_id_shim_ppa.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.9/cleanup_cloud_id_shim_ppa.sh 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.9/cleanup_cloud_id_shim_ppa.sh 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,64 @@ +ppa=$1 +series=xenial + +set -e + +GREEN="\e[32m" +RED="\e[31m" +BLUE="\e[36m" +END_COLOR="\e[0m" + +function cleanup { + lxc delete test --force +} + +function on_err { + echo -e "${RED}Test Failed${END_COLOR}" + cleanup + exit 1 +} + +trap on_err ERR + +function print_and_run_cmd { + echo -e "${BLUE}Running:${END_COLOR}" "$@" + echo -e "${BLUE}Output:${END_COLOR}" + lxc exec test -- sh -c "$@" + echo +} + +function explanatory_message { + echo -e "${BLUE}$@${END_COLOR}" +} + +explanatory_message "Starting $series container and updating ubuntu-advantage-tools" +lxc launch ubuntu-daily:$series test >/dev/null 2>&1 +sleep 10 + +lxc exec test -- add-apt-repository $ppa >/dev/null +lxc exec test -- apt-get update >/dev/null +lxc exec test -- apt-get install locate >/dev/null +lxc exec test -- apt-get dist-upgrade -y >/dev/null +print_and_run_cmd "ua version" + +explanatory_message "Note where all cloud-id-shim artifacts are before upgrade" +print_and_run_cmd "updatedb" +print_and_run_cmd "locate ubuntu-advantage-cloud-id-shim" + +explanatory_message "upgrade to bionic" +lxc exec test -- sh -c "cat > /etc/update-manager/release-upgrades.d/ua-test.cfg << EOF +[Sources] +AllowThirdParty=yes +EOF" +lxc exec test -- do-release-upgrade --frontend DistUpgradeViewNonInteractive >/dev/null + +print_and_run_cmd "ua version" + +explanatory_message "cloud-id-shim artifacts should be gone" +print_and_run_cmd "updatedb" +print_and_run_cmd "locate ubuntu-advantage-cloud-id-shim || true" +result=$(lxc exec test -- locate ubuntu-advantage-cloud-id-shim || true) +test -z "$result" + +echo -e "${GREEN}Test Passed${END_COLOR}" +cleanup diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.9/cleanup_cloud_id_shim.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.9/cleanup_cloud_id_shim.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.9/cleanup_cloud_id_shim.sh 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.9/cleanup_cloud_id_shim.sh 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,62 @@ +x_deb=$1 +b_deb=$2 +series=bionic + +set -e + +GREEN="\e[32m" +RED="\e[31m" +BLUE="\e[36m" +END_COLOR="\e[0m" + +function cleanup { + lxc delete test --force +} + +function on_err { + echo -e "${RED}Test Failed${END_COLOR}" + cleanup + exit 1 +} + +trap on_err ERR + +function print_and_run_cmd { + echo -e "${BLUE}Running:${END_COLOR}" "$@" + echo -e "${BLUE}Output:${END_COLOR}" + lxc exec test -- sh -c "$@" + echo +} + +function explanatory_message { + echo -e "${BLUE}$@${END_COLOR}" +} + +explanatory_message "Starting $series container and updating ubuntu-advantage-tools" +lxc launch ubuntu-daily:$series test >/dev/null 2>&1 +sleep 10 + +lxc exec test -- apt-get update >/dev/null +lxc exec test -- apt-get install -y ubuntu-advantage-tools locate >/dev/null +explanatory_message "installing xenial version of ubuntu-advantage-tools from local copy" +lxc file push $x_deb test/tmp/uax.deb > /dev/null +print_and_run_cmd "dpkg -i /tmp/uax.deb" +print_and_run_cmd "ua version" + +explanatory_message "Note where all cloud-id-shim artifacts are before upgrade" +print_and_run_cmd "updatedb" +print_and_run_cmd "locate ubuntu-advantage-cloud-id-shim" + +explanatory_message "installing bionic version of ubuntu-advantage-tools from local copy" +lxc file push $b_deb test/tmp/uab.deb > /dev/null +print_and_run_cmd "dpkg -i /tmp/uab.deb" +print_and_run_cmd "ua version" + +explanatory_message "cloud-id-shim artifacts should be gone" +print_and_run_cmd "updatedb" +print_and_run_cmd "locate ubuntu-advantage-cloud-id-shim || true" +result=$(lxc exec test -- locate ubuntu-advantage-cloud-id-shim || true) +test -z "$result" + +echo -e "${GREEN}Test Passed${END_COLOR}" +cleanup diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.9/cleanup_failed_old_license_check_timer.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.9/cleanup_failed_old_license_check_timer.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.9/cleanup_failed_old_license_check_timer.sh 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.9/cleanup_failed_old_license_check_timer.sh 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,57 @@ +series=$1 +deb=$2 + +set -e + +GREEN="\e[32m" +RED="\e[31m" +BLUE="\e[36m" +END_COLOR="\e[0m" + +function cleanup { + lxc delete test --force +} + +function on_err { + echo -e "${RED}Test Failed${END_COLOR}" + cleanup + exit 1 +} + +trap on_err ERR + +function print_and_run_cmd { + echo -e "${BLUE}Running:${END_COLOR}" "$@" + echo -e "${BLUE}Output:${END_COLOR}" + lxc exec test -- sh -c "$@" + echo +} + +function explanatory_message { + echo -e "${BLUE}$@${END_COLOR}" +} + +explanatory_message "Starting $series container and updating ubuntu-advantage-tools" +lxc launch ubuntu-daily:$series test >/dev/null 2>&1 +sleep 10 + +lxc exec test -- apt-get update >/dev/null +lxc exec test -- apt-get install -y ubuntu-advantage-tools locate >/dev/null +print_and_run_cmd "ua version" +explanatory_message "Start the timer to make sure its state is fixed on upgrade" +print_and_run_cmd "systemctl start ua-license-check.timer" +print_and_run_cmd "systemctl status ua-license-check.timer" + +explanatory_message "installing new version of ubuntu-advantage-tools from local copy" +lxc file push $deb test/tmp/ua.deb > /dev/null +print_and_run_cmd "dpkg -i /tmp/ua.deb" +print_and_run_cmd "ua version" + +explanatory_message "systemd should not list the timer as failed" +print_and_run_cmd "systemctl status ua-license-check.timer || true" +print_and_run_cmd "systemctl --no-pager | grep ua-license-check || true" +result=$(lxc exec test -- sh -c "systemctl --no-pager | grep ua-license-check.timer" || true) +echo "$result" | grep -qv "ua-license-check.timer\s\+not-found\s\+failed" + +echo -e "${GREEN}Test Passed${END_COLOR}" +cleanup diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.9/gcp_auto_attach_long_poll.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.9/gcp_auto_attach_long_poll.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.9/gcp_auto_attach_long_poll.sh 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.9/gcp_auto_attach_long_poll.sh 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,80 @@ +#!/bin/sh +ua_deb=$1 +ZONE="us-east1-b" +INSTANCE_NAME="test-auto-attach" +INSTANCE_TYPE="n1-standard-1" +DISK_NAME="persistent-disk-0" + +set -e + +GREEN="\e[32m" +RED="\e[31m" +BLUE="\e[36m" +END_COLOR="\e[0m" + +function cleanup { + gcloud compute ssh $INSTANCE_NAME -- "sudo ua detach --assume-yes || true" + gcloud compute instances delete $INSTANCE_NAME +} + +function on_err { + echo -e "${RED}Test Failed${END_COLOR}" + cleanup + exit 1 +} + +trap on_err ERR + +function print_and_run_cmd { + echo -e "${BLUE}Running:${END_COLOR}" "$@" + echo -e "${BLUE}Output:${END_COLOR}" + gcloud compute ssh $INSTANCE_NAME -- "sh -c \"$@\"" + echo +} + +function explanatory_message { + echo -e "${BLUE}$@${END_COLOR}" +} + +explanatory_message "Starting gcloud instance" +gcloud compute instances create $INSTANCE_NAME \ + --image="ubuntu-2004-focal-v20220404" \ + --image-project="ubuntu-os-cloud" \ + --machine-type=$INSTANCE_TYPE \ + --zone=$ZONE +sleep 60 + +explanatory_message "Installing new version of ubuntu-advantage-tools from local copy" +gcloud compute scp $ua_deb $INSTANCE_NAME:/tmp/ubuntu-advantage-tools.deb +gcloud compute ssh $INSTANCE_NAME -- "sudo apt update" +gcloud compute ssh $INSTANCE_NAME -- "sudo apt install ubuntu-advantage-tools -y" +print_and_run_cmd "sudo dpkg -i /tmp/ubuntu-advantage-tools.deb" + +explanatory_message "skip initial license check" +print_and_run_cmd "sudo sed -zi \\\"s/cloud.is_pro_license_present(\n wait_for_change=False\n )/False/\\\" /usr/lib/python3/dist-packages/uaclient/daemon.py" + +explanatory_message "turn on polling in config file" +print_and_run_cmd "sudo sh -c \\\"printf \\\\\\\" poll_for_pro_license: true\\\\\\\" >> /etc/ubuntu-advantage/uaclient.conf\\\"" + +explanatory_message "change won't happen while daemon is running, so set short timeout to simulate the long poll returning" +print_and_run_cmd "sudo sed -i \\\"s/wait_for_change=true/wait_for_change=true\&timeout_sec=5/\\\" /usr/lib/python3/dist-packages/uaclient/clouds/gcp.py" + +explanatory_message "Checking the status and logs beforehand" +print_and_run_cmd "sudo ua status --wait" +print_and_run_cmd "sudo cat /var/log/ubuntu-advantage-daemon.log" +gcloud compute ssh $INSTANCE_NAME -- "sudo truncate -s 0 /var/log/ubuntu-advantage-daemon.log" + +explanatory_message "Stopping the machine, adding license, restarting..." +gcloud compute instances stop $INSTANCE_NAME +gcloud beta compute disks update $INSTANCE_NAME --zone=$ZONE --update-user-licenses="https://www.googleapis.com/compute/v1/projects/ubuntu-os-pro-cloud/global/licenses/ubuntu-pro-2004-lts" +gcloud compute instances start $INSTANCE_NAME +sleep 60 + +explanatory_message "Now with the license, it will succeed auto_attaching" +print_and_run_cmd "sudo ua status --wait" +print_and_run_cmd "sudo cat /var/log/ubuntu-advantage-daemon.log" +result=$(gcloud compute ssh $INSTANCE_NAME -- "sudo ua status --format json") +echo $result | jq -r ".attached" | grep "true" + +echo -e "${GREEN}Test Passed${END_COLOR}" +cleanup diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.9/gcp_auto_attach_on_boot.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.9/gcp_auto_attach_on_boot.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.9/gcp_auto_attach_on_boot.sh 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.9/gcp_auto_attach_on_boot.sh 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,72 @@ +#!/bin/sh +ua_deb=$1 +ZONE="us-east1-b" +INSTANCE_NAME="test-auto-attach" +INSTANCE_TYPE="n1-standard-1" +DISK_NAME="persistent-disk-0" + +set -e + +GREEN="\e[32m" +RED="\e[31m" +BLUE="\e[36m" +END_COLOR="\e[0m" + +function cleanup { + gcloud compute ssh $INSTANCE_NAME -- "sudo ua detach --assume-yes || true" + gcloud compute instances delete $INSTANCE_NAME +} + +function on_err { + echo -e "${RED}Test Failed${END_COLOR}" + cleanup + exit 1 +} + +trap on_err ERR + +function print_and_run_cmd { + echo -e "${BLUE}Running:${END_COLOR}" "$@" + echo -e "${BLUE}Output:${END_COLOR}" + gcloud compute ssh $INSTANCE_NAME -- "sh -c \"$@\"" + echo +} + +function explanatory_message { + echo -e "${BLUE}$@${END_COLOR}" +} + +explanatory_message "Starting gcloud instance" +gcloud compute instances create $INSTANCE_NAME \ + --image="ubuntu-2004-focal-v20220404" \ + --image-project="ubuntu-os-cloud" \ + --machine-type=$INSTANCE_TYPE \ + --zone=$ZONE +sleep 60 + + +explanatory_message "Installing new version of ubuntu-advantage-tools from local copy" +gcloud compute scp $ua_deb $INSTANCE_NAME:/tmp/ubuntu-advantage-tools.deb +gcloud compute ssh $INSTANCE_NAME -- "sudo apt update" +gcloud compute ssh $INSTANCE_NAME -- "sudo apt install ubuntu-advantage-tools jq -y" +print_and_run_cmd "sudo dpkg -i /tmp/ubuntu-advantage-tools.deb" + +explanatory_message "Checking the status and logs beforehand" +print_and_run_cmd "sudo ua status --wait" +print_and_run_cmd "sudo cat /var/log/ubuntu-advantage-daemon.log" +print_and_run_cmd "sudo truncate -s 0 /var/log/ubuntu-advantage-daemon.log" + +explanatory_message "Stopping the machine, adding license, restarting..." +gcloud compute instances stop $INSTANCE_NAME +gcloud beta compute disks update $INSTANCE_NAME --zone=$ZONE --update-user-licenses="https://www.googleapis.com/compute/v1/projects/ubuntu-os-pro-cloud/global/licenses/ubuntu-pro-2004-lts" +gcloud compute instances start $INSTANCE_NAME +sleep 30 + +explanatory_message "Now with the license, it will succeed auto_attaching on boot" +print_and_run_cmd "sudo ua status --wait" +print_and_run_cmd "sudo cat /var/log/ubuntu-advantage-daemon.log" +result=$(gcloud compute ssh $INSTANCE_NAME -- "sudo ua status --format json") +echo $result | jq -r ".attached" | grep "true" + +echo -e "${GREEN}Test Passed${END_COLOR}" +cleanup diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.9/remove_old_license_check_timer.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.9/remove_old_license_check_timer.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.9/remove_old_license_check_timer.sh 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.9/remove_old_license_check_timer.sh 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,57 @@ +series=$1 +deb=$2 + +set -e + +GREEN="\e[32m" +RED="\e[31m" +BLUE="\e[36m" +END_COLOR="\e[0m" + +function cleanup { + lxc delete test --force +} + +function on_err { + echo -e "${RED}Test Failed${END_COLOR}" + cleanup + exit 1 +} + +trap on_err ERR + +function print_and_run_cmd { + echo -e "${BLUE}Running:${END_COLOR}" "$@" + echo -e "${BLUE}Output:${END_COLOR}" + lxc exec test -- sh -c "$@" + echo +} + +function explanatory_message { + echo -e "${BLUE}$@${END_COLOR}" +} + +explanatory_message "Starting $series container and updating ubuntu-advantage-tools" +lxc launch ubuntu-daily:$series test >/dev/null 2>&1 +sleep 10 + +lxc exec test -- apt-get update >/dev/null +lxc exec test -- apt-get install -y ubuntu-advantage-tools locate >/dev/null +print_and_run_cmd "ua version" +explanatory_message "Note where all license-check artifacts are before upgrade" +print_and_run_cmd "updatedb" +print_and_run_cmd "locate ua-license-check" + +explanatory_message "installing new version of ubuntu-advantage-tools from local copy" +lxc file push $deb test/tmp/ua.deb > /dev/null +print_and_run_cmd "dpkg -i /tmp/ua.deb" +print_and_run_cmd "ua version" + +explanatory_message "license-check artifacts should be gone" +print_and_run_cmd "updatedb" +print_and_run_cmd "locate ua-license-check || true" +result=$(lxc exec test -- locate ua-license-check || true) +test -z "$result" + +echo -e "${GREEN}Test Passed${END_COLOR}" +cleanup diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.9/remove_old_marker_file.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.9/remove_old_marker_file.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/_archive/release-27.9/remove_old_marker_file.sh 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/_archive/release-27.9/remove_old_marker_file.sh 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,58 @@ +series=$1 +deb=$2 + +set -e + +GREEN="\e[32m" +RED="\e[31m" +BLUE="\e[36m" +END_COLOR="\e[0m" + +function cleanup { + lxc delete test --force +} + +function on_err { + echo -e "${RED}Test Failed${END_COLOR}" + cleanup + exit 1 +} + +trap on_err ERR + +function print_and_run_cmd { + echo -e "${BLUE}Running:${END_COLOR}" "$@" + echo -e "${BLUE}Output:${END_COLOR}" + lxc exec test -- sh -c "$@" + echo +} + +function explanatory_message { + echo -e "${BLUE}$@${END_COLOR}" +} + + +explanatory_message "Starting $series container and updating ubuntu-advantage-tools" +lxc launch ubuntu-daily:$series test >/dev/null 2>&1 +sleep 10 + +lxc exec test -- apt-get update >/dev/null +lxc exec test -- apt-get install -y ubuntu-advantage-tools >/dev/null +print_and_run_cmd "ua version" +explanatory_message "manually creating the marker file" +print_and_run_cmd "touch /var/lib/ubuntu-advantage/marker-license-check" +print_and_run_cmd "ls /var/lib/ubuntu-advantage" + +explanatory_message "installing new version of ubuntu-advantage-tools from local copy" +lxc file push $deb test/tmp/ua.deb > /dev/null +print_and_run_cmd "dpkg -i /tmp/ua.deb" +print_and_run_cmd "ua version" + + +explanatory_message "make sure the marker file is not longer there" +print_and_run_cmd "ls /var/lib/ubuntu-advantage" +result=$(lxc exec test -- ls /var/lib/ubuntu-advantage) +echo "$result" | grep -v marker-license-check + +echo -e "${GREEN}Test Passed${END_COLOR}" +cleanup diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/daemon_stall_cloned_machine.py ubuntu-advantage-tools-27.10.1~18.04.1/sru/daemon_stall_cloned_machine.py --- ubuntu-advantage-tools-27.9~18.04.1/sru/daemon_stall_cloned_machine.py 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/daemon_stall_cloned_machine.py 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,65 @@ +import logging +import os + +import pycloudlib +from pycloudlib.cloud import ImageType + + +def handle_ssh_key(ec2, key_name): + """Manage ssh keys to be used in the instances.""" + if key_name in ec2.list_keys(): + ec2.delete_key(key_name) + + key_pair = ec2.client.create_key_pair(KeyName=key_name) + private_key_path = "ec2-test.pem" + with open(private_key_path, "w", encoding="utf-8") as stream: + stream.write(key_pair["KeyMaterial"]) + os.chmod(private_key_path, 0o600) + + # Since we are using a pem file, we don't have distinct public and + # private key paths + ec2.use_key( + public_key_path=private_key_path, + private_key_path=private_key_path, + name=key_name, + ) + + +if __name__ == "__main__": + logging.basicConfig(level=logging.INFO) + ec2 = pycloudlib.EC2(tag="examples") + key_name = "test-ec2" + handle_ssh_key(ec2, key_name) + + daily_pro = ec2.daily_image(release="focal", image_type=ImageType.PRO) + + print("Launching Pro instance...") + instance = ec2.launch(daily_pro, instance_type="m5.large") + instance.execute("touch custom_config_file") + print(instance.execute("sudo ua status --wait")) + print(instance.execute("sudo apt update")) + print(instance.execute("sudo apt install ubuntu-advantage-tools")) + + print("") + print("install ua version with the fix (must be at ./ua.deb)") + print("") + instance.push_file("./ua.deb", "/tmp/ua.deb") + print(instance.execute("sudo dpkg -i /tmp/ua.deb")) + + print("") + print("snapshotting") + print("") + image = ec2.snapshot(instance) + + print("") + print("launching clone - if this finishes, then success!") + print("") + new_instance = ec2.launch(image, instance_type="m5.large") + print(new_instance.execute("sudo ua status --wait")) + + print("") + print("Deleting Pro instances and image") + print("") + new_instance.delete() + ec2.delete_image(image) + instance.delete() diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/release-25/trusty-hwe-livepatch.txt ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-25/trusty-hwe-livepatch.txt --- ubuntu-advantage-tools-27.9~18.04.1/sru/release-25/trusty-hwe-livepatch.txt 2020-10-15 14:52:16.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-25/trusty-hwe-livepatch.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,1787 +0,0 @@ -=== Begin SRU Template === -[Impact] -Livepatch can only be enabled on a trusty machine if the kernel version is the hwe one. Therefore, -we must verify that once a Trusty machine has this kernel version running, Livepatch can be enabled -and used. - -[Test Case] -``` -#!/bin/sh -set -x -# Manually deploy on a trusty lxc vm -CONTRACT_TOKEN=TOKEN -series=trusty -name=$series-uac - -cat > install_hwe_kernel.sh << EOF -sudo apt-get -yq install --install-recommends linux-generic-lts-xenial xserver-xorg-core-lts-xenial xserver-xorg-lts-xenial xserver-xorg-video-all-lts-xenial xserver-xorg-input-all-lts-xenial libwayland-egl1-mesa-lts-xenial -EOF - -cat > install_uac_from_master.sh << EOF - sudo apt-get -yq install git make - git clone https://github.com/canonical/ubuntu-advantage-client.git /tmp/uac - cd /tmp/uac/ - sudo make deps - sudo dpkg-buildpackage -us -uc -EOF - -create_base_vm() { - multipass delete $name - multipass purge - multipass launch $series --name $name -} - -install_hwe_kernel() { - multipass transfer install_hwe_kernel.sh $name:/tmp/ - multipass exec $name bash /tmp/install_hwe_kernel.sh - multipass restart $name - sleep 20 - - kernel_version=$(multipass exec $name -- uname -r) - - if [[ "$kernel_version" == 4.4.0* ]] ; then - echo "SUCCESS: kernel was successfully updated to HWE: $kernel_version" - else - echo "FAILURE: kernel was not updated to HWE: $kernel_version" - fi -} - -update_uaclient() { - name_build=$series-uac-build - pkg_name=ubuntu-advantage-tools_25.0_amd64.deb - multipass launch $series --name $name_build - multipass transfer install_uac_from_master.sh $name_build:/tmp/ - multipass exec $name_build bash /tmp/install_uac_from_master.sh - multipass transfer $name_build:/tmp/$pkg_name /tmp/ - multipass transfer /tmp/$pkg_name $name:/tmp/ - multipass exec $name -- sudo apt-get remove ubuntu-advantage-tools --assume-yes - multipass exec $name -- sudo dpkg -i /tmp/$pkg_name - - uac_version=$(multipass exec $name -- ua version) - - if [[ "$uac_version" == 25.0* ]] ; then - echo "SUCCESS: uaclient was successfully updated to: $uac_version" - else - echo "FAILURE: uaclient was not updated" - fi - - multipass delete $name_build - multipass purge -} - -check_livepatch_is_not_installed() { - multipass exec $name -- which canonical-livepatch - return_code=$(multipass exec $name -- echo $?) - - if [ "$return_code" = "1" ] ; then - echo "SUCESS: canonical-livepatch is not found before enabling it" - else - echo "FAILURE: canonical-livepatch was found before enabling it" - fi -} - -attach_token_in_uaclient() { - multipass exec $name -- sudo ua attach $CONTRACT_TOKEN -} - -enable_livepatch() { - multipass exec $name -- sudo ua enable livepatch -} - -check_livepatch() { - return_str=$(multipass exec $name -- sudo canonical-livepatch status | grep running) - expected_str=" running: true" - - if [ "$return_str" = "$expected_str" ]; then - echo "SUCCESS: livepatch was enabled and is running" - else - echo "FAILURE: livepatch is not running" - fi -} - - -create_base_vm -install_hwe_kernel -update_uaclient -check_livepatch_is_not_installed -attach_token_in_uaclient -enable_livepatch -check_livepatch -``` - -=== Verification Log === - -+ CONTRACT_TOKEN= -+ series=trusty -+ name=trusty-uac -+ cat -+ cat -+ create_base_vm -+ multipass delete trusty-uac -+ multipass purge -+ multipass launch trusty --name trusty-uac -+ multipass transfer install_hwe_kernel.sh trusty-uac:/tmp/ -+ multipass exec trusty-uac bash /tmp/install_hwe_kernel.sh -Reading package lists... -Building dependency tree... -Reading state information... -The following extra packages will be installed: - amd64-microcode crda intel-microcode iucode-tool iw libdrm-amdgpu1 - libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libegl1-mesa-lts-xenial - libepoxy0 libevdev2 libfontenc1 libgbm1-lts-xenial - libgl1-mesa-dri-lts-xenial libgl1-mesa-glx-lts-xenial - libglapi-mesa-lts-xenial libgles1-mesa-lts-xenial libgles2-mesa-lts-xenial - libice6 libllvm3.8v4 libmtdev1 libnl-3-200 libnl-genl-3-200 libpciaccess0 - libpixman-1-0 libsm6 libtxc-dxtn-s2tc0 libwayland-client0 libwayland-server0 - libx11-xcb1 libxatracker2-lts-xenial libxaw7 libxcb-dri2-0 libxcb-dri3-0 - libxcb-glx0 libxcb-present0 libxcb-sync1 libxcb-util0 libxcb-xfixes0 - libxcursor1 libxdamage1 libxfixes3 libxfont1 libxi6 libxinerama1 libxkbfile1 - libxmu6 libxpm4 libxrandr2 libxrender1 libxshmfence1 libxss1 libxt6 libxtst6 - libxv1 libxvmc1 libxxf86vm1 linux-firmware linux-headers-4.4.0-148 - linux-headers-4.4.0-148-generic linux-headers-generic-lts-xenial - linux-image-4.4.0-148-generic linux-image-generic-lts-xenial - linux-modules-4.4.0-148-generic linux-modules-extra-4.4.0-148-generic - thermald wireless-regdb x11-common x11-xkb-utils xfonts-base - xfonts-encodings xfonts-utils xserver-common - xserver-xorg-input-evdev-lts-xenial xserver-xorg-input-synaptics-lts-xenial - xserver-xorg-input-vmmouse-lts-xenial xserver-xorg-input-wacom-lts-xenial - xserver-xorg-video-amdgpu-lts-xenial xserver-xorg-video-ati-lts-xenial - xserver-xorg-video-cirrus-lts-xenial xserver-xorg-video-fbdev-lts-xenial - xserver-xorg-video-intel-lts-xenial xserver-xorg-video-mach64-lts-xenial - xserver-xorg-video-mga-lts-xenial xserver-xorg-video-neomagic-lts-xenial - xserver-xorg-video-nouveau-lts-xenial - xserver-xorg-video-openchrome-lts-xenial xserver-xorg-video-qxl-lts-xenial - xserver-xorg-video-r128-lts-xenial xserver-xorg-video-radeon-lts-xenial - xserver-xorg-video-savage-lts-xenial - xserver-xorg-video-siliconmotion-lts-xenial - xserver-xorg-video-sisusb-lts-xenial xserver-xorg-video-tdfx-lts-xenial - xserver-xorg-video-trident-lts-xenial xserver-xorg-video-vesa-lts-xenial - xserver-xorg-video-vmware-lts-xenial -Suggested packages: - fdutils linux-lts-xenial-doc-4.4.0 linux-lts-xenial-source-4.4.0 - linux-lts-xenial-tools xfs xserver xfonts-100dpi xfonts-75dpi - xfonts-scalable gpointing-device-settings touchfreeze xinput - firmware-amd-graphics firmware-linux -Recommended packages: - xserver-xorg-video-modesetting -The following NEW packages will be installed: - amd64-microcode crda intel-microcode iucode-tool iw libdrm-amdgpu1 - libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libegl1-mesa-lts-xenial - libepoxy0 libevdev2 libfontenc1 libgbm1-lts-xenial - libgl1-mesa-dri-lts-xenial libgl1-mesa-glx-lts-xenial - libglapi-mesa-lts-xenial libgles1-mesa-lts-xenial libgles2-mesa-lts-xenial - libice6 libllvm3.8v4 libmtdev1 libnl-3-200 libnl-genl-3-200 libpciaccess0 - libpixman-1-0 libsm6 libtxc-dxtn-s2tc0 libwayland-client0 - libwayland-egl1-mesa-lts-xenial libwayland-server0 libx11-xcb1 - libxatracker2-lts-xenial libxaw7 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 - libxcb-present0 libxcb-sync1 libxcb-util0 libxcb-xfixes0 libxcursor1 - libxdamage1 libxfixes3 libxfont1 libxi6 libxinerama1 libxkbfile1 libxmu6 - libxpm4 libxrandr2 libxrender1 libxshmfence1 libxss1 libxt6 libxtst6 libxv1 - libxvmc1 libxxf86vm1 linux-firmware linux-generic-lts-xenial - linux-headers-4.4.0-148 linux-headers-4.4.0-148-generic - linux-headers-generic-lts-xenial linux-image-4.4.0-148-generic - linux-image-generic-lts-xenial linux-modules-4.4.0-148-generic - linux-modules-extra-4.4.0-148-generic thermald wireless-regdb x11-common - x11-xkb-utils xfonts-base xfonts-encodings xfonts-utils xserver-common - xserver-xorg-core-lts-xenial xserver-xorg-input-all-lts-xenial - xserver-xorg-input-evdev-lts-xenial xserver-xorg-input-synaptics-lts-xenial - xserver-xorg-input-vmmouse-lts-xenial xserver-xorg-input-wacom-lts-xenial - xserver-xorg-lts-xenial xserver-xorg-video-all-lts-xenial - xserver-xorg-video-amdgpu-lts-xenial xserver-xorg-video-ati-lts-xenial - xserver-xorg-video-cirrus-lts-xenial xserver-xorg-video-fbdev-lts-xenial - xserver-xorg-video-intel-lts-xenial xserver-xorg-video-mach64-lts-xenial - xserver-xorg-video-mga-lts-xenial xserver-xorg-video-neomagic-lts-xenial - xserver-xorg-video-nouveau-lts-xenial - xserver-xorg-video-openchrome-lts-xenial xserver-xorg-video-qxl-lts-xenial - xserver-xorg-video-r128-lts-xenial xserver-xorg-video-radeon-lts-xenial - xserver-xorg-video-savage-lts-xenial - xserver-xorg-video-siliconmotion-lts-xenial - xserver-xorg-video-sisusb-lts-xenial xserver-xorg-video-tdfx-lts-xenial - xserver-xorg-video-trident-lts-xenial xserver-xorg-video-vesa-lts-xenial - xserver-xorg-video-vmware-lts-xenial -0 upgraded, 104 newly installed, 0 to remove and 0 not upgraded. -Need to get 129 MB of archives. -After this operation, 530 MB of additional disk space will be used. -Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libdrm-amdgpu1 amd64 2.4.67-1ubuntu0.14.04.2 [16.4 kB] -Get:2 http://archive.ubuntu.com/ubuntu/ trusty/main libpciaccess0 amd64 0.13.2-1 [20.4 kB] -Get:3 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libdrm-intel1 amd64 2.4.67-1ubuntu0.14.04.2 [55.3 kB] -Get:4 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libdrm-nouveau2 amd64 2.4.67-1ubuntu0.14.04.2 [16.0 kB] -Get:5 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libdrm-radeon1 amd64 2.4.67-1ubuntu0.14.04.2 [21.2 kB] -Get:6 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libwayland-client0 amd64 1.4.0-1ubuntu1.1 [22.1 kB] -Get:7 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libwayland-server0 amd64 1.4.0-1ubuntu1.1 [26.9 kB] -Get:8 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgbm1-lts-xenial amd64 11.2.0-1ubuntu2~trusty2 [24.3 kB] -Get:9 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libx11-xcb1 amd64 2:1.6.2-1ubuntu2.1 [9,350 B] -Get:10 http://archive.ubuntu.com/ubuntu/ trusty/main libxcb-dri2-0 amd64 1.10-2ubuntu1 [6,710 B] -Get:11 http://archive.ubuntu.com/ubuntu/ trusty/main libxcb-dri3-0 amd64 1.10-2ubuntu1 [5,118 B] -Get:12 http://archive.ubuntu.com/ubuntu/ trusty/main libxcb-present0 amd64 1.10-2ubuntu1 [5,254 B] -Get:13 http://archive.ubuntu.com/ubuntu/ trusty/main libxcb-sync1 amd64 1.10-2ubuntu1 [8,090 B] -Get:14 http://archive.ubuntu.com/ubuntu/ trusty/main libxcb-xfixes0 amd64 1.10-2ubuntu1 [8,486 B] -Get:15 http://archive.ubuntu.com/ubuntu/ trusty/main libxshmfence1 amd64 1.1-2 [4,644 B] -Get:16 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libllvm3.8v4 amd64 1:3.8-2ubuntu3~trusty5 [9,724 kB] -Get:17 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgl1-mesa-dri-lts-xenial amd64 11.2.0-1ubuntu2~trusty2 [4,502 kB] -Get:18 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libegl1-mesa-lts-xenial amd64 11.2.0-1ubuntu2~trusty2 [69.0 kB] -Get:19 http://archive.ubuntu.com/ubuntu/ trusty/main libfontenc1 amd64 1:1.1.2-1 [15.6 kB] -Get:20 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libglapi-mesa-lts-xenial amd64 11.2.0-1ubuntu2~trusty2 [22.7 kB] -Get:21 http://archive.ubuntu.com/ubuntu/ trusty/main libxcb-glx0 amd64 1.10-2ubuntu1 [20.0 kB] -Get:22 http://archive.ubuntu.com/ubuntu/ trusty/main libxdamage1 amd64 1:1.1.4-1ubuntu1 [7,612 B] -Get:23 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libxfixes3 amd64 1:5.0.1-1ubuntu1.1 [10.4 kB] -Get:24 http://archive.ubuntu.com/ubuntu/ trusty/main libxxf86vm1 amd64 1:1.1.3-1 [11.7 kB] -Get:25 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgl1-mesa-glx-lts-xenial amd64 11.2.0-1ubuntu2~trusty2 [123 kB] -Get:26 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgles1-mesa-lts-xenial amd64 11.2.0-1ubuntu2~trusty2 [8,946 B] -Get:27 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgles2-mesa-lts-xenial amd64 11.2.0-1ubuntu2~trusty2 [11.8 kB] -Get:28 http://archive.ubuntu.com/ubuntu/ trusty-updates/main x11-common all 1:7.7+1ubuntu8.1 [49.5 kB] -Get:29 http://archive.ubuntu.com/ubuntu/ trusty/main libice6 amd64 2:1.0.8-2 [47.0 kB] -Get:30 http://archive.ubuntu.com/ubuntu/ trusty/main libmtdev1 amd64 1.1.4-1ubuntu1 [15.3 kB] -Get:31 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libnl-3-200 amd64 3.2.21-1ubuntu4.1 [45.3 kB] -Get:32 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libnl-genl-3-200 amd64 3.2.21-1ubuntu4.1 [10.2 kB] -Get:33 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libpixman-1-0 amd64 0.30.2-2ubuntu1.2 [226 kB] -Get:34 http://archive.ubuntu.com/ubuntu/ trusty/main libsm6 amd64 2:1.2.1-2 [18.1 kB] -Get:35 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libwayland-egl1-mesa-lts-xenial amd64 11.2.0-1ubuntu2~trusty2 [5,932 B] -Get:36 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libxatracker2-lts-xenial amd64 11.2.0-1ubuntu2~trusty2 [981 kB] -Get:37 http://archive.ubuntu.com/ubuntu/ trusty/main libxt6 amd64 1:1.1.4-1 [185 kB] -Get:38 http://archive.ubuntu.com/ubuntu/ trusty/main libxmu6 amd64 2:1.1.1-1 [53.8 kB] -Get:39 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libxpm4 amd64 1:3.5.10-1ubuntu0.1 [33.2 kB] -Get:40 http://archive.ubuntu.com/ubuntu/ trusty/main libxaw7 amd64 2:1.0.12-1 [168 kB] -Get:41 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libxrender1 amd64 1:0.9.8-1build0.14.04.1 [17.9 kB] -Get:42 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libxcursor1 amd64 1:1.1.14-1ubuntu0.14.04.2 [19.8 kB] -Get:43 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libxfont1 amd64 1:1.4.7-1ubuntu0.4 [95.1 kB] -Get:44 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libxi6 amd64 2:1.7.1.901-1ubuntu1.1 [27.9 kB] -Get:45 http://archive.ubuntu.com/ubuntu/ trusty/main libxinerama1 amd64 2:1.1.3-1 [7,908 B] -Get:46 http://archive.ubuntu.com/ubuntu/ trusty/main libxkbfile1 amd64 1:1.0.8-1 [74.2 kB] -Get:47 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libxrandr2 amd64 2:1.5.0-1~trusty1 [17.5 kB] -Get:48 http://archive.ubuntu.com/ubuntu/ trusty/main libxss1 amd64 1:1.2.2-1 [8,582 B] -Get:49 http://archive.ubuntu.com/ubuntu/ trusty/main libxtst6 amd64 2:1.2.2-1 [14.1 kB] -Get:50 http://archive.ubuntu.com/ubuntu/ trusty/main libxv1 amd64 2:1.0.10-1 [10.3 kB] -Get:51 http://archive.ubuntu.com/ubuntu/ trusty/main libxvmc1 amd64 2:1.0.8-1ubuntu1 [15.6 kB] -Get:52 http://archive.ubuntu.com/ubuntu/ trusty/universe libevdev2 amd64 1.0.99.2+dfsg-2ubuntu2 [25.8 kB] -Get:53 http://archive.ubuntu.com/ubuntu/ trusty/main libtxc-dxtn-s2tc0 amd64 0~git20131104-1.1 [51.8 kB] -Get:54 http://archive.ubuntu.com/ubuntu/ trusty/main libxcb-util0 amd64 0.3.8-2ubuntu1 [11.5 kB] -Get:55 http://archive.ubuntu.com/ubuntu/ trusty/main wireless-regdb all 2013.02.13-1ubuntu1 [6,456 B] -Get:56 http://archive.ubuntu.com/ubuntu/ trusty/main crda amd64 1.1.2-1ubuntu2 [15.2 kB] -Get:57 http://archive.ubuntu.com/ubuntu/ trusty/multiverse iucode-tool amd64 1.0.1-1 [28.1 kB] -Get:58 http://archive.ubuntu.com/ubuntu/ trusty/main iw amd64 3.4-1 [51.7 kB] -Get:59 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libepoxy0 amd64 1.1-1build1 [157 kB] -Get:60 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-firmware all 1.127.24 [33.9 MB] -Get:61 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-modules-4.4.0-148-generic amd64 4.4.0-148.174~14.04.1 [11.2 MB] -Get:62 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-image-4.4.0-148-generic amd64 4.4.0-148.174~14.04.1 [6,827 kB] -Get:63 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-modules-extra-4.4.0-148-generic amd64 4.4.0-148.174~14.04.1 [36.2 MB] -Get:64 http://archive.ubuntu.com/ubuntu/ trusty-updates/main intel-microcode amd64 3.20190618.0ubuntu0.14.04.1 [1,924 kB] -Get:65 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64-microcode amd64 3.20180524.1~ubuntu0.14.04.2+really20130710.1ubuntu1 [26.3 kB] -Get:66 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-image-generic-lts-xenial amd64 4.4.0.148.130 [2,792 B] -Get:67 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-headers-4.4.0-148 all 4.4.0-148.174~14.04.1 [10.1 MB] -Get:68 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-headers-4.4.0-148-generic amd64 4.4.0-148.174~14.04.1 [824 kB] -Get:69 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-headers-generic-lts-xenial amd64 4.4.0.148.130 [2,628 B] -Get:70 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-generic-lts-xenial amd64 4.4.0.148.130 [1,804 B] -Get:71 http://archive.ubuntu.com/ubuntu/ trusty-updates/main thermald amd64 1.4.3-5~14.04.4 [202 kB] -Get:72 http://archive.ubuntu.com/ubuntu/ trusty/main x11-xkb-utils amd64 7.7+1 [156 kB] -Get:73 http://archive.ubuntu.com/ubuntu/ trusty/main xfonts-encodings all 1:1.0.4-1ubuntu1 [583 kB] -Get:74 http://archive.ubuntu.com/ubuntu/ trusty/main xfonts-utils amd64 1:7.7+1 [73.9 kB] -Get:75 http://archive.ubuntu.com/ubuntu/ trusty/main xfonts-base all 1:1.0.3 [6,180 kB] -Get:76 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-common all 2:1.15.1-0ubuntu2.11 [28.7 kB] -Get:77 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-core-lts-xenial amd64 2:1.18.3-1ubuntu2.3~trusty4 [1,297 kB] -Get:78 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-input-evdev-lts-xenial amd64 1:2.10.1-1ubuntu2~trusty1 [30.9 kB] -Get:79 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-input-synaptics-lts-xenial amd64 1.8.2-1ubuntu3~trusty1 [62.2 kB] -Get:80 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-input-vmmouse-lts-xenial amd64 1:13.1.0-1ubuntu2~trusty1 [14.2 kB] -Get:81 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-input-wacom-lts-xenial amd64 1:0.32.0-0ubuntu3~trusty1 [83.3 kB] -Get:82 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-input-all-lts-xenial amd64 1:7.7+13ubuntu3~trusty2 [4,354 B] -Get:83 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-lts-xenial amd64 1:7.7+13ubuntu3~trusty2 [4,908 B] -Get:84 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-amdgpu-lts-xenial amd64 1.1.0-1~trusty1 [50.4 kB] -Get:85 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-radeon-lts-xenial amd64 1:7.7.0-1~trusty2 [134 kB] -Get:86 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-r128-lts-xenial amd64 6.10.0-1build2~trusty1 [47.1 kB] -Get:87 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-mach64-lts-xenial amd64 6.9.5-1build2~trusty1 [57.3 kB] -Get:88 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-ati-lts-xenial amd64 1:7.7.0-1~trusty2 [6,846 B] -Get:89 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-fbdev-lts-xenial amd64 1:0.4.4-1build5~trusty1 [11.6 kB] -Get:90 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-nouveau-lts-xenial amd64 1:1.0.12-1build2~trusty1 [83.0 kB] -Get:91 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-vesa-lts-xenial amd64 1:2.3.4-1build2~trusty1 [14.5 kB] -Get:92 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-vmware-lts-xenial amd64 1:13.1.0-2ubuntu3~trusty1 [65.7 kB] -Get:93 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-cirrus-lts-xenial amd64 1:1.5.3-1ubuntu3~trusty1 [28.0 kB] -Get:94 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-mga-lts-xenial amd64 1:1.6.4-1build2~trusty1 [56.3 kB] -Get:95 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-neomagic-lts-xenial amd64 1:1.2.9-1build2~trusty1 [28.9 kB] -Get:96 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-openchrome-lts-xenial amd64 1:0.3.3+git20160310-1~trusty1 [138 kB] -Get:97 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-savage-lts-xenial amd64 1:2.3.8-1ubuntu3~trusty1 [59.5 kB] -Get:98 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-siliconmotion-lts-xenial amd64 1:1.7.8-1ubuntu6~trusty1 [47.6 kB] -Get:99 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-sisusb-lts-xenial amd64 1:0.9.6-2build5~trusty1 [36.0 kB] -Get:100 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-tdfx-lts-xenial amd64 1:1.4.6-1build2~trusty1 [28.8 kB] -Get:101 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-trident-lts-xenial amd64 1:1.3.7-1build2~trusty1 [53.3 kB] -Get:102 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-all-lts-xenial amd64 1:7.7+13ubuntu3~trusty2 [4,450 B] -Get:103 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-intel-lts-xenial amd64 2:2.99.917+git20160325-1ubuntu1~trusty1 [688 kB] -Get:104 http://archive.ubuntu.com/ubuntu/ trusty-updates/main xserver-xorg-video-qxl-lts-xenial amd64 0.1.4-3ubuntu3~trusty1 [77.8 kB] -debconf: unable to initialize frontend: Dialog -debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.) -debconf: falling back to frontend: Readline -debconf: unable to initialize frontend: Readline -debconf: (This frontend requires a controlling tty.) -debconf: falling back to frontend: Teletype -dpkg-preconfigure: unable to re-open stdin: -Fetched 129 MB in 3min 5s (693 kB/s) -Selecting previously unselected package libdrm-amdgpu1:amd64. -(Reading database ... 51418 files and directories currently installed.) -Preparing to unpack .../libdrm-amdgpu1_2.4.67-1ubuntu0.14.04.2_amd64.deb ... -Unpacking libdrm-amdgpu1:amd64 (2.4.67-1ubuntu0.14.04.2) ... -Selecting previously unselected package libpciaccess0:amd64. -Preparing to unpack .../libpciaccess0_0.13.2-1_amd64.deb ... -Unpacking libpciaccess0:amd64 (0.13.2-1) ... -Selecting previously unselected package libdrm-intel1:amd64. -Preparing to unpack .../libdrm-intel1_2.4.67-1ubuntu0.14.04.2_amd64.deb ... -Unpacking libdrm-intel1:amd64 (2.4.67-1ubuntu0.14.04.2) ... -Selecting previously unselected package libdrm-nouveau2:amd64. -Preparing to unpack .../libdrm-nouveau2_2.4.67-1ubuntu0.14.04.2_amd64.deb ... -Unpacking libdrm-nouveau2:amd64 (2.4.67-1ubuntu0.14.04.2) ... -Selecting previously unselected package libdrm-radeon1:amd64. -Preparing to unpack .../libdrm-radeon1_2.4.67-1ubuntu0.14.04.2_amd64.deb ... -Unpacking libdrm-radeon1:amd64 (2.4.67-1ubuntu0.14.04.2) ... -Selecting previously unselected package libwayland-client0:amd64. -Preparing to unpack .../libwayland-client0_1.4.0-1ubuntu1.1_amd64.deb ... -Unpacking libwayland-client0:amd64 (1.4.0-1ubuntu1.1) ... -Selecting previously unselected package libwayland-server0:amd64. -Preparing to unpack .../libwayland-server0_1.4.0-1ubuntu1.1_amd64.deb ... -Unpacking libwayland-server0:amd64 (1.4.0-1ubuntu1.1) ... -Selecting previously unselected package libgbm1-lts-xenial:amd64. -Preparing to unpack .../libgbm1-lts-xenial_11.2.0-1ubuntu2~trusty2_amd64.deb ... -Adding 'diversion of /usr/lib/x86_64-linux-gnu/libgbm.so.1.0.0 to /usr/lib/x86_64-linux-gnu/old.libgbm.so.1.0.0 by libgbm1-lts-xenial' -Adding 'diversion of /usr/lib/x86_64-linux-gnu/libgbm.so.1 to /usr/lib/x86_64-linux-gnu/old.libgbm.so.1 by libgbm1-lts-xenial' -Adding 'diversion of /usr/lib/x86_64-linux-gnu/gbm/gbm_gallium_drm.so to /usr/lib/x86_64-linux-gnu/gbm/old.gbm_gallium_drm.so by libgbm1-lts-xenial' -Unpacking libgbm1-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... -Selecting previously unselected package libx11-xcb1:amd64. -Preparing to unpack .../libx11-xcb1_2%3a1.6.2-1ubuntu2.1_amd64.deb ... -Unpacking libx11-xcb1:amd64 (2:1.6.2-1ubuntu2.1) ... -Selecting previously unselected package libxcb-dri2-0:amd64. -Preparing to unpack .../libxcb-dri2-0_1.10-2ubuntu1_amd64.deb ... -Unpacking libxcb-dri2-0:amd64 (1.10-2ubuntu1) ... -Selecting previously unselected package libxcb-dri3-0:amd64. -Preparing to unpack .../libxcb-dri3-0_1.10-2ubuntu1_amd64.deb ... -Unpacking libxcb-dri3-0:amd64 (1.10-2ubuntu1) ... -Selecting previously unselected package libxcb-present0:amd64. -Preparing to unpack .../libxcb-present0_1.10-2ubuntu1_amd64.deb ... -Unpacking libxcb-present0:amd64 (1.10-2ubuntu1) ... -Selecting previously unselected package libxcb-sync1:amd64. -Preparing to unpack .../libxcb-sync1_1.10-2ubuntu1_amd64.deb ... -Unpacking libxcb-sync1:amd64 (1.10-2ubuntu1) ... -Selecting previously unselected package libxcb-xfixes0:amd64. -Preparing to unpack .../libxcb-xfixes0_1.10-2ubuntu1_amd64.deb ... -Unpacking libxcb-xfixes0:amd64 (1.10-2ubuntu1) ... -Selecting previously unselected package libxshmfence1:amd64. -Preparing to unpack .../libxshmfence1_1.1-2_amd64.deb ... -Unpacking libxshmfence1:amd64 (1.1-2) ... -Selecting previously unselected package libllvm3.8v4:amd64. -Preparing to unpack .../libllvm3.8v4_1%3a3.8-2ubuntu3~trusty5_amd64.deb ... -Unpacking libllvm3.8v4:amd64 (1:3.8-2ubuntu3~trusty5) ... -Selecting previously unselected package libgl1-mesa-dri-lts-xenial:amd64. -Preparing to unpack .../libgl1-mesa-dri-lts-xenial_11.2.0-1ubuntu2~trusty2_amd64.deb ... -Unpacking libgl1-mesa-dri-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... -Selecting previously unselected package libegl1-mesa-lts-xenial:amd64. -Preparing to unpack .../libegl1-mesa-lts-xenial_11.2.0-1ubuntu2~trusty2_amd64.deb ... -Unpacking libegl1-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... -Selecting previously unselected package libfontenc1:amd64. -Preparing to unpack .../libfontenc1_1%3a1.1.2-1_amd64.deb ... -Unpacking libfontenc1:amd64 (1:1.1.2-1) ... -Selecting previously unselected package libglapi-mesa-lts-xenial:amd64. -Preparing to unpack .../libglapi-mesa-lts-xenial_11.2.0-1ubuntu2~trusty2_amd64.deb ... -Unpacking libglapi-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... -Selecting previously unselected package libxcb-glx0:amd64. -Preparing to unpack .../libxcb-glx0_1.10-2ubuntu1_amd64.deb ... -Unpacking libxcb-glx0:amd64 (1.10-2ubuntu1) ... -Selecting previously unselected package libxdamage1:amd64. -Preparing to unpack .../libxdamage1_1%3a1.1.4-1ubuntu1_amd64.deb ... -Unpacking libxdamage1:amd64 (1:1.1.4-1ubuntu1) ... -Selecting previously unselected package libxfixes3:amd64. -Preparing to unpack .../libxfixes3_1%3a5.0.1-1ubuntu1.1_amd64.deb ... -Unpacking libxfixes3:amd64 (1:5.0.1-1ubuntu1.1) ... -Selecting previously unselected package libxxf86vm1:amd64. -Preparing to unpack .../libxxf86vm1_1%3a1.1.3-1_amd64.deb ... -Unpacking libxxf86vm1:amd64 (1:1.1.3-1) ... -Selecting previously unselected package libgl1-mesa-glx-lts-xenial:amd64. -Preparing to unpack .../libgl1-mesa-glx-lts-xenial_11.2.0-1ubuntu2~trusty2_amd64.deb ... -Unpacking libgl1-mesa-glx-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... -Selecting previously unselected package libgles1-mesa-lts-xenial:amd64. -Preparing to unpack .../libgles1-mesa-lts-xenial_11.2.0-1ubuntu2~trusty2_amd64.deb ... -Unpacking libgles1-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... -Selecting previously unselected package libgles2-mesa-lts-xenial:amd64. -Preparing to unpack .../libgles2-mesa-lts-xenial_11.2.0-1ubuntu2~trusty2_amd64.deb ... -Unpacking libgles2-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... -Selecting previously unselected package x11-common. -Preparing to unpack .../x11-common_1%3a7.7+1ubuntu8.1_all.deb ... -debconf: unable to initialize frontend: Dialog -debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.) -debconf: falling back to frontend: Readline -debconf: unable to initialize frontend: Readline -debconf: (This frontend requires a controlling tty.) -debconf: falling back to frontend: Teletype -Unpacking x11-common (1:7.7+1ubuntu8.1) ... -Selecting previously unselected package libice6:amd64. -Preparing to unpack .../libice6_2%3a1.0.8-2_amd64.deb ... -Unpacking libice6:amd64 (2:1.0.8-2) ... -Selecting previously unselected package libmtdev1:amd64. -Preparing to unpack .../libmtdev1_1.1.4-1ubuntu1_amd64.deb ... -Unpacking libmtdev1:amd64 (1.1.4-1ubuntu1) ... -Selecting previously unselected package libnl-3-200:amd64. -Preparing to unpack .../libnl-3-200_3.2.21-1ubuntu4.1_amd64.deb ... -Unpacking libnl-3-200:amd64 (3.2.21-1ubuntu4.1) ... -Selecting previously unselected package libnl-genl-3-200:amd64. -Preparing to unpack .../libnl-genl-3-200_3.2.21-1ubuntu4.1_amd64.deb ... -Unpacking libnl-genl-3-200:amd64 (3.2.21-1ubuntu4.1) ... -Selecting previously unselected package libpixman-1-0:amd64. -Preparing to unpack .../libpixman-1-0_0.30.2-2ubuntu1.2_amd64.deb ... -Unpacking libpixman-1-0:amd64 (0.30.2-2ubuntu1.2) ... -Selecting previously unselected package libsm6:amd64. -Preparing to unpack .../libsm6_2%3a1.2.1-2_amd64.deb ... -Unpacking libsm6:amd64 (2:1.2.1-2) ... -Selecting previously unselected package libwayland-egl1-mesa-lts-xenial:amd64. -Preparing to unpack .../libwayland-egl1-mesa-lts-xenial_11.2.0-1ubuntu2~trusty2_amd64.deb ... -Unpacking libwayland-egl1-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... -Selecting previously unselected package libxatracker2-lts-xenial:amd64. -Preparing to unpack .../libxatracker2-lts-xenial_11.2.0-1ubuntu2~trusty2_amd64.deb ... -Unpacking libxatracker2-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... -Selecting previously unselected package libxt6:amd64. -Preparing to unpack .../libxt6_1%3a1.1.4-1_amd64.deb ... -Unpacking libxt6:amd64 (1:1.1.4-1) ... -Selecting previously unselected package libxmu6:amd64. -Preparing to unpack .../libxmu6_2%3a1.1.1-1_amd64.deb ... -Unpacking libxmu6:amd64 (2:1.1.1-1) ... -Selecting previously unselected package libxpm4:amd64. -Preparing to unpack .../libxpm4_1%3a3.5.10-1ubuntu0.1_amd64.deb ... -Unpacking libxpm4:amd64 (1:3.5.10-1ubuntu0.1) ... -Selecting previously unselected package libxaw7:amd64. -Preparing to unpack .../libxaw7_2%3a1.0.12-1_amd64.deb ... -Unpacking libxaw7:amd64 (2:1.0.12-1) ... -Selecting previously unselected package libxrender1:amd64. -Preparing to unpack .../libxrender1_1%3a0.9.8-1build0.14.04.1_amd64.deb ... -Unpacking libxrender1:amd64 (1:0.9.8-1build0.14.04.1) ... -Selecting previously unselected package libxcursor1:amd64. -Preparing to unpack .../libxcursor1_1%3a1.1.14-1ubuntu0.14.04.2_amd64.deb ... -Unpacking libxcursor1:amd64 (1:1.1.14-1ubuntu0.14.04.2) ... -Selecting previously unselected package libxfont1:amd64. -Preparing to unpack .../libxfont1_1%3a1.4.7-1ubuntu0.4_amd64.deb ... -Unpacking libxfont1:amd64 (1:1.4.7-1ubuntu0.4) ... -Selecting previously unselected package libxi6:amd64. -Preparing to unpack .../libxi6_2%3a1.7.1.901-1ubuntu1.1_amd64.deb ... -Unpacking libxi6:amd64 (2:1.7.1.901-1ubuntu1.1) ... -Selecting previously unselected package libxinerama1:amd64. -Preparing to unpack .../libxinerama1_2%3a1.1.3-1_amd64.deb ... -Unpacking libxinerama1:amd64 (2:1.1.3-1) ... -Selecting previously unselected package libxkbfile1:amd64. -Preparing to unpack .../libxkbfile1_1%3a1.0.8-1_amd64.deb ... -Unpacking libxkbfile1:amd64 (1:1.0.8-1) ... -Selecting previously unselected package libxrandr2:amd64. -Preparing to unpack .../libxrandr2_2%3a1.5.0-1~trusty1_amd64.deb ... -Unpacking libxrandr2:amd64 (2:1.5.0-1~trusty1) ... -Selecting previously unselected package libxss1:amd64. -Preparing to unpack .../libxss1_1%3a1.2.2-1_amd64.deb ... -Unpacking libxss1:amd64 (1:1.2.2-1) ... -Selecting previously unselected package libxtst6:amd64. -Preparing to unpack .../libxtst6_2%3a1.2.2-1_amd64.deb ... -Unpacking libxtst6:amd64 (2:1.2.2-1) ... -Selecting previously unselected package libxv1:amd64. -Preparing to unpack .../libxv1_2%3a1.0.10-1_amd64.deb ... -Unpacking libxv1:amd64 (2:1.0.10-1) ... -Selecting previously unselected package libxvmc1:amd64. -Preparing to unpack .../libxvmc1_2%3a1.0.8-1ubuntu1_amd64.deb ... -Unpacking libxvmc1:amd64 (2:1.0.8-1ubuntu1) ... -Selecting previously unselected package libevdev2. -Preparing to unpack .../libevdev2_1.0.99.2+dfsg-2ubuntu2_amd64.deb ... -Unpacking libevdev2 (1.0.99.2+dfsg-2ubuntu2) ... -Selecting previously unselected package libtxc-dxtn-s2tc0:amd64. -Preparing to unpack .../libtxc-dxtn-s2tc0_0~git20131104-1.1_amd64.deb ... -Unpacking libtxc-dxtn-s2tc0:amd64 (0~git20131104-1.1) ... -Selecting previously unselected package libxcb-util0:amd64. -Preparing to unpack .../libxcb-util0_0.3.8-2ubuntu1_amd64.deb ... -Unpacking libxcb-util0:amd64 (0.3.8-2ubuntu1) ... -Selecting previously unselected package wireless-regdb. -Preparing to unpack .../wireless-regdb_2013.02.13-1ubuntu1_all.deb ... -Unpacking wireless-regdb (2013.02.13-1ubuntu1) ... -Selecting previously unselected package crda. -Preparing to unpack .../crda_1.1.2-1ubuntu2_amd64.deb ... -Unpacking crda (1.1.2-1ubuntu2) ... -Selecting previously unselected package iucode-tool. -Preparing to unpack .../iucode-tool_1.0.1-1_amd64.deb ... -Unpacking iucode-tool (1.0.1-1) ... -Selecting previously unselected package iw. -Preparing to unpack .../archives/iw_3.4-1_amd64.deb ... -Unpacking iw (3.4-1) ... -Selecting previously unselected package libepoxy0. -Preparing to unpack .../libepoxy0_1.1-1build1_amd64.deb ... -Unpacking libepoxy0 (1.1-1build1) ... -Selecting previously unselected package linux-firmware. -Preparing to unpack .../linux-firmware_1.127.24_all.deb ... -Unpacking linux-firmware (1.127.24) ... -Selecting previously unselected package linux-modules-4.4.0-148-generic. -Preparing to unpack .../linux-modules-4.4.0-148-generic_4.4.0-148.174~14.04.1_amd64.deb ... -Unpacking linux-modules-4.4.0-148-generic (4.4.0-148.174~14.04.1) ... -Selecting previously unselected package linux-image-4.4.0-148-generic. -Preparing to unpack .../linux-image-4.4.0-148-generic_4.4.0-148.174~14.04.1_amd64.deb ... -Unpacking linux-image-4.4.0-148-generic (4.4.0-148.174~14.04.1) ... -Selecting previously unselected package linux-modules-extra-4.4.0-148-generic. -Preparing to unpack .../linux-modules-extra-4.4.0-148-generic_4.4.0-148.174~14.04.1_amd64.deb ... -Unpacking linux-modules-extra-4.4.0-148-generic (4.4.0-148.174~14.04.1) ... -Selecting previously unselected package intel-microcode. -Preparing to unpack .../intel-microcode_3.20190618.0ubuntu0.14.04.1_amd64.deb ... -Unpacking intel-microcode (3.20190618.0ubuntu0.14.04.1) ... -Selecting previously unselected package amd64-microcode. -Preparing to unpack .../amd64-microcode_3.20180524.1~ubuntu0.14.04.2+really20130710.1ubuntu1_amd64.deb ... -Unpacking amd64-microcode (3.20180524.1~ubuntu0.14.04.2+really20130710.1ubuntu1) ... -Selecting previously unselected package linux-image-generic-lts-xenial. -Preparing to unpack .../linux-image-generic-lts-xenial_4.4.0.148.130_amd64.deb ... -Unpacking linux-image-generic-lts-xenial (4.4.0.148.130) ... -Selecting previously unselected package linux-headers-4.4.0-148. -Preparing to unpack .../linux-headers-4.4.0-148_4.4.0-148.174~14.04.1_all.deb ... -Unpacking linux-headers-4.4.0-148 (4.4.0-148.174~14.04.1) ... -Selecting previously unselected package linux-headers-4.4.0-148-generic. -Preparing to unpack .../linux-headers-4.4.0-148-generic_4.4.0-148.174~14.04.1_amd64.deb ... -Unpacking linux-headers-4.4.0-148-generic (4.4.0-148.174~14.04.1) ... -Selecting previously unselected package linux-headers-generic-lts-xenial. -Preparing to unpack .../linux-headers-generic-lts-xenial_4.4.0.148.130_amd64.deb ... -Unpacking linux-headers-generic-lts-xenial (4.4.0.148.130) ... -Selecting previously unselected package linux-generic-lts-xenial. -Preparing to unpack .../linux-generic-lts-xenial_4.4.0.148.130_amd64.deb ... -Unpacking linux-generic-lts-xenial (4.4.0.148.130) ... -Selecting previously unselected package thermald. -Preparing to unpack .../thermald_1.4.3-5~14.04.4_amd64.deb ... -Unpacking thermald (1.4.3-5~14.04.4) ... -Selecting previously unselected package x11-xkb-utils. -Preparing to unpack .../x11-xkb-utils_7.7+1_amd64.deb ... -Unpacking x11-xkb-utils (7.7+1) ... -Selecting previously unselected package xfonts-encodings. -Preparing to unpack .../xfonts-encodings_1%3a1.0.4-1ubuntu1_all.deb ... -Unpacking xfonts-encodings (1:1.0.4-1ubuntu1) ... -Selecting previously unselected package xfonts-utils. -Preparing to unpack .../xfonts-utils_1%3a7.7+1_amd64.deb ... -Unpacking xfonts-utils (1:7.7+1) ... -Selecting previously unselected package xfonts-base. -Preparing to unpack .../xfonts-base_1%3a1.0.3_all.deb ... -Unpacking xfonts-base (1:1.0.3) ... -Selecting previously unselected package xserver-common. -Preparing to unpack .../xserver-common_2%3a1.15.1-0ubuntu2.11_all.deb ... -Unpacking xserver-common (2:1.15.1-0ubuntu2.11) ... -Selecting previously unselected package xserver-xorg-core-lts-xenial. -Preparing to unpack .../xserver-xorg-core-lts-xenial_2%3a1.18.3-1ubuntu2.3~trusty4_amd64.deb ... -Unpacking xserver-xorg-core-lts-xenial (2:1.18.3-1ubuntu2.3~trusty4) ... -Selecting previously unselected package xserver-xorg-input-evdev-lts-xenial. -Preparing to unpack .../xserver-xorg-input-evdev-lts-xenial_1%3a2.10.1-1ubuntu2~trusty1_amd64.deb ... -Unpacking xserver-xorg-input-evdev-lts-xenial (1:2.10.1-1ubuntu2~trusty1) ... -Selecting previously unselected package xserver-xorg-input-synaptics-lts-xenial. -Preparing to unpack .../xserver-xorg-input-synaptics-lts-xenial_1.8.2-1ubuntu3~trusty1_amd64.deb ... -Unpacking xserver-xorg-input-synaptics-lts-xenial (1.8.2-1ubuntu3~trusty1) ... -Selecting previously unselected package xserver-xorg-input-vmmouse-lts-xenial. -Preparing to unpack .../xserver-xorg-input-vmmouse-lts-xenial_1%3a13.1.0-1ubuntu2~trusty1_amd64.deb ... -Unpacking xserver-xorg-input-vmmouse-lts-xenial (1:13.1.0-1ubuntu2~trusty1) ... -Selecting previously unselected package xserver-xorg-input-wacom-lts-xenial. -Preparing to unpack .../xserver-xorg-input-wacom-lts-xenial_1%3a0.32.0-0ubuntu3~trusty1_amd64.deb ... -Unpacking xserver-xorg-input-wacom-lts-xenial (1:0.32.0-0ubuntu3~trusty1) ... -Selecting previously unselected package xserver-xorg-input-all-lts-xenial. -Preparing to unpack .../xserver-xorg-input-all-lts-xenial_1%3a7.7+13ubuntu3~trusty2_amd64.deb ... -Unpacking xserver-xorg-input-all-lts-xenial (1:7.7+13ubuntu3~trusty2) ... -Selecting previously unselected package xserver-xorg-lts-xenial. -Preparing to unpack .../xserver-xorg-lts-xenial_1%3a7.7+13ubuntu3~trusty2_amd64.deb ... -Unpacking xserver-xorg-lts-xenial (1:7.7+13ubuntu3~trusty2) ... -Selecting previously unselected package xserver-xorg-video-amdgpu-lts-xenial. -Preparing to unpack .../xserver-xorg-video-amdgpu-lts-xenial_1.1.0-1~trusty1_amd64.deb ... -Unpacking xserver-xorg-video-amdgpu-lts-xenial (1.1.0-1~trusty1) ... -Selecting previously unselected package xserver-xorg-video-radeon-lts-xenial. -Preparing to unpack .../xserver-xorg-video-radeon-lts-xenial_1%3a7.7.0-1~trusty2_amd64.deb ... -Unpacking xserver-xorg-video-radeon-lts-xenial (1:7.7.0-1~trusty2) ... -Selecting previously unselected package xserver-xorg-video-r128-lts-xenial. -Preparing to unpack .../xserver-xorg-video-r128-lts-xenial_6.10.0-1build2~trusty1_amd64.deb ... -Unpacking xserver-xorg-video-r128-lts-xenial (6.10.0-1build2~trusty1) ... -Selecting previously unselected package xserver-xorg-video-mach64-lts-xenial. -Preparing to unpack .../xserver-xorg-video-mach64-lts-xenial_6.9.5-1build2~trusty1_amd64.deb ... -Unpacking xserver-xorg-video-mach64-lts-xenial (6.9.5-1build2~trusty1) ... -Selecting previously unselected package xserver-xorg-video-ati-lts-xenial. -Preparing to unpack .../xserver-xorg-video-ati-lts-xenial_1%3a7.7.0-1~trusty2_amd64.deb ... -Unpacking xserver-xorg-video-ati-lts-xenial (1:7.7.0-1~trusty2) ... -Selecting previously unselected package xserver-xorg-video-fbdev-lts-xenial. -Preparing to unpack .../xserver-xorg-video-fbdev-lts-xenial_1%3a0.4.4-1build5~trusty1_amd64.deb ... -Unpacking xserver-xorg-video-fbdev-lts-xenial (1:0.4.4-1build5~trusty1) ... -Selecting previously unselected package xserver-xorg-video-nouveau-lts-xenial. -Preparing to unpack .../xserver-xorg-video-nouveau-lts-xenial_1%3a1.0.12-1build2~trusty1_amd64.deb ... -Unpacking xserver-xorg-video-nouveau-lts-xenial (1:1.0.12-1build2~trusty1) ... -Selecting previously unselected package xserver-xorg-video-vesa-lts-xenial. -Preparing to unpack .../xserver-xorg-video-vesa-lts-xenial_1%3a2.3.4-1build2~trusty1_amd64.deb ... -Unpacking xserver-xorg-video-vesa-lts-xenial (1:2.3.4-1build2~trusty1) ... -Selecting previously unselected package xserver-xorg-video-vmware-lts-xenial. -Preparing to unpack .../xserver-xorg-video-vmware-lts-xenial_1%3a13.1.0-2ubuntu3~trusty1_amd64.deb ... -Unpacking xserver-xorg-video-vmware-lts-xenial (1:13.1.0-2ubuntu3~trusty1) ... -Selecting previously unselected package xserver-xorg-video-cirrus-lts-xenial. -Preparing to unpack .../xserver-xorg-video-cirrus-lts-xenial_1%3a1.5.3-1ubuntu3~trusty1_amd64.deb ... -Unpacking xserver-xorg-video-cirrus-lts-xenial (1:1.5.3-1ubuntu3~trusty1) ... -Selecting previously unselected package xserver-xorg-video-mga-lts-xenial. -Preparing to unpack .../xserver-xorg-video-mga-lts-xenial_1%3a1.6.4-1build2~trusty1_amd64.deb ... -Unpacking xserver-xorg-video-mga-lts-xenial (1:1.6.4-1build2~trusty1) ... -Selecting previously unselected package xserver-xorg-video-neomagic-lts-xenial. -Preparing to unpack .../xserver-xorg-video-neomagic-lts-xenial_1%3a1.2.9-1build2~trusty1_amd64.deb ... -Unpacking xserver-xorg-video-neomagic-lts-xenial (1:1.2.9-1build2~trusty1) ... -Selecting previously unselected package xserver-xorg-video-openchrome-lts-xenial. -Preparing to unpack .../xserver-xorg-video-openchrome-lts-xenial_1%3a0.3.3+git20160310-1~trusty1_amd64.deb ... -Unpacking xserver-xorg-video-openchrome-lts-xenial (1:0.3.3+git20160310-1~trusty1) ... -Selecting previously unselected package xserver-xorg-video-savage-lts-xenial. -Preparing to unpack .../xserver-xorg-video-savage-lts-xenial_1%3a2.3.8-1ubuntu3~trusty1_amd64.deb ... -Unpacking xserver-xorg-video-savage-lts-xenial (1:2.3.8-1ubuntu3~trusty1) ... -Selecting previously unselected package xserver-xorg-video-siliconmotion-lts-xenial. -Preparing to unpack .../xserver-xorg-video-siliconmotion-lts-xenial_1%3a1.7.8-1ubuntu6~trusty1_amd64.deb ... -Unpacking xserver-xorg-video-siliconmotion-lts-xenial (1:1.7.8-1ubuntu6~trusty1) ... -Selecting previously unselected package xserver-xorg-video-sisusb-lts-xenial. -Preparing to unpack .../xserver-xorg-video-sisusb-lts-xenial_1%3a0.9.6-2build5~trusty1_amd64.deb ... -Unpacking xserver-xorg-video-sisusb-lts-xenial (1:0.9.6-2build5~trusty1) ... -Selecting previously unselected package xserver-xorg-video-tdfx-lts-xenial. -Preparing to unpack .../xserver-xorg-video-tdfx-lts-xenial_1%3a1.4.6-1build2~trusty1_amd64.deb ... -Unpacking xserver-xorg-video-tdfx-lts-xenial (1:1.4.6-1build2~trusty1) ... -Selecting previously unselected package xserver-xorg-video-trident-lts-xenial. -Preparing to unpack .../xserver-xorg-video-trident-lts-xenial_1%3a1.3.7-1build2~trusty1_amd64.deb ... -Unpacking xserver-xorg-video-trident-lts-xenial (1:1.3.7-1build2~trusty1) ... -Selecting previously unselected package xserver-xorg-video-all-lts-xenial. -Preparing to unpack .../xserver-xorg-video-all-lts-xenial_1%3a7.7+13ubuntu3~trusty2_amd64.deb ... -Unpacking xserver-xorg-video-all-lts-xenial (1:7.7+13ubuntu3~trusty2) ... -Selecting previously unselected package xserver-xorg-video-intel-lts-xenial. -Preparing to unpack .../xserver-xorg-video-intel-lts-xenial_2%3a2.99.917+git20160325-1ubuntu1~trusty1_amd64.deb ... -Unpacking xserver-xorg-video-intel-lts-xenial (2:2.99.917+git20160325-1ubuntu1~trusty1) ... -Selecting previously unselected package xserver-xorg-video-qxl-lts-xenial. -Preparing to unpack .../xserver-xorg-video-qxl-lts-xenial_0.1.4-3ubuntu3~trusty1_amd64.deb ... -Unpacking xserver-xorg-video-qxl-lts-xenial (0.1.4-3ubuntu3~trusty1) ... -Processing triggers for man-db (2.6.7.1-1ubuntu1) ... -Processing triggers for ureadahead (0.100.0-16) ... -Setting up libdrm-amdgpu1:amd64 (2.4.67-1ubuntu0.14.04.2) ... -Setting up libpciaccess0:amd64 (0.13.2-1) ... -Setting up libdrm-intel1:amd64 (2.4.67-1ubuntu0.14.04.2) ... -Setting up libdrm-nouveau2:amd64 (2.4.67-1ubuntu0.14.04.2) ... -Setting up libdrm-radeon1:amd64 (2.4.67-1ubuntu0.14.04.2) ... -Setting up libwayland-client0:amd64 (1.4.0-1ubuntu1.1) ... -Setting up libwayland-server0:amd64 (1.4.0-1ubuntu1.1) ... -Setting up libgbm1-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... -Setting up libx11-xcb1:amd64 (2:1.6.2-1ubuntu2.1) ... -Setting up libxcb-dri2-0:amd64 (1.10-2ubuntu1) ... -Setting up libxcb-dri3-0:amd64 (1.10-2ubuntu1) ... -Setting up libxcb-present0:amd64 (1.10-2ubuntu1) ... -Setting up libxcb-sync1:amd64 (1.10-2ubuntu1) ... -Setting up libxcb-xfixes0:amd64 (1.10-2ubuntu1) ... -Setting up libxshmfence1:amd64 (1.1-2) ... -Setting up libllvm3.8v4:amd64 (1:3.8-2ubuntu3~trusty5) ... -Setting up libgl1-mesa-dri-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... -Setting up libegl1-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... -update-alternatives: using /usr/lib/x86_64-linux-gnu/mesa-egl/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_EGL.conf (x86_64-linux-gnu_egl_conf) in auto mode -Setting up libfontenc1:amd64 (1:1.1.2-1) ... -Setting up libglapi-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... -Setting up libxcb-glx0:amd64 (1.10-2ubuntu1) ... -Setting up libxdamage1:amd64 (1:1.1.4-1ubuntu1) ... -Setting up libxfixes3:amd64 (1:5.0.1-1ubuntu1.1) ... -Setting up libxxf86vm1:amd64 (1:1.1.3-1) ... -Setting up libgl1-mesa-glx-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... -update-alternatives: using /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf (x86_64-linux-gnu_gl_conf) in auto mode -Setting up libgles1-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... -Setting up libgles2-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... -Setting up x11-common (1:7.7+1ubuntu8.1) ... -debconf: unable to initialize frontend: Dialog -debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.) -debconf: falling back to frontend: Readline -debconf: unable to initialize frontend: Readline -debconf: (This frontend requires a controlling tty.) -debconf: falling back to frontend: Teletype - * Setting up X socket directories... - ...done. -Setting up libmtdev1:amd64 (1.1.4-1ubuntu1) ... -Setting up libnl-3-200:amd64 (3.2.21-1ubuntu4.1) ... -Setting up libnl-genl-3-200:amd64 (3.2.21-1ubuntu4.1) ... -Setting up libpixman-1-0:amd64 (0.30.2-2ubuntu1.2) ... -Setting up libwayland-egl1-mesa-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... -Setting up libxatracker2-lts-xenial:amd64 (11.2.0-1ubuntu2~trusty2) ... -Setting up libxpm4:amd64 (1:3.5.10-1ubuntu0.1) ... -Setting up libxrender1:amd64 (1:0.9.8-1build0.14.04.1) ... -Setting up libxcursor1:amd64 (1:1.1.14-1ubuntu0.14.04.2) ... -Setting up libxfont1:amd64 (1:1.4.7-1ubuntu0.4) ... -Setting up libxi6:amd64 (2:1.7.1.901-1ubuntu1.1) ... -Setting up libxinerama1:amd64 (2:1.1.3-1) ... -Setting up libxkbfile1:amd64 (1:1.0.8-1) ... -Setting up libxrandr2:amd64 (2:1.5.0-1~trusty1) ... -Setting up libxv1:amd64 (2:1.0.10-1) ... -Setting up libevdev2 (1.0.99.2+dfsg-2ubuntu2) ... -Setting up libtxc-dxtn-s2tc0:amd64 (0~git20131104-1.1) ... -update-alternatives: using /usr/lib/x86_64-linux-gnu/libtxc_dxtn_s2tc.so.0 to provide /usr/lib/x86_64-linux-gnu/libtxc_dxtn.so (libtxc-dxtn-x86_64-linux-gnu) in auto mode -Setting up libxcb-util0:amd64 (0.3.8-2ubuntu1) ... -Setting up wireless-regdb (2013.02.13-1ubuntu1) ... -Setting up crda (1.1.2-1ubuntu2) ... -Setting up iucode-tool (1.0.1-1) ... -Setting up iw (3.4-1) ... -Setting up libepoxy0 (1.1-1build1) ... -Setting up linux-firmware (1.127.24) ... -update-initramfs: Generating /boot/initrd.img-3.13.0-170-generic -Setting up linux-modules-4.4.0-148-generic (4.4.0-148.174~14.04.1) ... -Setting up linux-image-4.4.0-148-generic (4.4.0-148.174~14.04.1) ... -I: /vmlinuz is now a symlink to boot/vmlinuz-4.4.0-148-generic -I: /initrd.img is now a symlink to boot/initrd.img-4.4.0-148-generic -Setting up linux-modules-extra-4.4.0-148-generic (4.4.0-148.174~14.04.1) ... -Setting up intel-microcode (3.20190618.0ubuntu0.14.04.1) ... -update-initramfs: deferring update (trigger activated) -intel-microcode: microcode will be updated at next boot -Setting up amd64-microcode (3.20180524.1~ubuntu0.14.04.2+really20130710.1ubuntu1) ... -update-initramfs: deferring update (trigger activated) -Setting up linux-image-generic-lts-xenial (4.4.0.148.130) ... -Setting up linux-headers-4.4.0-148 (4.4.0-148.174~14.04.1) ... -Setting up linux-headers-4.4.0-148-generic (4.4.0-148.174~14.04.1) ... -Setting up linux-headers-generic-lts-xenial (4.4.0.148.130) ... -Setting up linux-generic-lts-xenial (4.4.0.148.130) ... -Setting up thermald (1.4.3-5~14.04.4) ... -thermald start/running, process 7285 -Processing triggers for ureadahead (0.100.0-16) ... -Setting up libice6:amd64 (2:1.0.8-2) ... -Setting up libsm6:amd64 (2:1.2.1-2) ... -Setting up libxt6:amd64 (1:1.1.4-1) ... -Setting up libxmu6:amd64 (2:1.1.1-1) ... -Setting up libxaw7:amd64 (2:1.0.12-1) ... -Setting up libxss1:amd64 (1:1.2.2-1) ... -Setting up libxtst6:amd64 (2:1.2.2-1) ... -Setting up libxvmc1:amd64 (2:1.0.8-1ubuntu1) ... -Setting up x11-xkb-utils (7.7+1) ... -Setting up xfonts-encodings (1:1.0.4-1ubuntu1) ... -Setting up xfonts-utils (1:7.7+1) ... -Setting up xfonts-base (1:1.0.3) ... -Setting up xserver-common (2:1.15.1-0ubuntu2.11) ... -Setting up xserver-xorg-core-lts-xenial (2:1.18.3-1ubuntu2.3~trusty4) ... -Setting up xserver-xorg-input-evdev-lts-xenial (1:2.10.1-1ubuntu2~trusty1) ... -Setting up xserver-xorg-input-synaptics-lts-xenial (1.8.2-1ubuntu3~trusty1) ... -Setting up xserver-xorg-input-vmmouse-lts-xenial (1:13.1.0-1ubuntu2~trusty1) ... -Setting up xserver-xorg-input-wacom-lts-xenial (1:0.32.0-0ubuntu3~trusty1) ... -Setting up xserver-xorg-input-all-lts-xenial (1:7.7+13ubuntu3~trusty2) ... -Setting up xserver-xorg-lts-xenial (1:7.7+13ubuntu3~trusty2) ... -Setting up xserver-xorg-video-amdgpu-lts-xenial (1.1.0-1~trusty1) ... -Setting up xserver-xorg-video-radeon-lts-xenial (1:7.7.0-1~trusty2) ... -Setting up xserver-xorg-video-r128-lts-xenial (6.10.0-1build2~trusty1) ... -Setting up xserver-xorg-video-mach64-lts-xenial (6.9.5-1build2~trusty1) ... -Setting up xserver-xorg-video-ati-lts-xenial (1:7.7.0-1~trusty2) ... -Setting up xserver-xorg-video-fbdev-lts-xenial (1:0.4.4-1build5~trusty1) ... -Setting up xserver-xorg-video-nouveau-lts-xenial (1:1.0.12-1build2~trusty1) ... -Setting up xserver-xorg-video-vesa-lts-xenial (1:2.3.4-1build2~trusty1) ... -Setting up xserver-xorg-video-vmware-lts-xenial (1:13.1.0-2ubuntu3~trusty1) ... -Setting up xserver-xorg-video-cirrus-lts-xenial (1:1.5.3-1ubuntu3~trusty1) ... -Setting up xserver-xorg-video-mga-lts-xenial (1:1.6.4-1build2~trusty1) ... -Setting up xserver-xorg-video-neomagic-lts-xenial (1:1.2.9-1build2~trusty1) ... -Setting up xserver-xorg-video-openchrome-lts-xenial (1:0.3.3+git20160310-1~trusty1) ... -Setting up xserver-xorg-video-savage-lts-xenial (1:2.3.8-1ubuntu3~trusty1) ... -Setting up xserver-xorg-video-siliconmotion-lts-xenial (1:1.7.8-1ubuntu6~trusty1) ... -Setting up xserver-xorg-video-sisusb-lts-xenial (1:0.9.6-2build5~trusty1) ... -Setting up xserver-xorg-video-tdfx-lts-xenial (1:1.4.6-1build2~trusty1) ... -Setting up xserver-xorg-video-trident-lts-xenial (1:1.3.7-1build2~trusty1) ... -Setting up xserver-xorg-video-all-lts-xenial (1:7.7+13ubuntu3~trusty2) ... -Setting up xserver-xorg-video-intel-lts-xenial (2:2.99.917+git20160325-1ubuntu1~trusty1) ... -Setting up xserver-xorg-video-qxl-lts-xenial (0.1.4-3ubuntu3~trusty1) ... -Processing triggers for libc-bin (2.19-0ubuntu6.15) ... -Processing triggers for linux-image-4.4.0-148-generic (4.4.0-148.174~14.04.1) ... -/etc/kernel/postinst.d/initramfs-tools: -update-initramfs: Generating /boot/initrd.img-4.4.0-148-generic -/etc/kernel/postinst.d/x-grub-legacy-ec2: -debconf: unable to initialize frontend: Dialog -debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.) -debconf: falling back to frontend: Readline -debconf: unable to initialize frontend: Readline -debconf: (This frontend requires a controlling tty.) -debconf: falling back to frontend: Teletype -Searching for GRUB installation directory ... found: /boot/grub -Searching for default file ... found: /boot/grub/default -Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst -Searching for splash image ... none found, skipping ... -Found kernel: /boot/vmlinuz-3.13.0-170-generic -Found kernel: /boot/vmlinuz-4.4.0-148-generic -Found kernel: /boot/vmlinuz-3.13.0-170-generic -Replacing config file /run/grub/menu.lst with new version -Updating /boot/grub/menu.lst ... done - -/etc/kernel/postinst.d/zz-update-grub: -Generating grub configuration file ... -Found linux image: /boot/vmlinuz-4.4.0-148-generic -Found initrd image: /boot/initrd.img-4.4.0-148-generic -Found linux image: /boot/vmlinuz-3.13.0-170-generic -Found initrd image: /boot/initrd.img-3.13.0-170-generic -done -Processing triggers for initramfs-tools (0.103ubuntu4.11) ... -update-initramfs: Generating /boot/initrd.img-4.4.0-148-generic -+ multipass restart trusty-uac -++ multipass exec trusty-uac -- uname -r -+ kernel_version=4.4.0-148-generic -+ [[ 4.4.0-148-generic == 4.4.0* ]] -+ echo 'SUCCESS: kernel was successfully updated to HWE: 4.4.0-148-generic' -SUCCESS: kernel was successfully updated to HWE: 4.4.0-148-generic -+ update_uaclient -+ name_build=trusty-uac-build -+ pkg_name=ubuntu-advantage-tools_25.0_amd64.deb -+ multipass launch trusty --name trusty-uac-build -+ multipass exec trusty-uac-build bash /tmp/install_uac_from_master.sh -Reading package lists... -Building dependency tree... -Reading state information... -The following extra packages will be installed: - git-man liberror-perl -Suggested packages: - git-daemon-run git-daemon-sysvinit git-doc git-el git-email git-gui gitk - gitweb git-arch git-bzr git-cvs git-mediawiki git-svn make-doc -The following NEW packages will be installed: - git git-man liberror-perl make -0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. -Need to get 3,578 kB of archives. -After this operation, 22.3 MB of additional disk space will be used. -Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main liberror-perl all 0.17-1.1 [21.1 kB] -Get:2 http://archive.ubuntu.com/ubuntu/ trusty-updates/main git-man all 1:1.9.1-1ubuntu0.10 [700 kB] -Get:3 http://archive.ubuntu.com/ubuntu/ trusty-updates/main git amd64 1:1.9.1-1ubuntu0.10 [2,737 kB] -Get:4 http://archive.ubuntu.com/ubuntu/ trusty/main make amd64 3.81-8.2ubuntu3 [119 kB] -debconf: unable to initialize frontend: Dialog -debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.) -debconf: falling back to frontend: Readline -debconf: unable to initialize frontend: Readline -debconf: (This frontend requires a controlling tty.) -debconf: falling back to frontend: Teletype -dpkg-preconfigure: unable to re-open stdin: -Fetched 3,578 kB in 7s (482 kB/s) -Selecting previously unselected package liberror-perl. -(Reading database ... 51418 files and directories currently installed.) -Preparing to unpack .../liberror-perl_0.17-1.1_all.deb ... -Unpacking liberror-perl (0.17-1.1) ... -Selecting previously unselected package git-man. -Preparing to unpack .../git-man_1%3a1.9.1-1ubuntu0.10_all.deb ... -Unpacking git-man (1:1.9.1-1ubuntu0.10) ... -Selecting previously unselected package git. -Preparing to unpack .../git_1%3a1.9.1-1ubuntu0.10_amd64.deb ... -Unpacking git (1:1.9.1-1ubuntu0.10) ... -Selecting previously unselected package make. -Preparing to unpack .../make_3.81-8.2ubuntu3_amd64.deb ... -Unpacking make (3.81-8.2ubuntu3) ... -Processing triggers for man-db (2.6.7.1-1ubuntu1) ... -Setting up liberror-perl (0.17-1.1) ... -Setting up git-man (1:1.9.1-1ubuntu0.10) ... -Setting up git (1:1.9.1-1ubuntu0.10) ... -Setting up make (3.81-8.2ubuntu3) ... -Cloning into '/tmp/uac'... -Missing mk-build-deps; installing devscripts, equivs. -Reading package lists... -Building dependency tree... -Reading state information... -The following extra packages will be installed: - binutils debhelper dh-apparmor dpkg-dev fakeroot gettext intltool-debian - libcroco3 libdpkg-perl libfakeroot libgomp1 libunistring0 po-debconf -Suggested packages: - binutils-doc dh-make bsd-mailx mailx build-essential cvs-buildpackage - devscripts-el gnuplot libauthen-sasl-perl libfile-desktopentry-perl - libnet-smtp-ssl-perl libterm-size-perl libyaml-syck-perl mutt - svn-buildpackage debian-keyring liblwp-protocol-https-perl libsoap-lite-perl - apparmor-easyprof gettext-doc libmail-box-perl -Recommended packages: - dctrl-tools dput dupload libdistro-info-perl libencode-locale-perl - libjson-perl libparse-debcontrol-perl liburi-perl libwww-perl lintian - patchutils python3-debian python3-magic unzip wdiff gcc c-compiler - libalgorithm-merge-perl libasprintf-dev libgettextpo-dev - libfile-fcntllock-perl libmail-sendmail-perl -The following NEW packages will be installed: - binutils debhelper devscripts dh-apparmor dpkg-dev equivs fakeroot gettext - intltool-debian libcroco3 libdpkg-perl libfakeroot libgomp1 libunistring0 - po-debconf -0 upgraded, 15 newly installed, 0 to remove and 0 not upgraded. -Need to get 5,934 kB of archives. -After this operation, 24.1 MB of additional disk space will be used. -Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main libcroco3 amd64 0.6.8-2ubuntu1 [82.4 kB] -Get:2 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgomp1 amd64 4.8.4-2ubuntu1~14.04.4 [23.1 kB] -Get:3 http://archive.ubuntu.com/ubuntu/ trusty/main libunistring0 amd64 0.9.3-5ubuntu3 [271 kB] -Get:4 http://archive.ubuntu.com/ubuntu/ trusty-updates/main binutils amd64 2.24-5ubuntu14.2 [2,076 kB] -Get:5 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libdpkg-perl all 1.17.5ubuntu5.8 [179 kB] -Get:6 http://archive.ubuntu.com/ubuntu/ trusty-updates/main dpkg-dev all 1.17.5ubuntu5.8 [726 kB] -Get:7 http://archive.ubuntu.com/ubuntu/ trusty-updates/main gettext amd64 0.18.3.1-1ubuntu3.1 [829 kB] -Get:8 http://archive.ubuntu.com/ubuntu/ trusty/main intltool-debian all 0.35.0+20060710.1 [31.6 kB] -Get:9 http://archive.ubuntu.com/ubuntu/ trusty/main po-debconf all 1.0.16+nmu2ubuntu1 [210 kB] -Get:10 http://archive.ubuntu.com/ubuntu/ trusty-updates/main dh-apparmor all 2.10.95-0ubuntu2.6~14.04.4 [11.3 kB] -Get:11 http://archive.ubuntu.com/ubuntu/ trusty/main debhelper all 9.20131227ubuntu1 [604 kB] -Get:12 http://archive.ubuntu.com/ubuntu/ trusty-updates/main devscripts amd64 2.14.1ubuntu0.1 [792 kB] -Get:13 http://archive.ubuntu.com/ubuntu/ trusty/main libfakeroot amd64 1.20-3ubuntu2 [25.4 kB] -Get:14 http://archive.ubuntu.com/ubuntu/ trusty/main fakeroot amd64 1.20-3ubuntu2 [55.0 kB] -Get:15 http://archive.ubuntu.com/ubuntu/ trusty/universe equivs all 2.0.9 [18.5 kB] -debconf: unable to initialize frontend: Dialog -debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.) -debconf: falling back to frontend: Readline -debconf: unable to initialize frontend: Readline -debconf: (This frontend requires a controlling tty.) -debconf: falling back to frontend: Teletype -dpkg-preconfigure: unable to re-open stdin: -Fetched 5,934 kB in 13s (432 kB/s) -Selecting previously unselected package libcroco3:amd64. -(Reading database ... 52178 files and directories currently installed.) -Preparing to unpack .../libcroco3_0.6.8-2ubuntu1_amd64.deb ... -Unpacking libcroco3:amd64 (0.6.8-2ubuntu1) ... -Selecting previously unselected package libgomp1:amd64. -Preparing to unpack .../libgomp1_4.8.4-2ubuntu1~14.04.4_amd64.deb ... -Unpacking libgomp1:amd64 (4.8.4-2ubuntu1~14.04.4) ... -Selecting previously unselected package libunistring0:amd64. -Preparing to unpack .../libunistring0_0.9.3-5ubuntu3_amd64.deb ... -Unpacking libunistring0:amd64 (0.9.3-5ubuntu3) ... -Selecting previously unselected package binutils. -Preparing to unpack .../binutils_2.24-5ubuntu14.2_amd64.deb ... -Unpacking binutils (2.24-5ubuntu14.2) ... -Selecting previously unselected package libdpkg-perl. -Preparing to unpack .../libdpkg-perl_1.17.5ubuntu5.8_all.deb ... -Unpacking libdpkg-perl (1.17.5ubuntu5.8) ... -Selecting previously unselected package dpkg-dev. -Preparing to unpack .../dpkg-dev_1.17.5ubuntu5.8_all.deb ... -Unpacking dpkg-dev (1.17.5ubuntu5.8) ... -Selecting previously unselected package gettext. -Preparing to unpack .../gettext_0.18.3.1-1ubuntu3.1_amd64.deb ... -Unpacking gettext (0.18.3.1-1ubuntu3.1) ... -Selecting previously unselected package intltool-debian. -Preparing to unpack .../intltool-debian_0.35.0+20060710.1_all.deb ... -Unpacking intltool-debian (0.35.0+20060710.1) ... -Selecting previously unselected package po-debconf. -Preparing to unpack .../po-debconf_1.0.16+nmu2ubuntu1_all.deb ... -Unpacking po-debconf (1.0.16+nmu2ubuntu1) ... -Selecting previously unselected package dh-apparmor. -Preparing to unpack .../dh-apparmor_2.10.95-0ubuntu2.6~14.04.4_all.deb ... -Unpacking dh-apparmor (2.10.95-0ubuntu2.6~14.04.4) ... -Selecting previously unselected package debhelper. -Preparing to unpack .../debhelper_9.20131227ubuntu1_all.deb ... -Unpacking debhelper (9.20131227ubuntu1) ... -Selecting previously unselected package devscripts. -Preparing to unpack .../devscripts_2.14.1ubuntu0.1_amd64.deb ... -Unpacking devscripts (2.14.1ubuntu0.1) ... -Selecting previously unselected package libfakeroot:amd64. -Preparing to unpack .../libfakeroot_1.20-3ubuntu2_amd64.deb ... -Unpacking libfakeroot:amd64 (1.20-3ubuntu2) ... -Selecting previously unselected package fakeroot. -Preparing to unpack .../fakeroot_1.20-3ubuntu2_amd64.deb ... -Unpacking fakeroot (1.20-3ubuntu2) ... -Selecting previously unselected package equivs. -Preparing to unpack .../archives/equivs_2.0.9_all.deb ... -Unpacking equivs (2.0.9) ... -Processing triggers for man-db (2.6.7.1-1ubuntu1) ... -Processing triggers for install-info (5.2.0.dfsg.1-2) ... -Setting up libcroco3:amd64 (0.6.8-2ubuntu1) ... -Setting up libgomp1:amd64 (4.8.4-2ubuntu1~14.04.4) ... -Setting up libunistring0:amd64 (0.9.3-5ubuntu3) ... -Setting up binutils (2.24-5ubuntu14.2) ... -Setting up libdpkg-perl (1.17.5ubuntu5.8) ... -Setting up dpkg-dev (1.17.5ubuntu5.8) ... -Setting up gettext (0.18.3.1-1ubuntu3.1) ... -Setting up intltool-debian (0.35.0+20060710.1) ... -Setting up po-debconf (1.0.16+nmu2ubuntu1) ... -Setting up dh-apparmor (2.10.95-0ubuntu2.6~14.04.4) ... -Setting up debhelper (9.20131227ubuntu1) ... -Setting up devscripts (2.14.1ubuntu0.1) ... -Setting up libfakeroot:amd64 (1.20-3ubuntu2) ... -Setting up fakeroot (1.20-3ubuntu2) ... -update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode -Setting up equivs (2.0.9) ... -Processing triggers for libc-bin (2.19-0ubuntu6.15) ... -mk-build-deps --tool "apt-get --no-install-recommends --yes" \ - --install --remove /tmp/uac//debian/control -make[1]: Entering directory `/tmp/uac/equivs.VNowxK' -dh_testdir -dh_testroot -dh_prep -dh_testdir -dh_testroot -dh_install -dh_installdocs -dh_installchangelogs -dh_compress -dh_fixperms -dh_installdeb -dh_gencontrol -sh: 1: gcc: not found -dpkg-gencontrol: warning: couldn't determine gcc system type, falling back to default (native compilation) -dpkg-gencontrol: warning: File::FcntlLock not available; using flock which is not NFS-safe -dh_md5sums -dh_builddeb -dpkg-deb: building package `ubuntu-advantage-tools-build-deps' in `../ubuntu-advantage-tools-build-deps_25.0_all.deb'. -make[1]: Leaving directory `/tmp/uac/equivs.VNowxK' - -The package has been created. -Attention, the package has been created in the current directory, -not in ".." as indicated by the message above! -Selecting previously unselected package ubuntu-advantage-tools-build-deps. -(Reading database ... 53773 files and directories currently installed.) -Preparing to unpack ubuntu-advantage-tools-build-deps_25.0_all.deb ... -Unpacking ubuntu-advantage-tools-build-deps (25.0) ... -Reading package lists... -Building dependency tree... -Reading state information... -Correcting dependencies... Done -The following extra packages will be installed: - build-essential cpp cpp-4.8 dh-systemd g++ g++-4.8 gcc gcc-4.8 - libapt-pkg-dev libasan0 libatomic1 libc-dev-bin libc6-dev libcloog-isl4 - libgcc-4.8-dev libgmp10 libisl10 libitm1 libmpc3 libmpfr4 libquadmath0 - libstdc++-4.8-dev libtsan0 linux-libc-dev pep8 pyflakes python-flake8 - python-mccabe python-setuptools python3-flake8 python3-mccabe python3-mock - python3-pep8 python3-py python3-pytest python3-setuptools zlib1g-dev -Suggested packages: - cpp-doc gcc-4.8-locales g++-multilib g++-4.8-multilib gcc-4.8-doc - libstdc++6-4.8-dbg gcc-multilib manpages-dev autoconf automake1.9 libtool - flex bison gdb gcc-doc gcc-4.8-multilib libgcc1-dbg libgomp1-dbg libitm1-dbg - libatomic1-dbg libasan0-dbg libtsan0-dbg libquadmath0-dbg glibc-doc - libstdc++-4.8-doc python-mock-doc subversion -The following NEW packages will be installed: - build-essential cpp cpp-4.8 dh-systemd g++ g++-4.8 gcc gcc-4.8 - libapt-pkg-dev libasan0 libatomic1 libc-dev-bin libc6-dev libcloog-isl4 - libgcc-4.8-dev libgmp10 libisl10 libitm1 libmpc3 libmpfr4 libquadmath0 - libstdc++-4.8-dev libtsan0 linux-libc-dev pep8 pyflakes python-flake8 - python-mccabe python-setuptools python3-flake8 python3-mccabe python3-mock - python3-pep8 python3-py python3-pytest python3-setuptools zlib1g-dev -0 upgraded, 37 newly installed, 0 to remove and 0 not upgraded. -1 not fully installed or removed. -Need to get 35.2 MB of archives. -After this operation, 102 MB of additional disk space will be used. -Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libc-dev-bin amd64 2.19-0ubuntu6.15 [68.9 kB] -Get:2 http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-libc-dev amd64 3.13.0-170.220 [772 kB] -Get:3 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libc6-dev amd64 2.19-0ubuntu6.15 [1,913 kB] -Get:4 http://archive.ubuntu.com/ubuntu/ trusty/main libgmp10 amd64 2:5.1.3+dfsg-1ubuntu1 [218 kB] -Get:5 http://archive.ubuntu.com/ubuntu/ trusty/main libisl10 amd64 0.12.2-1 [419 kB] -Get:6 http://archive.ubuntu.com/ubuntu/ trusty/main libcloog-isl4 amd64 0.18.2-1 [57.5 kB] -Get:7 http://archive.ubuntu.com/ubuntu/ trusty/main libmpfr4 amd64 3.1.2-1 [203 kB] -Get:8 http://archive.ubuntu.com/ubuntu/ trusty/main libmpc3 amd64 1.0.1-1ubuntu1 [38.4 kB] -Get:9 http://archive.ubuntu.com/ubuntu/ trusty-updates/main cpp-4.8 amd64 4.8.4-2ubuntu1~14.04.4 [4,452 kB] -Get:10 http://archive.ubuntu.com/ubuntu/ trusty/main cpp amd64 4:4.8.2-1ubuntu6 [27.5 kB] -Get:11 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libitm1 amd64 4.8.4-2ubuntu1~14.04.4 [28.6 kB] -Get:12 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libatomic1 amd64 4.8.4-2ubuntu1~14.04.4 [8,630 B] -Get:13 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libasan0 amd64 4.8.4-2ubuntu1~14.04.4 [63.1 kB] -Get:14 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libtsan0 amd64 4.8.4-2ubuntu1~14.04.4 [94.8 kB] -Get:15 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libquadmath0 amd64 4.8.4-2ubuntu1~14.04.4 [126 kB] -Get:16 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgcc-4.8-dev amd64 4.8.4-2ubuntu1~14.04.4 [1,688 kB] -Get:17 http://archive.ubuntu.com/ubuntu/ trusty-updates/main gcc-4.8 amd64 4.8.4-2ubuntu1~14.04.4 [5,040 kB] -Get:18 http://archive.ubuntu.com/ubuntu/ trusty/main gcc amd64 4:4.8.2-1ubuntu6 [5,098 B] -Get:19 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libstdc++-4.8-dev amd64 4.8.4-2ubuntu1~14.04.4 [1,051 kB] -Get:20 http://archive.ubuntu.com/ubuntu/ trusty-updates/main g++-4.8 amd64 4.8.4-2ubuntu1~14.04.4 [18.0 MB] -Get:21 http://archive.ubuntu.com/ubuntu/ trusty/main g++ amd64 4:4.8.2-1ubuntu6 [1,490 B] -Get:22 http://archive.ubuntu.com/ubuntu/ trusty/main build-essential amd64 11.6ubuntu6 [4,838 B] -Get:23 http://archive.ubuntu.com/ubuntu/ trusty-updates/main zlib1g-dev amd64 1:1.2.8.dfsg-1ubuntu1.1 [166 kB] -Get:24 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libapt-pkg-dev amd64 1.0.1ubuntu2.24 [82.6 kB] -Get:25 http://archive.ubuntu.com/ubuntu/ trusty-updates/main python-setuptools all 3.3-1ubuntu2 [230 kB] -Get:26 http://archive.ubuntu.com/ubuntu/ trusty/main pep8 all 1.4.6-1.1build1 [27.4 kB] -Get:27 http://archive.ubuntu.com/ubuntu/ trusty/main pyflakes all 0.8.1-1 [31.2 kB] -Get:28 http://archive.ubuntu.com/ubuntu/ trusty/universe python-mccabe all 0.2.1-1 [6,782 B] -Get:29 http://archive.ubuntu.com/ubuntu/ trusty/universe python-flake8 amd64 2.1.0-1ubuntu1 [15.0 kB] -Get:30 http://archive.ubuntu.com/ubuntu/ trusty/universe python3-mccabe all 0.2.1-1 [6,600 B] -Get:31 http://archive.ubuntu.com/ubuntu/ trusty-updates/main python3-setuptools all 3.3-1ubuntu2 [144 kB] -Get:32 http://archive.ubuntu.com/ubuntu/ trusty/main python3-pep8 all 1.4.6-1.1build1 [26.0 kB] -Get:33 http://archive.ubuntu.com/ubuntu/ trusty/universe python3-flake8 amd64 2.1.0-1ubuntu1 [12.3 kB] -Get:34 http://archive.ubuntu.com/ubuntu/ trusty/main python3-mock all 1.0.1-3 [23.9 kB] -Get:35 http://archive.ubuntu.com/ubuntu/ trusty/main python3-py all 1.4.20-1 [62.4 kB] -Get:36 http://archive.ubuntu.com/ubuntu/ trusty/main python3-pytest all 2.5.1-1 [91.8 kB] -Get:37 http://archive.ubuntu.com/ubuntu/ trusty-updates/main dh-systemd all 1.14ubuntu1 [13.0 kB] -debconf: unable to initialize frontend: Dialog -debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.) -debconf: falling back to frontend: Readline -debconf: unable to initialize frontend: Readline -debconf: (This frontend requires a controlling tty.) -debconf: falling back to frontend: Teletype -dpkg-preconfigure: unable to re-open stdin: -Fetched 35.2 MB in 52s (667 kB/s) -Selecting previously unselected package libc-dev-bin. -(Reading database ... 53777 files and directories currently installed.) -Preparing to unpack .../libc-dev-bin_2.19-0ubuntu6.15_amd64.deb ... -Unpacking libc-dev-bin (2.19-0ubuntu6.15) ... -Selecting previously unselected package linux-libc-dev:amd64. -Preparing to unpack .../linux-libc-dev_3.13.0-170.220_amd64.deb ... -Unpacking linux-libc-dev:amd64 (3.13.0-170.220) ... -Selecting previously unselected package libc6-dev:amd64. -Preparing to unpack .../libc6-dev_2.19-0ubuntu6.15_amd64.deb ... -Unpacking libc6-dev:amd64 (2.19-0ubuntu6.15) ... -Selecting previously unselected package libgmp10:amd64. -Preparing to unpack .../libgmp10_2%3a5.1.3+dfsg-1ubuntu1_amd64.deb ... -Unpacking libgmp10:amd64 (2:5.1.3+dfsg-1ubuntu1) ... -Selecting previously unselected package libisl10:amd64. -Preparing to unpack .../libisl10_0.12.2-1_amd64.deb ... -Unpacking libisl10:amd64 (0.12.2-1) ... -Selecting previously unselected package libcloog-isl4:amd64. -Preparing to unpack .../libcloog-isl4_0.18.2-1_amd64.deb ... -Unpacking libcloog-isl4:amd64 (0.18.2-1) ... -Selecting previously unselected package libmpfr4:amd64. -Preparing to unpack .../libmpfr4_3.1.2-1_amd64.deb ... -Unpacking libmpfr4:amd64 (3.1.2-1) ... -Selecting previously unselected package libmpc3:amd64. -Preparing to unpack .../libmpc3_1.0.1-1ubuntu1_amd64.deb ... -Unpacking libmpc3:amd64 (1.0.1-1ubuntu1) ... -Selecting previously unselected package cpp-4.8. -Preparing to unpack .../cpp-4.8_4.8.4-2ubuntu1~14.04.4_amd64.deb ... -Unpacking cpp-4.8 (4.8.4-2ubuntu1~14.04.4) ... -Selecting previously unselected package cpp. -Preparing to unpack .../cpp_4%3a4.8.2-1ubuntu6_amd64.deb ... -Unpacking cpp (4:4.8.2-1ubuntu6) ... -Selecting previously unselected package libitm1:amd64. -Preparing to unpack .../libitm1_4.8.4-2ubuntu1~14.04.4_amd64.deb ... -Unpacking libitm1:amd64 (4.8.4-2ubuntu1~14.04.4) ... -Selecting previously unselected package libatomic1:amd64. -Preparing to unpack .../libatomic1_4.8.4-2ubuntu1~14.04.4_amd64.deb ... -Unpacking libatomic1:amd64 (4.8.4-2ubuntu1~14.04.4) ... -Selecting previously unselected package libasan0:amd64. -Preparing to unpack .../libasan0_4.8.4-2ubuntu1~14.04.4_amd64.deb ... -Unpacking libasan0:amd64 (4.8.4-2ubuntu1~14.04.4) ... -Selecting previously unselected package libtsan0:amd64. -Preparing to unpack .../libtsan0_4.8.4-2ubuntu1~14.04.4_amd64.deb ... -Unpacking libtsan0:amd64 (4.8.4-2ubuntu1~14.04.4) ... -Selecting previously unselected package libquadmath0:amd64. -Preparing to unpack .../libquadmath0_4.8.4-2ubuntu1~14.04.4_amd64.deb ... -Unpacking libquadmath0:amd64 (4.8.4-2ubuntu1~14.04.4) ... -Selecting previously unselected package libgcc-4.8-dev:amd64. -Preparing to unpack .../libgcc-4.8-dev_4.8.4-2ubuntu1~14.04.4_amd64.deb ... -Unpacking libgcc-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.4) ... -Selecting previously unselected package gcc-4.8. -Preparing to unpack .../gcc-4.8_4.8.4-2ubuntu1~14.04.4_amd64.deb ... -Unpacking gcc-4.8 (4.8.4-2ubuntu1~14.04.4) ... -Selecting previously unselected package gcc. -Preparing to unpack .../gcc_4%3a4.8.2-1ubuntu6_amd64.deb ... -Unpacking gcc (4:4.8.2-1ubuntu6) ... -Selecting previously unselected package libstdc++-4.8-dev:amd64. -Preparing to unpack .../libstdc++-4.8-dev_4.8.4-2ubuntu1~14.04.4_amd64.deb ... -Unpacking libstdc++-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.4) ... -Selecting previously unselected package g++-4.8. -Preparing to unpack .../g++-4.8_4.8.4-2ubuntu1~14.04.4_amd64.deb ... -Unpacking g++-4.8 (4.8.4-2ubuntu1~14.04.4) ... -Selecting previously unselected package g++. -Preparing to unpack .../g++_4%3a4.8.2-1ubuntu6_amd64.deb ... -Unpacking g++ (4:4.8.2-1ubuntu6) ... -Selecting previously unselected package build-essential. -Preparing to unpack .../build-essential_11.6ubuntu6_amd64.deb ... -Unpacking build-essential (11.6ubuntu6) ... -Selecting previously unselected package zlib1g-dev:amd64. -Preparing to unpack .../zlib1g-dev_1%3a1.2.8.dfsg-1ubuntu1.1_amd64.deb ... -Unpacking zlib1g-dev:amd64 (1:1.2.8.dfsg-1ubuntu1.1) ... -Selecting previously unselected package libapt-pkg-dev:amd64. -Preparing to unpack .../libapt-pkg-dev_1.0.1ubuntu2.24_amd64.deb ... -Unpacking libapt-pkg-dev:amd64 (1.0.1ubuntu2.24) ... -Selecting previously unselected package python-setuptools. -Preparing to unpack .../python-setuptools_3.3-1ubuntu2_all.deb ... -Unpacking python-setuptools (3.3-1ubuntu2) ... -Selecting previously unselected package pep8. -Preparing to unpack .../pep8_1.4.6-1.1build1_all.deb ... -Unpacking pep8 (1.4.6-1.1build1) ... -Selecting previously unselected package pyflakes. -Preparing to unpack .../pyflakes_0.8.1-1_all.deb ... -Unpacking pyflakes (0.8.1-1) ... -Selecting previously unselected package python-mccabe. -Preparing to unpack .../python-mccabe_0.2.1-1_all.deb ... -Unpacking python-mccabe (0.2.1-1) ... -Selecting previously unselected package python-flake8. -Preparing to unpack .../python-flake8_2.1.0-1ubuntu1_amd64.deb ... -Unpacking python-flake8 (2.1.0-1ubuntu1) ... -Selecting previously unselected package python3-mccabe. -Preparing to unpack .../python3-mccabe_0.2.1-1_all.deb ... -Unpacking python3-mccabe (0.2.1-1) ... -Selecting previously unselected package python3-setuptools. -Preparing to unpack .../python3-setuptools_3.3-1ubuntu2_all.deb ... -Unpacking python3-setuptools (3.3-1ubuntu2) ... -Selecting previously unselected package python3-pep8. -Preparing to unpack .../python3-pep8_1.4.6-1.1build1_all.deb ... -Unpacking python3-pep8 (1.4.6-1.1build1) ... -Selecting previously unselected package python3-flake8. -Preparing to unpack .../python3-flake8_2.1.0-1ubuntu1_amd64.deb ... -Unpacking python3-flake8 (2.1.0-1ubuntu1) ... -Selecting previously unselected package python3-mock. -Preparing to unpack .../python3-mock_1.0.1-3_all.deb ... -Unpacking python3-mock (1.0.1-3) ... -Selecting previously unselected package python3-py. -Preparing to unpack .../python3-py_1.4.20-1_all.deb ... -Unpacking python3-py (1.4.20-1) ... -Selecting previously unselected package python3-pytest. -Preparing to unpack .../python3-pytest_2.5.1-1_all.deb ... -Unpacking python3-pytest (2.5.1-1) ... -Selecting previously unselected package dh-systemd. -Preparing to unpack .../dh-systemd_1.14ubuntu1_all.deb ... -Unpacking dh-systemd (1.14ubuntu1) ... -Processing triggers for man-db (2.6.7.1-1ubuntu1) ... -Setting up libc-dev-bin (2.19-0ubuntu6.15) ... -Setting up linux-libc-dev:amd64 (3.13.0-170.220) ... -Setting up libc6-dev:amd64 (2.19-0ubuntu6.15) ... -Setting up libgmp10:amd64 (2:5.1.3+dfsg-1ubuntu1) ... -Setting up libisl10:amd64 (0.12.2-1) ... -Setting up libcloog-isl4:amd64 (0.18.2-1) ... -Setting up libmpfr4:amd64 (3.1.2-1) ... -Setting up libmpc3:amd64 (1.0.1-1ubuntu1) ... -Setting up cpp-4.8 (4.8.4-2ubuntu1~14.04.4) ... -Setting up cpp (4:4.8.2-1ubuntu6) ... -Setting up libitm1:amd64 (4.8.4-2ubuntu1~14.04.4) ... -Setting up libatomic1:amd64 (4.8.4-2ubuntu1~14.04.4) ... -Setting up libasan0:amd64 (4.8.4-2ubuntu1~14.04.4) ... -Setting up libtsan0:amd64 (4.8.4-2ubuntu1~14.04.4) ... -Setting up libquadmath0:amd64 (4.8.4-2ubuntu1~14.04.4) ... -Setting up libgcc-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.4) ... -Setting up gcc-4.8 (4.8.4-2ubuntu1~14.04.4) ... -Setting up gcc (4:4.8.2-1ubuntu6) ... -Setting up libstdc++-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.4) ... -Setting up g++-4.8 (4.8.4-2ubuntu1~14.04.4) ... -Setting up g++ (4:4.8.2-1ubuntu6) ... -update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode -Setting up build-essential (11.6ubuntu6) ... -Setting up zlib1g-dev:amd64 (1:1.2.8.dfsg-1ubuntu1.1) ... -Setting up libapt-pkg-dev:amd64 (1.0.1ubuntu2.24) ... -Setting up python-setuptools (3.3-1ubuntu2) ... -Setting up pep8 (1.4.6-1.1build1) ... -Setting up pyflakes (0.8.1-1) ... -Setting up python-mccabe (0.2.1-1) ... -Setting up python-flake8 (2.1.0-1ubuntu1) ... -Setting up python3-mccabe (0.2.1-1) ... -Setting up python3-setuptools (3.3-1ubuntu2) ... -Setting up python3-pep8 (1.4.6-1.1build1) ... -Setting up python3-flake8 (2.1.0-1ubuntu1) ... -Setting up python3-mock (1.0.1-3) ... -Setting up python3-py (1.4.20-1) ... -Setting up python3-pytest (2.5.1-1) ... -Setting up dh-systemd (1.14ubuntu1) ... -Setting up ubuntu-advantage-tools-build-deps (25.0) ... -Processing triggers for libc-bin (2.19-0ubuntu6.15) ... -dpkg-buildpackage: source package ubuntu-advantage-tools -dpkg-buildpackage: source version 25.0 -dpkg-buildpackage: source distribution UNRELEASED -dpkg-buildpackage: source changed by Chad Smith - dpkg-source --before-build uac -dpkg-buildpackage: host architecture amd64 - debian/rules clean -dh clean --with python3,bash-completion,systemd --buildsystem=pybuild \ - --no-start - dh_testdir -O--buildsystem=pybuild -O--no-start - debian/rules override_dh_auto_clean -make[1]: Entering directory `/tmp/uac' -dh_auto_clean - pybuild --clean -i python{version} -p 3.4 --dir . -I: pybuild base:170: python3.4 setup.py clean -running clean -removing '/tmp/uac/.pybuild/pythonX.Y_3.4/build' (and everything under it) -'build/bdist.linux-x86_64' does not exist -- can't clean it -'build/scripts-3.4' does not exist -- can't clean it - rm -rf .pybuild/ - find . -name \*.pyc -exec rm {} \; -make clean -make[2]: Entering directory `/tmp/uac' -rm -f *.build *.buildinfo *.changes .coverage *.deb *.dsc *.tar.gz *.tar.xz -rm -rf *.egg-info/ .tox/ .cache/ .mypy_cache/ -find . -type f -name '*.pyc' -delete -find . -type d -name '*__pycache__' -delete -make -C apt-hook clean -make[3]: Entering directory `/tmp/uac/apt-hook' -rm -f hook ubuntu-advantage.pot -make[3]: Leaving directory `/tmp/uac/apt-hook' -make[2]: Leaving directory `/tmp/uac' -make[1]: Leaving directory `/tmp/uac' - dh_clean -O--buildsystem=pybuild -O--no-start - rm -f debian/ubuntu-advantage-tools.substvars - rm -f debian/ubuntu-advantage-tools.*.debhelper - rm -rf debian/ubuntu-advantage-tools/ - rm -f debian/ubuntu-advantage-pro.substvars - rm -f debian/ubuntu-advantage-pro.*.debhelper - rm -rf debian/ubuntu-advantage-pro/ - rm -f debian/*.debhelper.log - rm -f debian/files - find . \( \( -type f -a \ - \( -name '#*#' -o -name '.*~' -o -name '*~' -o -name DEADJOE \ - -o -name '*.orig' -o -name '*.rej' -o -name '*.bak' \ - -o -name '.*.orig' -o -name .*.rej -o -name '.SUMS' \ - -o -name TAGS -o \( -path '*/.deps/*' -a -name '*.P' \) \ - \) -exec rm -f {} + \) -o \ - \( -type d -a -name autom4te.cache -prune -exec rm -rf {} + \) \) - rm -f *-stamp - dpkg-source -b uac -dpkg-source: info: using source format `3.0 (native)' -dpkg-source: info: building ubuntu-advantage-tools in ubuntu-advantage-tools_25.0.tar.gz -dpkg-source: info: building ubuntu-advantage-tools in ubuntu-advantage-tools_25.0.dsc - debian/rules build -dh build --with python3,bash-completion,systemd --buildsystem=pybuild \ - --no-start - dh_testdir -O--buildsystem=pybuild -O--no-start - dh_auto_configure -O--buildsystem=pybuild -O--no-start - pybuild --configure -i python{version} -p 3.4 --dir . -I: pybuild base:170: python3.4 setup.py config -running config - debian/rules override_dh_auto_build -make[1]: Entering directory `/tmp/uac' -dh_auto_build - pybuild --build -i python{version} -p 3.4 --dir . -I: pybuild base:170: /usr/bin/python3 setup.py build -running build -running build_py -creating /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient -copying uaclient/cli.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient -copying uaclient/defaults.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient -copying uaclient/exceptions.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient -copying uaclient/status.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient -copying uaclient/__init__.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient -copying uaclient/util.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient -copying uaclient/apt.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient -copying uaclient/version.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient -copying uaclient/config.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient -copying uaclient/conftest.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient -copying uaclient/serviceclient.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient -copying uaclient/gpg.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient -copying uaclient/contract.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient -copying uaclient/pip.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient -creating /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements -copying uaclient/entitlements/__init__.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements -copying uaclient/entitlements/cc.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements -copying uaclient/entitlements/esm.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements -copying uaclient/entitlements/fips.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements -copying uaclient/entitlements/repo.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements -copying uaclient/entitlements/base.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements -copying uaclient/entitlements/livepatch.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements -copying uaclient/entitlements/cis.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements -creating /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/clouds -copying uaclient/clouds/__init__.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/clouds -copying uaclient/clouds/azure.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/clouds -copying uaclient/clouds/aws.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/clouds -copying uaclient/clouds/identity.py -> /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/clouds -make -C apt-hook build -make[2]: Entering directory `/tmp/uac/apt-hook' -g++ -Wall -Wextra -pedantic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -o hook hook.cc -lapt-pkg -xgettext hook.cc -o ubuntu-advantage.pot -make[2]: Leaving directory `/tmp/uac/apt-hook' -make[1]: Leaving directory `/tmp/uac' - debian/rules override_dh_auto_test -make[1]: Entering directory `/tmp/uac' -python3 -m pytest -============================= test session starts ============================== -platform linux -- Python 3.4.3 -- pytest-2.5.1 -collected 721 items - -test-requirements.txt . -uaclient/clouds/tests/test_aws.py .............. -uaclient/clouds/tests/test_azure.py ......... -uaclient/clouds/tests/test_identity.py ..................... -uaclient/entitlements/tests/test_base.py .................................. -uaclient/entitlements/tests/test_cc.py ....... -uaclient/entitlements/tests/test_cis.py .. -uaclient/entitlements/tests/test_esm.py ........................ -uaclient/entitlements/tests/test_fips.py .................................................................................................... -uaclient/entitlements/tests/test_livepatch.py ........................................ -uaclient/entitlements/tests/test_repo.py ............................................... -uaclient/tests/test_apt.py .............................................................. -uaclient/tests/test_cli.py ................................ -uaclient/tests/test_cli_attach.py ................ -uaclient/tests/test_cli_auto_attach.py ................ -uaclient/tests/test_cli_detach.py ............... -uaclient/tests/test_cli_disable.py ................ -uaclient/tests/test_cli_enable.py .................................... -uaclient/tests/test_cli_refresh.py .... -uaclient/tests/test_cli_status.py ....... -uaclient/tests/test_config.py ......................................................................................... -uaclient/tests/test_contract.py .................... -uaclient/tests/test_gpg.py .. -uaclient/tests/test_pip.py ..... -uaclient/tests/test_serviceclient.py ... -uaclient/tests/test_status.py ..................... -uaclient/tests/test_util.py ........................................................................... -uaclient/tests/test_version.py ... - -========================= 721 passed in 29.08 seconds ========================== -# required for Trusty: flake8 does not install a __main__ for -m -# invocation -python3 /usr/bin/flake8 uaclient -make[1]: Leaving directory `/tmp/uac' - debian/rules binary -dh binary --with python3,bash-completion,systemd --buildsystem=pybuild \ - --no-start - dh_testroot -O--buildsystem=pybuild -O--no-start - dh_prep -O--buildsystem=pybuild -O--no-start - rm -f debian/ubuntu-advantage-tools.substvars - rm -f debian/ubuntu-advantage-tools.*.debhelper - rm -rf debian/ubuntu-advantage-tools/ - rm -f debian/ubuntu-advantage-pro.substvars - rm -f debian/ubuntu-advantage-pro.*.debhelper - rm -rf debian/ubuntu-advantage-pro/ - debian/rules override_dh_auto_install -make[1]: Entering directory `/tmp/uac' -dh_auto_install --destdir=debian/ubuntu-advantage-tools - install -d debian/ubuntu-advantage-tools - install -d debian/ubuntu-advantage-pro - pybuild --install -i python{version} -p 3.4 --dir . --dest-dir /tmp/uac/debian/ubuntu-advantage-tools -I: pybuild base:170: /usr/bin/python3 setup.py install --root /tmp/uac/debian/ubuntu-advantage-tools -running install -running build -running build_py -running install_lib -creating /tmp/uac/debian/ubuntu-advantage-tools/usr -creating /tmp/uac/debian/ubuntu-advantage-tools/usr/lib -creating /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4 -creating /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages -creating /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/cli.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/defaults.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/exceptions.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/status.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/__init__.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/util.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/apt.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/version.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/config.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/conftest.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/serviceclient.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/gpg.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient -creating /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements/__init__.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements/cc.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements/esm.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements/fips.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements/repo.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements/base.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements/livepatch.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/entitlements/cis.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/contract.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient -creating /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/clouds -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/clouds/__init__.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/clouds -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/clouds/azure.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/clouds -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/clouds/aws.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/clouds -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/clouds/identity.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/clouds -copying /tmp/uac/.pybuild/pythonX.Y_3.4/build/uaclient/pip.py -> /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/cli.py to cli.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/defaults.py to defaults.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/exceptions.py to exceptions.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/status.py to status.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/__init__.py to __init__.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/util.py to util.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/apt.py to apt.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/version.py to version.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/config.py to config.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/conftest.py to conftest.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/serviceclient.py to serviceclient.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/gpg.py to gpg.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements/__init__.py to __init__.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements/cc.py to cc.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements/esm.py to esm.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements/fips.py to fips.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements/repo.py to repo.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements/base.py to base.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements/livepatch.py to livepatch.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/entitlements/cis.py to cis.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/contract.py to contract.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/clouds/__init__.py to __init__.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/clouds/azure.py to azure.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/clouds/aws.py to aws.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/clouds/identity.py to identity.cpython-34.pyc -byte-compiling /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/uaclient/pip.py to pip.cpython-34.pyc -running install_data -creating /tmp/uac/debian/ubuntu-advantage-tools/etc -creating /tmp/uac/debian/ubuntu-advantage-tools/etc/ubuntu-advantage -copying uaclient.conf -> /tmp/uac/debian/ubuntu-advantage-tools/etc/ubuntu-advantage -creating /tmp/uac/debian/ubuntu-advantage-tools/usr/share -creating /tmp/uac/debian/ubuntu-advantage-tools/usr/share/keyrings -copying keyrings/ubuntu-advantage-esm-apps.gpg -> /tmp/uac/debian/ubuntu-advantage-tools/usr/share/keyrings -copying keyrings/ubuntu-advantage-fips.gpg -> /tmp/uac/debian/ubuntu-advantage-tools/usr/share/keyrings -copying keyrings/ubuntu-advantage-esm-infra-trusty.gpg -> /tmp/uac/debian/ubuntu-advantage-tools/usr/share/keyrings -creating /tmp/uac/debian/ubuntu-advantage-tools/var -creating /tmp/uac/debian/ubuntu-advantage-tools/var/lib -creating /tmp/uac/debian/ubuntu-advantage-tools/var/lib/ubuntu-advantage -creating /tmp/uac/debian/ubuntu-advantage-tools/etc/apt -creating /tmp/uac/debian/ubuntu-advantage-tools/etc/apt/apt.conf.d -copying apt.conf.d/51ubuntu-advantage-esm -> /tmp/uac/debian/ubuntu-advantage-tools/etc/apt/apt.conf.d -creating /tmp/uac/debian/ubuntu-advantage-tools/etc/init -copying upstart/ua-auto-attach.conf -> /tmp/uac/debian/ubuntu-advantage-tools/etc/init -running install_egg_info -running egg_info -creating ubuntu_advantage_tools.egg-info -writing top-level names to ubuntu_advantage_tools.egg-info/top_level.txt -writing ubuntu_advantage_tools.egg-info/PKG-INFO -writing entry points to ubuntu_advantage_tools.egg-info/entry_points.txt -writing requirements to ubuntu_advantage_tools.egg-info/requires.txt -writing dependency_links to ubuntu_advantage_tools.egg-info/dependency_links.txt -writing manifest file 'ubuntu_advantage_tools.egg-info/SOURCES.txt' -reading manifest file 'ubuntu_advantage_tools.egg-info/SOURCES.txt' -reading manifest template 'MANIFEST.in' -writing manifest file 'ubuntu_advantage_tools.egg-info/SOURCES.txt' -Copying ubuntu_advantage_tools.egg-info to /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages/ubuntu_advantage_tools-20.3.egg-info -running install_scripts -Installing ubuntu-advantage script to /tmp/uac/debian/ubuntu-advantage-tools/usr/bin -Installing ua script to /tmp/uac/debian/ubuntu-advantage-tools/usr/bin -flist=$(find /tmp/uac/debian/ -type f -name version.py) && sed -i 's,@@PACKAGED_VERSION@@,25.0,' ${flist:-did-not-find-version-py-for-replacement} -make -C apt-hook DESTDIR=/tmp/uac/debian/ubuntu-advantage-tools install -make[2]: Entering directory `/tmp/uac/apt-hook' -install -D -m 644 20apt-esm-hook.conf /tmp/uac/debian/ubuntu-advantage-tools/etc/apt/apt.conf.d/20apt-esm-hook.conf -install -D -m 755 hook /tmp/uac/debian/ubuntu-advantage-tools/usr/lib/ubuntu-advantage/apt-esm-hook -make[2]: Leaving directory `/tmp/uac/apt-hook' -# Move ua-auto-attach.conf to ubuntu-advantage-pro -mkdir -p debian/ubuntu-advantage-pro/etc/init -mv debian/ubuntu-advantage-tools/etc/init/ua-auto-attach.conf debian/ubuntu-advantage-pro/etc/init/ -rmdir debian/ubuntu-advantage-tools/etc/init -make[1]: Leaving directory `/tmp/uac' - dh_installdocs -O--buildsystem=pybuild -O--no-start - install -g 0 -o 0 -d debian/ubuntu-advantage-tools/usr/share/doc/ubuntu-advantage-tools - install -g 0 -o 0 -m 644 -p debian/copyright debian/ubuntu-advantage-tools/usr/share/doc/ubuntu-advantage-tools/copyright - install -g 0 -o 0 -d debian/ubuntu-advantage-pro/usr/share/doc/ubuntu-advantage-pro - install -g 0 -o 0 -m 644 -p debian/copyright debian/ubuntu-advantage-pro/usr/share/doc/ubuntu-advantage-pro/copyright - dh_installchangelogs -O--buildsystem=pybuild -O--no-start - install -o 0 -g 0 -p -m644 debian/changelog debian/ubuntu-advantage-tools/usr/share/doc/ubuntu-advantage-tools/changelog - install -o 0 -g 0 -p -m644 debian/changelog debian/ubuntu-advantage-pro/usr/share/doc/ubuntu-advantage-pro/changelog - dh_installman -O--buildsystem=pybuild -O--no-start - install -d debian/ubuntu-advantage-tools/usr/share/man/man1/ - install -p -m644 ubuntu-advantage.1 debian/ubuntu-advantage-tools/usr/share/man/man1/ubuntu-advantage.1 - man --recode UTF-8 ./ubuntu\-advantage\.1 > ubuntu\-advantage\.1\.new - chmod 644 ubuntu-advantage.1.new - mv -f ubuntu-advantage.1.new ubuntu-advantage.1 - dh_bash-completion -O--buildsystem=pybuild -O--no-start - install -d debian/ubuntu-advantage-tools/etc/bash_completion.d - installing tools/ua.bash as ua - install -p -m644 ./tools/ua.bash debian/ubuntu-advantage-tools/etc/bash_completion.d/ua - dh_installdebconf -O--buildsystem=pybuild -O--no-start - install -o 0 -g 0 -d debian/ubuntu-advantage-tools/DEBIAN - install -o 0 -g 0 -m 644 -p debian/ubuntu-advantage-tools.templates debian/ubuntu-advantage-tools/DEBIAN/templates - (grep -s -v misc:Depends debian/ubuntu-advantage-tools.substvars; echo "misc:Depends=debconf (>= 0.5) | debconf-2.0") > debian/ubuntu-advantage-tools.substvars.new - mv debian/ubuntu-advantage-tools.substvars.new debian/ubuntu-advantage-tools.substvars - echo "# Automatically added by dh_installdebconf">> debian/ubuntu-advantage-tools.postrm.debhelper - sed "" /usr/share/debhelper/autoscripts/postrm-debconf >> debian/ubuntu-advantage-tools.postrm.debhelper - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postrm.debhelper - install -o 0 -g 0 -d debian/ubuntu-advantage-pro/DEBIAN - dh_python3 -O--buildsystem=pybuild -O--no-start -D: dh_python3 dh_python3:149: version: 1.20140128-1ubuntu8.2 -D: dh_python3 dh_python3:150: argv: ['/usr/bin/dh_python3', '-O--buildsystem=pybuild', '-O--no-start'] -D: dh_python3 dh_python3:151: options: {'arch': None, 'ignore_shebangs': False, 'suggests': None, 'clean_dbg_pkg': True, 'package': None, 'vrange': None, 'compile_all': False, 'O': '--no-start', 'skip_private': False, 'verbose': False, 'no_package': None, 'depends': None, 'recommends': None, 'guess_deps': True, 'no_ext_rename': False, 'requires': None, 'no_shebang_rewrite': False, 'regexpr': None, 'shebang': None} -D: dh_python3 dh_python3:152: args: [] -D: dh_python3 dh_python3:154: supported Python versions: 3.4 (default=3.4) -D: dh_python3 debhelper:98: source=ubuntu-advantage-tools, binary packages=['ubuntu-advantage-tools', 'ubuntu-advantage-pro'] -D: dh_python3 dh_python3:171: processing package ubuntu-advantage-tools... -D: dh_python3 fs:47: moving files from debian/ubuntu-advantage-tools/usr/lib/python3.4/dist-packages to debian/ubuntu-advantage-tools/usr/lib/python3/dist-packages/ -D: dh_python3 fs:219: package ubuntu-advantage-tools details = {'nsp.txt': set(), 'ext_vers': set(), 'compile': True, 'public_vers': {Version('3')}, 'private_dirs': {}, 'ext_no_version': set(), 'shebangs': {/usr/bin/python3, /usr/bin/python3}, 'requires.txt': {'debian/ubuntu-advantage-tools/usr/lib/python3/dist-packages/ubuntu_advantage_tools-20.3.egg-info/requires.txt'}} -D: dh_python3 depends:107: generating dependencies for package ubuntu-advantage-tools -D: dh_python3 pydist:119: trying to guess dependency for pyyaml (python=None) -D: dh_python3 depends:236: D={'python3', 'python3-yaml', 'python3:any (>= 3.3.2-2~)'}; R=[]; S=[]; E=[], B=[]; RT=[] -D: dh_python3 dh_python3:171: processing package ubuntu-advantage-pro... -D: dh_python3 fs:219: package ubuntu-advantage-pro details = {'nsp.txt': set(), 'ext_vers': set(), 'compile': False, 'public_vers': set(), 'private_dirs': {}, 'ext_no_version': set(), 'shebangs': set(), 'requires.txt': set()} -D: dh_python3 depends:107: generating dependencies for package ubuntu-advantage-pro -D: dh_python3 depends:236: D=set(); R=[]; S=[]; E=[], B=[]; RT=[] - dh_systemd_enable -O--buildsystem=pybuild -O--no-start - dh_systemd_start -O--buildsystem=pybuild -O--no-start - dh_installlogrotate -O--buildsystem=pybuild -O--no-start - install -o 0 -g 0 -d debian/ubuntu-advantage-tools/etc/logrotate.d - install -m 644 debian/ubuntu-advantage-tools.logrotate debian/ubuntu-advantage-tools/etc/logrotate.d/ubuntu-advantage-tools - dh_perl -O--buildsystem=pybuild -O--no-start - dh_link -O--buildsystem=pybuild -O--no-start - rm -f debian/ubuntu-advantage-tools/usr/share/man/man1/ua.1 - ln -sf ubuntu-advantage.1 debian/ubuntu-advantage-tools/usr/share/man/man1/ua.1 - rm -f debian/ubuntu-advantage-tools/usr/bin/ua - ln -sf ubuntu-advantage debian/ubuntu-advantage-tools/usr/bin/ua - dh_compress -O--buildsystem=pybuild -O--no-start - cd debian/ubuntu-advantage-tools - chmod a-x usr/share/man/man1/ubuntu-advantage.1 usr/share/doc/ubuntu-advantage-tools/changelog - gzip -9nf usr/share/man/man1/ubuntu-advantage.1 usr/share/doc/ubuntu-advantage-tools/changelog - cd '/tmp/uac' - rm -f debian/ubuntu-advantage-tools/usr/share/man/man1/ua.1 - ln -sf ubuntu-advantage.1.gz debian/ubuntu-advantage-tools/usr/share/man/man1/ua.1.gz - cd debian/ubuntu-advantage-pro - chmod a-x usr/share/doc/ubuntu-advantage-pro/changelog - gzip -9nf usr/share/doc/ubuntu-advantage-pro/changelog - cd '/tmp/uac' - dh_fixperms -O--buildsystem=pybuild -O--no-start - find debian/ubuntu-advantage-tools -print0 2>/dev/null | xargs -0r chown --no-dereference 0:0 - find debian/ubuntu-advantage-tools ! -type l -print0 2>/dev/null | xargs -0r chmod go=rX,u+rw,a-s - find debian/ubuntu-advantage-tools/usr/share/doc -type f ! -regex 'debian/ubuntu-advantage-tools/usr/share/doc/[^/]*/examples/.*' -print0 2>/dev/null | xargs -0r chmod 644 - find debian/ubuntu-advantage-tools/usr/share/doc -type d -print0 2>/dev/null | xargs -0r chmod 755 - find debian/ubuntu-advantage-tools/usr/share/man debian/ubuntu-advantage-tools/usr/man/ debian/ubuntu-advantage-tools/usr/X11*/man/ -type f -print0 2>/dev/null | xargs -0r chmod 644 - find debian/ubuntu-advantage-tools -perm -5 -type f \( -name '*.so.*' -or -name '*.so' -or -name '*.la' -or -name '*.a' \) -print0 2>/dev/null | xargs -0r chmod 644 - find debian/ubuntu-advantage-tools/usr/include -type f -print0 2>/dev/null | xargs -0r chmod 644 - find debian/ubuntu-advantage-tools/usr/share/applications -type f -print0 2>/dev/null | xargs -0r chmod 644 - find debian/ubuntu-advantage-tools -perm -5 -type f \( -name '*.cmxs' \) -print0 2>/dev/null | xargs -0r chmod 644 - find debian/ubuntu-advantage-tools/usr/lib/perl5 debian/ubuntu-advantage-tools/usr/share/perl5 -type f -perm -5 -name '*.pm' -print0 2>/dev/null | xargs -0r chmod a-X - find debian/ubuntu-advantage-tools/usr/bin -type f -print0 2>/dev/null | xargs -0r chmod a+x - find debian/ubuntu-advantage-tools/usr/lib -type f -name '*.ali' -print0 2>/dev/null | xargs -0r chmod uga-w - find debian/ubuntu-advantage-pro -print0 2>/dev/null | xargs -0r chown --no-dereference 0:0 - find debian/ubuntu-advantage-pro ! -type l -print0 2>/dev/null | xargs -0r chmod go=rX,u+rw,a-s - find debian/ubuntu-advantage-pro/usr/share/doc -type f ! -regex 'debian/ubuntu-advantage-pro/usr/share/doc/[^/]*/examples/.*' -print0 2>/dev/null | xargs -0r chmod 644 - find debian/ubuntu-advantage-pro/usr/share/doc -type d -print0 2>/dev/null | xargs -0r chmod 755 - find debian/ubuntu-advantage-pro/usr/share/man debian/ubuntu-advantage-pro/usr/man/ debian/ubuntu-advantage-pro/usr/X11*/man/ -type f -print0 2>/dev/null | xargs -0r chmod 644 - find debian/ubuntu-advantage-pro -perm -5 -type f \( -name '*.so.*' -or -name '*.so' -or -name '*.la' -or -name '*.a' \) -print0 2>/dev/null | xargs -0r chmod 644 - find debian/ubuntu-advantage-pro/usr/include -type f -print0 2>/dev/null | xargs -0r chmod 644 - find debian/ubuntu-advantage-pro/usr/share/applications -type f -print0 2>/dev/null | xargs -0r chmod 644 - find debian/ubuntu-advantage-pro -perm -5 -type f \( -name '*.cmxs' \) -print0 2>/dev/null | xargs -0r chmod 644 - find debian/ubuntu-advantage-pro/usr/lib/perl5 debian/ubuntu-advantage-pro/usr/share/perl5 -type f -perm -5 -name '*.pm' -print0 2>/dev/null | xargs -0r chmod a-X - find debian/ubuntu-advantage-pro/usr/lib -type f -name '*.ali' -print0 2>/dev/null | xargs -0r chmod uga-w - dh_strip -O--buildsystem=pybuild -O--no-start - strip --remove-section=.comment --remove-section=.note debian/ubuntu-advantage-tools/usr/lib/ubuntu-advantage/apt-esm-hook - dh_makeshlibs -O--buildsystem=pybuild -O--no-start - rm -f debian/ubuntu-advantage-tools/DEBIAN/shlibs - rm -f debian/ubuntu-advantage-pro/DEBIAN/shlibs - dh_shlibdeps -O--buildsystem=pybuild -O--no-start - dpkg-shlibdeps -Tdebian/ubuntu-advantage-tools.substvars debian/ubuntu-advantage-tools/usr/lib/ubuntu-advantage/apt-esm-hook - dh_installdeb -O--buildsystem=pybuild -O--no-start - echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.postinst.debhelper - sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/99-esm 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postinst.debhelper - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postinst.debhelper - echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.preinst.debhelper - sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/99-esm 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.preinst.debhelper - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.preinst.debhelper - echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.prerm.debhelper.new - sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/99-esm 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.prerm.debhelper.new - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.prerm.debhelper.new - cat debian/ubuntu-advantage-tools.prerm.debhelper >> debian/ubuntu-advantage-tools.prerm.debhelper.new - mv debian/ubuntu-advantage-tools.prerm.debhelper.new debian/ubuntu-advantage-tools.prerm.debhelper - echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.postrm.debhelper.new - sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/99-esm 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postrm.debhelper.new - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postrm.debhelper.new - cat debian/ubuntu-advantage-tools.postrm.debhelper >> debian/ubuntu-advantage-tools.postrm.debhelper.new - mv debian/ubuntu-advantage-tools.postrm.debhelper.new debian/ubuntu-advantage-tools.postrm.debhelper - echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.postinst.debhelper - sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/80-esm 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postinst.debhelper - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postinst.debhelper - echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.preinst.debhelper - sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/80-esm 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.preinst.debhelper - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.preinst.debhelper - echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.prerm.debhelper.new - sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/80-esm 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.prerm.debhelper.new - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.prerm.debhelper.new - cat debian/ubuntu-advantage-tools.prerm.debhelper >> debian/ubuntu-advantage-tools.prerm.debhelper.new - mv debian/ubuntu-advantage-tools.prerm.debhelper.new debian/ubuntu-advantage-tools.prerm.debhelper - echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.postrm.debhelper.new - sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/80-esm 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postrm.debhelper.new - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postrm.debhelper.new - cat debian/ubuntu-advantage-tools.postrm.debhelper >> debian/ubuntu-advantage-tools.postrm.debhelper.new - mv debian/ubuntu-advantage-tools.postrm.debhelper.new debian/ubuntu-advantage-tools.postrm.debhelper - echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.postinst.debhelper - sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/80-livepatch 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postinst.debhelper - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postinst.debhelper - echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.preinst.debhelper - sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/80-livepatch 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.preinst.debhelper - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.preinst.debhelper - echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.prerm.debhelper.new - sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/80-livepatch 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.prerm.debhelper.new - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.prerm.debhelper.new - cat debian/ubuntu-advantage-tools.prerm.debhelper >> debian/ubuntu-advantage-tools.prerm.debhelper.new - mv debian/ubuntu-advantage-tools.prerm.debhelper.new debian/ubuntu-advantage-tools.prerm.debhelper - echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.postrm.debhelper.new - sed "s!#PARAMS#!rm_conffile /etc/update-motd.d/80-livepatch 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postrm.debhelper.new - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postrm.debhelper.new - cat debian/ubuntu-advantage-tools.postrm.debhelper >> debian/ubuntu-advantage-tools.postrm.debhelper.new - mv debian/ubuntu-advantage-tools.postrm.debhelper.new debian/ubuntu-advantage-tools.postrm.debhelper - echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.postinst.debhelper - sed "s!#PARAMS#!rm_conffile /etc/cron.daily/ubuntu-advantage-tools 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postinst.debhelper - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postinst.debhelper - echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.preinst.debhelper - sed "s!#PARAMS#!rm_conffile /etc/cron.daily/ubuntu-advantage-tools 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.preinst.debhelper - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.preinst.debhelper - echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.prerm.debhelper.new - sed "s!#PARAMS#!rm_conffile /etc/cron.daily/ubuntu-advantage-tools 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.prerm.debhelper.new - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.prerm.debhelper.new - cat debian/ubuntu-advantage-tools.prerm.debhelper >> debian/ubuntu-advantage-tools.prerm.debhelper.new - mv debian/ubuntu-advantage-tools.prerm.debhelper.new debian/ubuntu-advantage-tools.prerm.debhelper - echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.postrm.debhelper.new - sed "s!#PARAMS#!rm_conffile /etc/cron.daily/ubuntu-advantage-tools 19.1\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postrm.debhelper.new - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postrm.debhelper.new - cat debian/ubuntu-advantage-tools.postrm.debhelper >> debian/ubuntu-advantage-tools.postrm.debhelper.new - mv debian/ubuntu-advantage-tools.postrm.debhelper.new debian/ubuntu-advantage-tools.postrm.debhelper - echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.postinst.debhelper - sed "s!#PARAMS#!rm_conffile /etc/init/ua-auto-attach.conf 20.2\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postinst.debhelper - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postinst.debhelper - echo "# Automatically added by dh_installdeb">> debian/ubuntu-advantage-tools.preinst.debhelper - sed "s!#PARAMS#!rm_conffile /etc/init/ua-auto-attach.conf 20.2\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.preinst.debhelper - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.preinst.debhelper - echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.prerm.debhelper.new - sed "s!#PARAMS#!rm_conffile /etc/init/ua-auto-attach.conf 20.2\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.prerm.debhelper.new - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.prerm.debhelper.new - cat debian/ubuntu-advantage-tools.prerm.debhelper >> debian/ubuntu-advantage-tools.prerm.debhelper.new - mv debian/ubuntu-advantage-tools.prerm.debhelper.new debian/ubuntu-advantage-tools.prerm.debhelper - echo "# Automatically added by dh_installdeb"> debian/ubuntu-advantage-tools.postrm.debhelper.new - sed "s!#PARAMS#!rm_conffile /etc/init/ua-auto-attach.conf 20.2\~ ubuntu-advantage-tools!g" /usr/share/debhelper/autoscripts/maintscript-helper >> debian/ubuntu-advantage-tools.postrm.debhelper.new - echo '# End automatically added section' >> debian/ubuntu-advantage-tools.postrm.debhelper.new - cat debian/ubuntu-advantage-tools.postrm.debhelper >> debian/ubuntu-advantage-tools.postrm.debhelper.new - mv debian/ubuntu-advantage-tools.postrm.debhelper.new debian/ubuntu-advantage-tools.postrm.debhelper - perl -pe 's~#DEBHELPER#~qx{cat debian/ubuntu-advantage-tools.postinst.debhelper}~eg' < debian/postinst > debian/ubuntu-advantage-tools/DEBIAN/postinst - chown 0:0 debian/ubuntu-advantage-tools/DEBIAN/postinst - chmod 755 debian/ubuntu-advantage-tools/DEBIAN/postinst - printf '#!/bin/sh -set -e -' > debian/ubuntu-advantage-tools/DEBIAN/preinst - cat debian/ubuntu-advantage-tools.preinst.debhelper >> debian/ubuntu-advantage-tools/DEBIAN/preinst - chown 0:0 debian/ubuntu-advantage-tools/DEBIAN/preinst - chmod 755 debian/ubuntu-advantage-tools/DEBIAN/preinst - perl -pe 's~#DEBHELPER#~qx{cat debian/ubuntu-advantage-tools.prerm.debhelper}~eg' < debian/prerm > debian/ubuntu-advantage-tools/DEBIAN/prerm - chown 0:0 debian/ubuntu-advantage-tools/DEBIAN/prerm - chmod 755 debian/ubuntu-advantage-tools/DEBIAN/prerm - perl -pe 's~#DEBHELPER#~qx{cat debian/ubuntu-advantage-tools.postrm.debhelper}~eg' < debian/postrm > debian/ubuntu-advantage-tools/DEBIAN/postrm - chown 0:0 debian/ubuntu-advantage-tools/DEBIAN/postrm - chmod 755 debian/ubuntu-advantage-tools/DEBIAN/postrm - find debian/ubuntu-advantage-tools/etc -type f -printf '/etc/%P -' >> debian/ubuntu-advantage-tools/DEBIAN/conffiles - chmod 644 debian/ubuntu-advantage-tools/DEBIAN/conffiles - find debian/ubuntu-advantage-pro/etc -type f -printf '/etc/%P -' >> debian/ubuntu-advantage-pro/DEBIAN/conffiles - chmod 644 debian/ubuntu-advantage-pro/DEBIAN/conffiles - debian/rules override_dh_gencontrol -make[1]: Entering directory `/tmp/uac' -[ -z '"apt (>= 1.0.1ubuntu2.23), apt-transport-https (>= 1.0.1ubuntu2.23), apt-utils (>= 1.0.1ubuntu2.23), libapt-inst1.5 (>= 1.0.1ubuntu2.23), libapt-pkg4.12 (>= 1.0.1ubuntu2.23) "' ] || echo extra:Depends="apt (>= 1.0.1ubuntu2.23), apt-transport-https (>= 1.0.1ubuntu2.23), apt-utils (>= 1.0.1ubuntu2.23), libapt-inst1.5 (>= 1.0.1ubuntu2.23), libapt-pkg4.12 (>= 1.0.1ubuntu2.23) " >> debian/ubuntu-advantage-tools.substvars -dh_gencontrol - dpkg-gencontrol -pubuntu-advantage-tools -ldebian/changelog -Tdebian/ubuntu-advantage-tools.substvars -Pdebian/ubuntu-advantage-tools -dpkg-gencontrol: warning: File::FcntlLock not available; using flock which is not NFS-safe - chmod 644 debian/ubuntu-advantage-tools/DEBIAN/control - chown 0:0 debian/ubuntu-advantage-tools/DEBIAN/control - echo misc:Depends= >> debian/ubuntu-advantage-pro.substvars - dpkg-gencontrol -pubuntu-advantage-pro -ldebian/changelog -Tdebian/ubuntu-advantage-pro.substvars -Pdebian/ubuntu-advantage-pro -dpkg-gencontrol: warning: File::FcntlLock not available; using flock which is not NFS-safe - chmod 644 debian/ubuntu-advantage-pro/DEBIAN/control - chown 0:0 debian/ubuntu-advantage-pro/DEBIAN/control -make[1]: Leaving directory `/tmp/uac' - dh_md5sums -O--buildsystem=pybuild -O--no-start - (cd debian/ubuntu-advantage-tools >/dev/null ; find . -type f ! -path "./etc/ubuntu-advantage/uaclient.conf" ! -path "./etc/bash_completion.d/ua" ! -path "./etc/apt/apt.conf.d/20apt-esm-hook.conf" ! -path "./etc/apt/apt.conf.d/51ubuntu-advantage-esm" ! -path "./etc/logrotate.d/ubuntu-advantage-tools" ! -regex './DEBIAN/.*' -printf '%P\0' | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums) >/dev/null - chmod 644 debian/ubuntu-advantage-tools/DEBIAN/md5sums - chown 0:0 debian/ubuntu-advantage-tools/DEBIAN/md5sums - (cd debian/ubuntu-advantage-pro >/dev/null ; find . -type f ! -path "./etc/init/ua-auto-attach.conf" ! -regex './DEBIAN/.*' -printf '%P\0' | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums) >/dev/null - chmod 644 debian/ubuntu-advantage-pro/DEBIAN/md5sums - chown 0:0 debian/ubuntu-advantage-pro/DEBIAN/md5sums - dh_builddeb -O--buildsystem=pybuild -O--no-start - dpkg-deb --build debian/ubuntu-advantage-tools .. -dpkg-deb: building package `ubuntu-advantage-tools' in `../ubuntu-advantage-tools_25.0_amd64.deb'. - dpkg-deb --build debian/ubuntu-advantage-pro .. -dpkg-deb: building package `ubuntu-advantage-pro' in `../ubuntu-advantage-pro_25.0_amd64.deb'. - dpkg-genchanges >../ubuntu-advantage-tools_25.0_amd64.changes -dpkg-genchanges: including full source code in upload - dpkg-source --after-build uac -dpkg-buildpackage: full upload; Debian-native package (full source is included) -+ multipass transfer trusty-uac-build:/tmp/ubuntu-advantage-tools_25.0_amd64.deb /tmp/ -+ multipass transfer /tmp/ubuntu-advantage-tools_25.0_amd64.deb trusty-uac:/tmp/ -+ multipass exec trusty-uac -- sudo apt-get remove ubuntu-advantage-tools --assume-yes -Reading package lists... -Building dependency tree... -Reading state information... -The following packages were automatically installed and are no longer required: - python3-pkg-resources python3-yaml -Use 'apt-get autoremove' to remove them. -The following packages will be REMOVED: - ubuntu-advantage-tools ubuntu-minimal -0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded. -After this operation, 338 kB disk space will be freed. -(Reading database ... 86407 files and directories currently installed.) -Removing ubuntu-minimal (1.325.1) ... -Removing ubuntu-advantage-tools (19.6~ubuntu14.04.3) ... -Processing triggers for man-db (2.6.7.1-1ubuntu1) ... -+ multipass exec trusty-uac -- sudo dpkg -i /tmp/ubuntu-advantage-tools_25.0_amd64.deb -Selecting previously unselected package ubuntu-advantage-tools. -(Reading database ... 86364 files and directories currently installed.) -Preparing to unpack .../ubuntu-advantage-tools_25.0_amd64.deb ... -Unpacking ubuntu-advantage-tools (25.0) ... -Setting up ubuntu-advantage-tools (25.0) ... -Installing new version of config file /etc/apt/apt.conf.d/51ubuntu-advantage-esm ... -Processing triggers for man-db (2.6.7.1-1ubuntu1) ... -++ multipass exec trusty-uac -- ua version -+ uac_version=25.0 -+ [[ 25.0 == 25.0* ]] -+ echo 'SUCCESS: uaclient was successfully updated to: 25.0' -SUCCESS: uaclient was successfully updated to: 25.0 -+ multipass delete trusty-uac-build -+ multipass purge -+ check_livepatch_is_not_installed -+ multipass exec trusty-uac -- which canonical-livepatch -++ multipass exec trusty-uac -- echo 1 -+ return_code=1 -+ '[' 1 = 1 ']' -+ echo 'SUCESS: canonical-livepatch is not found before enabling it' -SUCESS: canonical-livepatch is not found before enabling it -+ attach_token_in_uaclient -+ multipass exec trusty-uac -- sudo ua attach -Enabling default service esm-infra -Updating package lists -ESM Infra enabled -This machine is now attached to 'lucas.moura128128@gmail.com' - -SERVICE ENTITLED STATUS DESCRIPTION -esm-apps no — UA Apps: Extended Security Maintenance -esm-infra yes enabled UA Infra: Extended Security Maintenance -livepatch yes disabled Canonical Livepatch service - -Enable services with: ua enable - - Account: lucas.moura128128@gmail.com -Subscription: lucas.moura128128@gmail.com -+ enable_livepatch -+ multipass exec trusty-uac -- sudo ua enable livepatch -One moment, checking your subscription first -Installing snapd -Updating package lists -Installing canonical-livepatch snap -Canonical livepatch enabled. -+ check_livepatch -++ multipass exec trusty-uac -- sudo canonical-livepatch status -++ grep running -+ return_str=' running: true' -+ expected_str=' running: true' -+ '[' ' running: true' = ' running: true' ']' -+ echo 'SUCCESS: livepatch was enabled and is running' -SUCCESS: livepatch was enabled and is running diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/release-26/xenial-enable-fips ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-26/xenial-enable-fips --- ubuntu-advantage-tools-27.9~18.04.1/sru/release-26/xenial-enable-fips 2020-11-23 16:48:55.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-26/xenial-enable-fips 1970-01-01 00:00:00.000000000 +0000 @@ -1,188 +0,0 @@ -=== Begin SRU Template === -[Impact] -When enabling FIPS in a system we expect it to also update the current kernel to a FIPS supported -one. We are now testing for Xenial if that is the scenario that we land up with after enabling FIPS -using uaclient. - -[Test Case] -``` -#!/bin/sh -set -x - -STAGING_CONTRACT_TOKEN= -series=xenial -name=$series-fips - -install_uac_from_branch() { - branch=$1 - pkg_name=ubuntu-advantage-tools_26.0_amd64.deb - - multipass exec $name -- sudo apt-get -yq update - multipass exec $name -- sudo apt-get -yq install git make - multipass exec $name -- git clone https://github.com/canonical/ubuntu-advantage-client.git /tmp/uac - multipass exec $name -- sh -c "cd /tmp/uac/ && git checkout $branch" - multipass exec $name -- sudo sh -c "cd /tmp/uac/ && make deps > /dev/null" - multipass exec $name -- sudo sh -c "cd /tmp/uac/ && dpkg-buildpackage -us -uc > /dev/null" - multipass exec $name -- sudo dpkg -i /tmp/$pkg_name -} - -configure_uac_to_use_staging_contract() { - multipass exec $name -- sudo sed -i 's/contracts.can/contracts.staging.can/' /etc/ubuntu-advantage/uaclient.conf -} - -enable_fips() { - multipass exec $name -- sudo ua attach $STAGING_CONTRACT_TOKEN - multipass exec $name -- sudo ua disable livepatch - multipass exec $name -- sudo ua enable fips --beta --assume-yes - multipass exec $name -- sudo apt update - - traceback_out=$(multipass exec $name -- grep Traceback /var/log/ubuntu-advantage.log) - - if [ -z "$traceback_out" ]; then - echo "SUCCESS: No Tracebacks found on ubuntu-advantage.log" - else - echo "FAILURE: Tracebacks found on ubuntu-advantage.log" - fi -} - -check_kernel_for_fips() { - kernel_version=$(multipass exec $name -- sh -c "uname -r | grep -o fips") - if [ "$kernel_version" = "fips" ]; then - echo "SUCCESS: Xenial kernel was updated to fips version" - else - echo "FAILURE: Xenial kernel was not updated to fips version" - fi - - fips_enabled=$(multipass exec $name -- cat /proc/sys/crypto/fips_enabled) - - if [ "$fips_enabled" = "1" ]; then - echo "SUCCESS: FIPS is shown as enabled in the system" - else - echo "FAILURE: FIPS is not shown as enabled in the system" - fi -} - -multipass delete $name -multipass purge -multipass launch $series --name $name - -install_uac_from_branch "update-fips" -configure_uac_to_use_staging_contract -enable_fips - -multipass exec $name -- sudo reboot -sleep 20 -multipass exec $name -- sudo ua status --all - -check_kernel_for_fips -``` - -=== Verification Log === - -Creating xenial-fips -Configuring xenial-fips -Starting xenial-fips -Waiting for initialization to complete -Launched: xenial-fips -Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB] -Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease -Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB] -Get:4 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [1,476 kB] -Get:5 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB] -Get:6 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7,532 kB] -Get:7 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [350 kB] -Get:8 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [773 kB] -Get:9 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [218 kB] -Get:10 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [8,236 B] -Get:11 http://security.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [2,888 B] -Get:12 http://archive.ubuntu.com/ubuntu xenial/universe Translation-en [4,354 kB] -Get:13 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [144 kB] -Get:14 http://archive.ubuntu.com/ubuntu xenial/multiverse Translation-en [106 kB] -Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [1,880 kB] -Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [454 kB] -Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [1,195 kB] -Get:18 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [348 kB] -Get:19 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [23.0 kB] -Get:20 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [8,632 B] -Get:21 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [9,812 B] -Get:22 http://archive.ubuntu.com/ubuntu xenial-backports/main Translation-en [4,456 B] -Get:23 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [11.3 kB] -Get:24 http://archive.ubuntu.com/ubuntu xenial-backports/universe Translation-en [4,476 B] -Fetched 19.2 MB in 5s (3,437 kB/s) -Reading package lists... -Reading package lists... -Building dependency tree... -Reading state information... -git is already the newest version (1:2.7.4-0ubuntu1.9). -Suggested packages: - make-doc -The following NEW packages will be installed: - make -0 upgraded, 1 newly installed, 0 to remove and 20 not upgraded. -Need to get 151 kB of archives. -After this operation, 365 kB of additional disk space will be used. -Get:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 make amd64 4.1-6 [151 kB] -Fetched 151 kB in 1s (111 kB/s) -Selecting previously unselected package make. -Preparing to unpack .../archives/make_4.1-6_amd64.deb ... -Unpacking make (4.1-6) ... -Processing triggers for man-db (2.7.5-1) ... -Setting up make (4.1-6) ... -Branch update-fips set up to track remote branch update-fips from origin. -(Reading database ... 59834 files and directories currently installed.) -Preparing to unpack .../ubuntu-advantage-tools_26.0_amd64.deb ... -Unpacking ubuntu-advantage-tools (26.0) over (10ubuntu0.16.04.1) ... -Setting up ubuntu-advantage-tools (26.0) ... -Removing obsolete conffile /etc/update-motd.d/99-esm ... -Processing triggers for man-db (2.7.5-1) ... -Updating package lists -ESM Apps enabled -Installing canonical-livepatch snap -Canonical livepatch enabled. -This machine is now attached to 'server-team-ua-client-ci-uaa' - -SERVICE ENTITLED STATUS DESCRIPTION -esm-infra no — UA Infra: Extended Security Maintenance (ESM) -livepatch yes enabled Canonical Livepatch service - -Enable services with: ua enable - - Account: server-team-ua-client-ci - Subscription: server-team-ua-client-ci-uaa - Valid until: n/a -Technical support level: essential -One moment, checking your subscription first -Updating package lists -Installing FIPS packages -FIPS enabled -A reboot is required to complete install -Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease -Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease -Hit:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease -Hit:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease -Hit:5 https://esm.staging.ubuntu.com/apps/ubuntu xenial-apps-security InRelease -Hit:6 https://esm.staging.ubuntu.com/apps/ubuntu xenial-apps-updates InRelease -Hit:7 https://esm.staging.ubuntu.com/fips/ubuntu xenial InRelease -Reading package lists... -Building dependency tree... -Reading state information... -5 of the updates are from UA Apps: ESM. -28 packages can be upgraded. Run 'apt list --upgradable' to see them. -SUCCESS: No Tracebacks found on ubuntu-advantage.log -SERVICE ENTITLED STATUS DESCRIPTION -cc-eal yes disabled Common Criteria EAL2 Provisioning Packages -cis-audit no — Center for Internet Security Audit Tools -esm-apps yes enabled UA Apps: Extended Security Maintenance (ESM) -esm-infra no — UA Infra: Extended Security Maintenance (ESM) -fips yes enabled NIST-certified FIPS modules -fips-updates yes disabled Uncertified security updates to FIPS modules -livepatch yes n/a Canonical Livepatch service - -Enable services with: ua enable - - Account: server-team-ua-client-ci - Subscription: server-team-ua-client-ci-uaa - Valid until: n/a -Technical support level: essential -SUCCESS: Xenial kernel was updated to fips version -SUCCESS: FIPS is shown as enabled in the system diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/release-27/test_trusty_upgrade_to_xenial.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27/test_trusty_upgrade_to_xenial.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/release-27/test_trusty_upgrade_to_xenial.sh 2022-04-01 13:27:45.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27/test_trusty_upgrade_to_xenial.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -#!/bin/sh - -# Test if upgrading from trusty machine already attached to xenial will keep -# services still enabled after the do-release-upgrade operation. Currently, -# this will not happen because the latest version of uaclient in trusty does -# not enable do-release-upgrade to run a post script that handles the services -# migration when performing an upgrade. -# This script is adding a solution for that problem by manually adding the necessary -# configs for do-release-upgrade (This configurations are done for release 26 forward) -set -x - -series=trusty -name=$series-upgrade-lxd - -function fix_upgrade_for_esm_infra() { - # This fix is better documented here: - # https://github.com/canonical/ubuntu-advantage-client/issues/1590 - multipass exec $name -- sh -c "echo 'Pockets=security,updates,proposed,backports,infra-security,infra-updates,apps-security,apps-updates' >> allow.cfg" - multipass exec $name -- sh -c "echo '[Distro]\nPostInstallScripts=./xorg_fix_proprietary.py, /usr/lib/ubuntu-advantage/upgrade_lts_contract.py' >> allow.cfg" -} - - -multipass delete $name -multipass purge -multipass launch $series --name $name - -multipass exec $name -- sudo apt-get upgrade -y -multipass exec $name -- sudo apt-get dist-upgrade -y -multipass exec $name -- ua version -multipass exec $name -- sudo ua attach $UACLIENT_BEHAVE_CONTRACT_TOKEN -multipass exec $name -- sudo ua status -multipass exec $name -- sudo sh -c "cat </etc/apt/sources.list.d/ubuntu-$series-proposed.list -deb http://archive.ubuntu.com/ubuntu/ $series-proposed restricted main multiverse universe" -multipass exec $name -- sudo apt-get update -multipass exec $name -- sudo mkdir -p /etc/update-manager/release-upgrades.d -multipass exec $name -- sh -c "echo '[Sources]\nAllowThirdParty=yes' > allow.cfg" - -fix_upgrade_for_esm_infra - -multipass exec $name -- sudo mv allow.cfg /etc/update-manager/release-upgrades.d -multipass exec $name -- sudo do-release-upgrade --frontend DistUpgradeViewNonInteractive -multipass exec $name -- sudo ua status -multipass exec $name -- sudo reboot - -multipass exec $name -- sudo reboot -sleep 60 -multipass exec $name -- sudo ua status --wait diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/release-27/test_xenial_upgrade.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27/test_xenial_upgrade.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/release-27/test_xenial_upgrade.sh 2022-04-01 13:27:45.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27/test_xenial_upgrade.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,226 +0,0 @@ -#!/usr/bin/bash - -set -x -set -e -name=test-xenial-ua-upgrade -series=xenial - -function h1() { - set +x - echo "" - echo "" - echo "" - echo "############################################################################" - echo "## $1" - echo "############################################################################" - echo "" - set -x -} -function h2() { - set +x - echo "" - echo "" - echo "-> $1" - echo "----------------------------------------------------------------------------" - echo "" - set -x -} - - -function setup() { - tool=$1 - - h2 "Make sure we're up to date" - $tool exec $name -- sudo apt update - $tool exec $name -- sudo apt upgrade -y - $tool exec $name -- sudo apt install ubuntu-advantage-tools -y - - h2 "Initial State" - $tool exec $name -- apt-cache policy ubuntu-advantage-tools - $tool exec $name -- sudo ubuntu-advantage status - $tool exec $name -- dpkg-query -L ubuntu-advantage-tools -} -function setup_container() { - h1 "Setting up fresh container" - lxc delete --force $name || true - lxc launch ubuntu-daily:xenial $name - sleep 10 - - setup lxc -} -function setup_vm() { - h1 "Setting up fresh vm" - multipass delete -p $name || true - multipass launch -n $name xenial - sleep 10 - - setup multipass -} -function teardown_container() { - lxc delete --force $name || true -} -function teardown_vm() { - multipass delete -p $name || true -} - -function install_new_ua() { - tool=$1 - h2 "Set up to use daily ppa" - $tool exec $name -- sudo sh -c "cat </etc/apt/sources.list.d/ubuntu-$series-proposed.list - deb http://archive.ubuntu.com/ubuntu/ $series-proposed restricted main multiverse universe" - $tool exec $name -- sudo apt update - - h2 "Actually install - verify there are no errors" - $tool exec $name -- sudo apt install ubuntu-advantage-tools -y -} - -function attach_ua() { - tool=$1 - set +x - echo "+ $tool exec $name -- sudo ua attach \$UACLIENT_BEHAVE_CONTRACT_TOKEN" - $tool exec $name -- sudo ua attach $UACLIENT_BEHAVE_CONTRACT_TOKEN - set -x -} - - - - -function test_upgrade_in_container() { - setup_container - - h1 "Upgrade to UA 27 while unattached" - - install_new_ua lxc - - h2 "Check for leftover files from old version - verify nothing unexpected is left behind" - lxc exec $name -- ls -l /etc/update-motd.d/99-esm /usr/share/keyrings/ubuntu-esm-keyring.gpg /usr/share/keyrings/ubuntu-fips-keyring.gpg /usr/share/man/man1/ubuntu-advantage.1.gz /usr/share/doc/ubuntu-advantage-tools/copyright /usr/share/doc/ubuntu-advantage-tools/changelog.gz /usr/bin/ubuntu-advantage || true - - h2 "New Status - verify esm-infra available but not enabled; esm-apps not visible" - lxc exec $name -- ua status - - h2 "Attach - verify esm-infra automatically enabled; esm-apps not visible" - attach_ua lxc - - h2 "Detaching before destruction" - lxc exec $name -- ua detach --assume-yes - - teardown_container -} - - -function test_upgrade_with_livepatch_in_vm() { - - setup_vm - - h1 "Upgrade to UA 27 while old version has livepatch enabled" - - h2 "Enable livepatch on old version" - set +x - echo "+ multipass exec $name -- ubuntu-advantage enable-livepatch \$LIVEPATCH_TOKEN" - multipass exec $name -- sudo ubuntu-advantage enable-livepatch $LIVEPATCH_TOKEN - set -x - - h2 "Status before - old UA and livepatch say enabled" - multipass exec $name -- sudo canonical-livepatch status - multipass exec $name -- sudo ubuntu-advantage status - - install_new_ua multipass - - h2 "Status after upgrade - livepatch still enabled but new UA doesn't report it" - multipass exec $name -- sudo canonical-livepatch status - multipass exec $name -- sudo ua status - - h2 "Attach - verify that livepatch is disabled and re-enabled" - attach_ua multipass - - h2 "Status after attach - both livepatch and UA should say enabled" - multipass exec $name -- sudo canonical-livepatch status - multipass exec $name -- sudo ua status - - h2 "Detaching before destruction" - multipass exec $name -- sudo ua detach --assume-yes - - teardown_vm -} - -function test_upgrade_with_fips_in_vm() { - - setup_vm - - h1 "Upgrade to UA 27 while old version has fips enabled" - - h2 "Manual fips check says disabled (file doesn't exist)" - multipass exec $name -- sudo cat /proc/sys/crypto/fips_enabled || true - - h2 "Enable fips on old version" - set +x - echo "+ multipass exec $name -- ubuntu-advantage enable-fips \$FIPS_CREDS" - multipass exec $name -- sudo ubuntu-advantage enable-fips $FIPS_CREDS - set -x - - h2 "Reboot to finish fips activation" - multipass exec $name -- sudo reboot || true - sleep 20 - - h2 "Status before upgrade - old UA says fips is enabled, manual check agrees" - multipass exec $name -- sudo ubuntu-advantage status - multipass exec $name -- sudo cat /proc/sys/crypto/fips_enabled - - h2 "Source added by old client is present" - multipass exec $name -- sudo ls /etc/apt/sources.list.d - multipass exec $name -- sudo grep -o private-ppa.launchpad.net/ubuntu-advantage/fips/ubuntu /etc/apt/sources.list.d/ubuntu-fips-xenial.list - - install_new_ua multipass - - h2 "Status after upgrade - new UA won't say anything is enabled, but a manual check still says fips is enabled" - multipass exec $name -- sudo ua status - multipass exec $name -- sudo cat /proc/sys/crypto/fips_enabled - - h2 "Source file added by old client is renamed but contents left unchanged" - multipass exec $name -- sudo ls /etc/apt/sources.list.d - multipass exec $name -- sudo grep -o private-ppa.launchpad.net/ubuntu-advantage/fips/ubuntu /etc/apt/sources.list.d/ubuntu-fips.list - - h2 "Attach - only esm-infra will be auto-enabled" - attach_ua multipass - - h2 "Status after attach - new UA will say fips is disabled, livepatch is n/a, and there is a notice to enable fips" - multipass exec $name -- sudo ua status - multipass exec $name -- sudo cat /proc/sys/crypto/fips_enabled - - h2 "Enable fips on new UA - This will re-install fips packages and ask to reboot again" - multipass exec $name -- sudo ua enable fips --assume-yes - - - h2 "Status after enabled but before reboot - UA says fips enabled, notice to enable fips is gone" - multipass exec $name -- sudo ua status - multipass exec $name -- sudo cat /proc/sys/crypto/fips_enabled - - h2 "Source added by old client is replaced with new source" - set +x - echo "multipass exec $name -- sudo grep \$FIPS_CREDS /etc/apt/sources.list.d/ubuntu-fips.list && echo \"FAIL: found oldclient FIPS creds\" || echo \"SUCCESS: Migrated to new client creds\"" - multipass exec $name -- sudo grep $FIPS_CREDS /etc/apt/sources.list.d/ubuntu-fips.list && echo "FAIL: found oldclient FIPS creds" || echo "SUCCESS: Migrated to new client creds" - set -x - multipass exec $name -- sudo ls /etc/apt/sources.list.d - multipass exec $name -- sudo cat /etc/apt/sources.list.d/ubuntu-fips.list - multipass exec $name -- sudo apt update - - h2 "Check to make sure we have a valid ubuntu-*-fips metapackage installed" - multipass exec $name -- sudo grep "install" /var/log/ubuntu-advantage.log - - h2 "Reboot to finish second fips activation" - multipass exec $name -- sudo reboot || true - sleep 20 - - h2 "Status after reboot - new UA will say fips is enabled, manual check agrees" - multipass exec $name -- sudo ua status - multipass exec $name -- sudo cat /proc/sys/crypto/fips_enabled - - h2 "Detaching before destruction" - multipass exec $name -- sudo ua detach --assume-yes - - teardown_vm -} - -test_upgrade_in_container -test_upgrade_with_livepatch_in_vm -test_upgrade_with_fips_in_vm diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.3/gcp_auto_attach_test.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.3/gcp_auto_attach_test.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.3/gcp_auto_attach_test.sh 2022-04-01 13:27:49.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.3/gcp_auto_attach_test.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -#!/bin/sh -ZONE="us-east1-b" -INSTANCE_NAME="test-auto-attach" -INSTANCE_TYPE="n1-standard-1" -DISK_NAME="persistent-disk-0" - -set -x - -gcloud compute instances create $INSTANCE_NAME \ - --image="ubuntu-1604-xenial-v20210429" \ - --image-project="ubuntu-os-cloud" \ - --machine-type=$INSTANCE_TYPE \ - --zone=$ZONE -sleep 30 - -gcloud compute scp ubuntu-advantage-tools.deb $INSTANCE_NAME:/tmp/ -gcloud compute ssh $INSTANCE_NAME -- "sudo apt update" -gcloud compute ssh $INSTANCE_NAME -- "sudo apt install ubuntu-advantage-tools -y" -gcloud compute ssh $INSTANCE_NAME -- "sudo dpkg -i /tmp/ubuntu-advantage-tools.deb" -gcloud compute ssh $INSTANCE_NAME -- "sudo sed -i 's/pass/pass\n else:\n print(\"pro license not present\")/' /usr/lib/python3/dist-packages/uaclient/jobs/license_check.py" -# Without the license, it will not try to auto_attach -gcloud compute ssh $INSTANCE_NAME -- "sudo python3 /usr/lib/ubuntu-advantage/license_check.py" -gcloud compute ssh $INSTANCE_NAME -- "sudo ua status --wait" - -gcloud compute instances stop $INSTANCE_NAME -gcloud beta compute disks update $INSTANCE_NAME --zone=$ZONE --update-user-licenses="https://www.googleapis.com/compute/v1/projects/ubuntu-os-pro-cloud/global/licenses/ubuntu-pro-1604-lts" -gcloud compute instances start $INSTANCE_NAME -sleep 30 - -# Now with the license, it will succeed auto_attaching -gcloud compute ssh $INSTANCE_NAME -- "sudo python3 /usr/lib/ubuntu-advantage/license_check.py" -gcloud compute ssh $INSTANCE_NAME -- "sudo ua status --wait" -gcloud compute ssh $INSTANCE_NAME -- "sudo ua detach --assume-yes" - -gcloud compute instances delete $INSTANCE_NAME diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.3/ua-messaging-disabled.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.3/ua-messaging-disabled.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.3/ua-messaging-disabled.sh 2022-04-01 13:27:49.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.3/ua-messaging-disabled.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -#!/bin/sh - -series=$1 -name="test-systemd-$series" -DEB_PATH=$2 - -lxc launch ubuntu-daily:$series $name -sleep 5 -lxc file push $DEB_PATH $name/tmp/ua.deb -echo "List timers in default state" -echo "--------------------------" -lxc exec $name -- sudo systemctl list-timers --all -echo "--------------------------" -echo "Disabling ua-messaging.timer" -echo "--------------------------" -lxc exec $name -- sudo systemctl stop ua-messaging.timer -lxc exec $name -- sudo systemctl disable ua-messaging.timer -lxc exec $name -- sudo systemctl list-timers --all -sleep 2 -echo "--------------------------" -echo "Installing new UA package" -echo "--------------------------" -lxc exec $name -- sudo dpkg -i /tmp/ua.deb -echo "--------------------------" -echo "Verifying ua-timer.timer is disabled" -lxc exec $name -- sudo systemctl list-timers --all -echo "--------------------------" -lxc delete $name --force diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.4/test-unattached-status-job.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.4/test-unattached-status-job.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.4/test-unattached-status-job.sh 2022-04-01 13:27:49.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.4/test-unattached-status-job.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -series=$1 -set -x -lxc launch ubuntu-daily:$series test >/dev/null 2>&1 -sleep 10 - -echo -echo "showing the network call in current ua version 27.3" -lxc exec test -- apt-get update >/dev/null -lxc exec test -- apt-get install -y ubuntu-advantage-tools >/dev/null -lxc exec test -- ua version -echo "disable all jobs but the status job" -lxc exec test -- ua config set metering_timer=0 -lxc exec test -- ua config set update_messaging_timer=0 -echo "run the status update timer job by removing current timer state and executing the timer script" -echo "and run tcpdump while executing the script, filtering by the current IPs of contracts.canonical.com" -lxc exec test -- rm -f /var/lib/ubuntu-advantage/jobs-status.json -lxc exec test -- sh -c "tcpdump \"(host 91.189.92.68 or host 91.189.92.69)\" & pid=\$! && sleep 5 && python3 /usr/lib/ubuntu-advantage/timer.py && kill \$pid" -echo "Verify that tcpdump saw packets in above output" -echo "Verify that the job was actually processed by the timer: update_status should be there." -lxc exec test -- grep "update_status" /var/lib/ubuntu-advantage/jobs-status.json - - -echo -echo -echo "installing new version from proposed" -lxc exec test -- sh -c "echo \"deb http://archive.ubuntu.com/ubuntu $series-proposed main\" | tee /etc/apt/sources.list.d/proposed.list" -lxc exec test -- apt-get update >/dev/null -lxc exec test -- sh -c "DEBIAN_FRONTEND=noninteractive apt-get install -o Dpkg::Options::=\"--force-confdef\" -o Dpkg::Options::=\"--force-confold\" -y ubuntu-advantage-tools" > /dev/null -lxc exec test -- ua version - - -echo "run the status update timer job by removing current timer state and executing the timer script" -echo "and run tcpdump while executing the script, filtering by the current IPs of contracts.canonical.com" -lxc exec test -- rm -f /var/lib/ubuntu-advantage/jobs-status.json -lxc exec test -- sh -c "tcpdump \"(host 91.189.92.68 or host 91.189.92.69)\" & pid=\$! && sleep 5 && python3 /usr/lib/ubuntu-advantage/timer.py && kill \$pid" -echo "Verify that tcpdump DID NOT see packets in above output" -echo "Verify that the job was actually processed by the timer: update_status should be there." -lxc exec test -- grep "update_status" /var/lib/ubuntu-advantage/jobs-status.json - -lxc delete test --force diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.4.2/test-postinst-check-service-is-enabled-fix.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.4.2/test-postinst-check-service-is-enabled-fix.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.4.2/test-postinst-check-service-is-enabled-fix.sh 2022-04-01 13:27:49.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.4.2/test-postinst-check-service-is-enabled-fix.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -series=$1 -name=test-$series -set -x -lxc launch ubuntu-daily:$series $name >/dev/null 2>&1 -sleep 3 - -echo "Confirming we are runnign a ${series} machine" -lxc exec $name -- lsb_release -a - -echo "Updating to the latest version of UA" -lxc exec $name -- apt-get update >/dev/null -lxc exec $name -- apt-get install -y ubuntu-advantage-tools >/dev/null -lxc exec $name -- ua version -echo "Running ua status to persist cache" -lxc exec $name -- ua status -echo "Modifying ESM_SUPPORTED_ARCHS to emulate the issue" -lxc exec $name -- sed -i "s/ESM_SUPPORTED_ARCHS=\"i386 amd64\"/ESM_SUPPORTED_ARCHS=\"\"/" /var/lib/dpkg/info/ubuntu-advantage-tools.postinst -echo "Re-running the postinst script. Confirming that KeyError is reported on stdout" -lxc exec $name -- dpkg-reconfigure ubuntu-advantage-tools - -echo "Updating UA to the version with the fix" -lxc exec $name -- sh -c "echo \"deb http://archive.ubuntu.com/ubuntu $series-proposed main\" | tee /etc/apt/sources.list.d/proposed.list" -lxc exec $name -- apt-get update >/dev/null -lxc exec $name -- apt-get install -y ubuntu-advantage-tools >/dev/null -lxc exec $name -- ua version - -echo "Running ua status to persist cache" -lxc exec $name -- ua status -echo "Modifying ESM_SUPPORTED_ARCHS to emulate the issue" -lxc exec $name -- sed -i "s/ESM_SUPPORTED_ARCHS=\"i386 amd64\"/ESM_SUPPORTED_ARCHS=\"\"/" /var/lib/dpkg/info/ubuntu-advantage-tools.postinst -echo "Re-running the postinst script. Confirming that KeyError is no longer reported" -lxc exec $name -- dpkg-reconfigure ubuntu-advantage-tools - -lxc delete --force $name diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.5/test-aws-ipv6.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.5/test-aws-ipv6.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.5/test-aws-ipv6.sh 2022-04-01 13:27:49.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.5/test-aws-ipv6.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ -#!/bin/sh - -set -e - -KEY_PATH=$1 -DEB_PATH=$2 -sshopts=( -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR ) - -REGION=us-west-2 -INSTANCE_TYPE=t3.micro -KEY_NAME=test-ipv6 -PRO_IMAGE_ID=ami-07e00b8a1a054fdbf # bionic PRO image for us-west-2 - -# You need to have a subnet that supports IPv6. The easiest path here is to launch an ec2 -# instance through pycloudlib, which will already create a VPC with a subnet that supports -# IPv6. You can also use the security group created by pycloudlib -SUBNET_ID= -SECURITY_GROUP_ID= - -# Make sure that the awscli being used has support for the --metadata-options params, otherwise the -# IPv6 endpoint will not work as expected -instance_info=$(aws --region $REGION ec2 run-instances --instance-type $INSTANCE_TYPE --image-id $PRO_IMAGE_ID --subnet-id $SUBNET_ID --key-name $KEY_NAME --associate-public-ip-address --ipv6-address-count 1 --metadata-options HttpEndpoint=enabled,HttpProtocolIpv6=enabled --security-group-ids $SECURITY_GROUP_ID) -instance_id=$(echo $instance_info | jq -r ".Instances[0].InstanceId") -instance_ip=$(aws ec2 describe-instances --region $REGION --instance-ids $instance_id --query 'Reservations[*].Instances[*].PublicIpAddress' --output text) - -echo "---------------------------------------------" -echo "Checking instance info" -ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- lsb_release -a -ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo ua status --wait -echo "---------------------------------------------" -echo -e "\n" - -echo "---------------------------------------------" -echo "Detaching PRO instance" -ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo ua detach --assume-yes -echo "---------------------------------------------" -echo -e "\n" - -echo "---------------------------------------------" -echo "Installing package with IPv6 support" -scp "${sshopts[@]}" -i $KEY_PATH $DEB_PATH ubuntu@$instance_ip:/home/ubuntu/ua.deb -ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo dpkg -i ua.deb -ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- ua version -ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo ua status --wait -echo "---------------------------------------------" -echo -e "\n" - -echo "---------------------------------------------" -echo "Modifying IPv4 address to make it fail" -ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo rm /var/log/ubuntu-advantage.log -ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo sed -i "s/169.254.169.254/169.254.169.1/g" /usr/lib/python3/dist-packages/uaclient/clouds/aws.py -echo "---------------------------------------------" -echo -e "\n" - -echo "---------------------------------------------" -echo "Verify that auto-attach still works and IPv6 route was used instead" -ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo ua auto-attach -ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo ua status -ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo grep -F \"Could not reach AWS IMDS at http://169.254.169.1\" /var/log/ubuntu-advantage.log -ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo grep -F \"URL [PUT]: http://169.254.169.1/latest/api/token\" /var/log/ubuntu-advantage.log -ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo grep -F \"URL [PUT]: http://[fd00:ec2::254]/latest/api/token\" /var/log/ubuntu-advantage.log -ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo grep -F \"URL [PUT] response: http://[fd00:ec2::254]/latest/api/token\" /var/log/ubuntu-advantage.log -ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo grep -F \"URL [GET]: http://[fd00:ec2::254]/latest/dynamic/instance-identity/pkcs7\" /var/log/ubuntu-advantage.log -ssh "${sshopts[@]}" -i $KEY_PATH ubuntu@$instance_ip -- sudo grep -F \"URL [GET] response: http://[fd00:ec2::254]/latest/dynamic/instance-identity/pkcs7\" /var/log/ubuntu-advantage.log -echo "---------------------------------------------" -echo -e "\n" diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.7/test_world_readable_logs.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.7/test_world_readable_logs.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.7/test_world_readable_logs.sh 2022-04-01 13:27:49.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.7/test_world_readable_logs.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ -series=$1 -deb=$2 - -set -eE - -GREEN="\e[32m" -RED="\e[31m" -BLUE="\e[36m" -END_COLOR="\e[0m" - -function cleanup { - lxc delete test --force -} - -function on_err { - echo -e "${RED}Test Failed${END_COLOR}" - cleanup - exit 1 -} - -trap on_err ERR - -function print_and_run_cmd { - echo -e "${BLUE}Running:${END_COLOR}" "$@" - echo -e "${BLUE}Output:${END_COLOR}" - lxc exec test -- sh -c "$@" - echo -} - -function explanatory_message { - echo -e "${BLUE}$@${END_COLOR}" -} - -explanatory_message "Starting $series container and updating ubuntu-advantage-tools" -lxc launch ubuntu-daily:$series test >/dev/null 2>&1 -sleep 10 - -explanatory_message "Check that log is not world readable" -print_and_run_cmd "ua version" -print_and_run_cmd "head /var/log/ubuntu-advantage.log" -print_and_run_cmd "find /var/log/ -name ubuntu-advantage.log -perm 0600 | grep -qz ." - -lxc exec test -- apt-get update >/dev/null -explanatory_message "installing new version of ubuntu-advantage-tools from local copy" -lxc file push $deb test/tmp/ua.deb > /dev/null -print_and_run_cmd "dpkg -i /tmp/ua.deb" -print_and_run_cmd "ua version" - -explanatory_message "Check that log files permissions are still the same" -print_and_run_cmd "find /var/log/ -name ubuntu-advantage.log -perm 0600 | grep -qz ." - -explanatory_message "Check that logrotate command will create world readable files" -print_and_run_cmd "logrotate --force /etc/logrotate.d/ubuntu-advantage-tools" -print_and_run_cmd "find /var/log/ -name ubuntu-advantage.log -perm 0644 | grep -qz ." -print_and_run_cmd "find /var/log/ -name ubuntu-advantage.log.1 -perm 0600 | grep -qz ." - -explanatory_message "Check that running logrotate again will stil make world readable files" -# Just to add new entry to the log -print_and_run_cmd "ua version" -print_and_run_cmd "logrotate --force /etc/logrotate.d/ubuntu-advantage-tools" -print_and_run_cmd "find /var/log/ -name ubuntu-advantage.log -perm 0644 | grep -qz ." -print_and_run_cmd "find /var/log/ -name ubuntu-advantage.log.1 -perm 0644 | grep -qz ." -print_and_run_cmd "find /var/log/ -name ubuntu-advantage.log.2.gz -perm 0600 | grep -qz ." - -echo -e "${GREEN}Test Passed${END_COLOR}" -cleanup diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.9/cleanup_cloud_id_shim_ppa.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.9/cleanup_cloud_id_shim_ppa.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.9/cleanup_cloud_id_shim_ppa.sh 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.9/cleanup_cloud_id_shim_ppa.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -ppa=$1 -series=xenial - -set -e - -GREEN="\e[32m" -RED="\e[31m" -BLUE="\e[36m" -END_COLOR="\e[0m" - -function cleanup { - lxc delete test --force -} - -function on_err { - echo -e "${RED}Test Failed${END_COLOR}" - cleanup - exit 1 -} - -trap on_err ERR - -function print_and_run_cmd { - echo -e "${BLUE}Running:${END_COLOR}" "$@" - echo -e "${BLUE}Output:${END_COLOR}" - lxc exec test -- sh -c "$@" - echo -} - -function explanatory_message { - echo -e "${BLUE}$@${END_COLOR}" -} - -explanatory_message "Starting $series container and updating ubuntu-advantage-tools" -lxc launch ubuntu-daily:$series test >/dev/null 2>&1 -sleep 10 - -lxc exec test -- add-apt-repository $ppa >/dev/null -lxc exec test -- apt-get update >/dev/null -lxc exec test -- apt-get install locate >/dev/null -lxc exec test -- apt-get dist-upgrade -y >/dev/null -print_and_run_cmd "ua version" - -explanatory_message "Note where all cloud-id-shim artifacts are before upgrade" -print_and_run_cmd "updatedb" -print_and_run_cmd "locate ubuntu-advantage-cloud-id-shim" - -explanatory_message "upgrade to bionic" -lxc exec test -- sh -c "cat > /etc/update-manager/release-upgrades.d/ua-test.cfg << EOF -[Sources] -AllowThirdParty=yes -EOF" -lxc exec test -- do-release-upgrade --frontend DistUpgradeViewNonInteractive >/dev/null - -print_and_run_cmd "ua version" - -explanatory_message "cloud-id-shim artifacts should be gone" -print_and_run_cmd "updatedb" -print_and_run_cmd "locate ubuntu-advantage-cloud-id-shim || true" -result=$(lxc exec test -- locate ubuntu-advantage-cloud-id-shim || true) -test -z "$result" - -echo -e "${GREEN}Test Passed${END_COLOR}" -cleanup diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.9/cleanup_cloud_id_shim.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.9/cleanup_cloud_id_shim.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.9/cleanup_cloud_id_shim.sh 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.9/cleanup_cloud_id_shim.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -x_deb=$1 -b_deb=$2 -series=bionic - -set -e - -GREEN="\e[32m" -RED="\e[31m" -BLUE="\e[36m" -END_COLOR="\e[0m" - -function cleanup { - lxc delete test --force -} - -function on_err { - echo -e "${RED}Test Failed${END_COLOR}" - cleanup - exit 1 -} - -trap on_err ERR - -function print_and_run_cmd { - echo -e "${BLUE}Running:${END_COLOR}" "$@" - echo -e "${BLUE}Output:${END_COLOR}" - lxc exec test -- sh -c "$@" - echo -} - -function explanatory_message { - echo -e "${BLUE}$@${END_COLOR}" -} - -explanatory_message "Starting $series container and updating ubuntu-advantage-tools" -lxc launch ubuntu-daily:$series test >/dev/null 2>&1 -sleep 10 - -lxc exec test -- apt-get update >/dev/null -lxc exec test -- apt-get install -y ubuntu-advantage-tools locate >/dev/null -explanatory_message "installing xenial version of ubuntu-advantage-tools from local copy" -lxc file push $x_deb test/tmp/uax.deb > /dev/null -print_and_run_cmd "dpkg -i /tmp/uax.deb" -print_and_run_cmd "ua version" - -explanatory_message "Note where all cloud-id-shim artifacts are before upgrade" -print_and_run_cmd "updatedb" -print_and_run_cmd "locate ubuntu-advantage-cloud-id-shim" - -explanatory_message "installing bionic version of ubuntu-advantage-tools from local copy" -lxc file push $b_deb test/tmp/uab.deb > /dev/null -print_and_run_cmd "dpkg -i /tmp/uab.deb" -print_and_run_cmd "ua version" - -explanatory_message "cloud-id-shim artifacts should be gone" -print_and_run_cmd "updatedb" -print_and_run_cmd "locate ubuntu-advantage-cloud-id-shim || true" -result=$(lxc exec test -- locate ubuntu-advantage-cloud-id-shim || true) -test -z "$result" - -echo -e "${GREEN}Test Passed${END_COLOR}" -cleanup diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.9/cleanup_failed_old_license_check_timer.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.9/cleanup_failed_old_license_check_timer.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.9/cleanup_failed_old_license_check_timer.sh 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.9/cleanup_failed_old_license_check_timer.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -series=$1 -deb=$2 - -set -e - -GREEN="\e[32m" -RED="\e[31m" -BLUE="\e[36m" -END_COLOR="\e[0m" - -function cleanup { - lxc delete test --force -} - -function on_err { - echo -e "${RED}Test Failed${END_COLOR}" - cleanup - exit 1 -} - -trap on_err ERR - -function print_and_run_cmd { - echo -e "${BLUE}Running:${END_COLOR}" "$@" - echo -e "${BLUE}Output:${END_COLOR}" - lxc exec test -- sh -c "$@" - echo -} - -function explanatory_message { - echo -e "${BLUE}$@${END_COLOR}" -} - -explanatory_message "Starting $series container and updating ubuntu-advantage-tools" -lxc launch ubuntu-daily:$series test >/dev/null 2>&1 -sleep 10 - -lxc exec test -- apt-get update >/dev/null -lxc exec test -- apt-get install -y ubuntu-advantage-tools locate >/dev/null -print_and_run_cmd "ua version" -explanatory_message "Start the timer to make sure its state is fixed on upgrade" -print_and_run_cmd "systemctl start ua-license-check.timer" -print_and_run_cmd "systemctl status ua-license-check.timer" - -explanatory_message "installing new version of ubuntu-advantage-tools from local copy" -lxc file push $deb test/tmp/ua.deb > /dev/null -print_and_run_cmd "dpkg -i /tmp/ua.deb" -print_and_run_cmd "ua version" - -explanatory_message "systemd should not list the timer as failed" -print_and_run_cmd "systemctl status ua-license-check.timer || true" -print_and_run_cmd "systemctl --no-pager | grep ua-license-check || true" -result=$(lxc exec test -- sh -c "systemctl --no-pager | grep ua-license-check.timer" || true) -echo "$result" | grep -qv "ua-license-check.timer\s\+not-found\s\+failed" - -echo -e "${GREEN}Test Passed${END_COLOR}" -cleanup diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.9/gcp_auto_attach_long_poll.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.9/gcp_auto_attach_long_poll.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.9/gcp_auto_attach_long_poll.sh 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.9/gcp_auto_attach_long_poll.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -#!/bin/sh -ua_deb=$1 -ZONE="us-east1-b" -INSTANCE_NAME="test-auto-attach" -INSTANCE_TYPE="n1-standard-1" -DISK_NAME="persistent-disk-0" - -set -e - -GREEN="\e[32m" -RED="\e[31m" -BLUE="\e[36m" -END_COLOR="\e[0m" - -function cleanup { - gcloud compute ssh $INSTANCE_NAME -- "sudo ua detach --assume-yes || true" - gcloud compute instances delete $INSTANCE_NAME -} - -function on_err { - echo -e "${RED}Test Failed${END_COLOR}" - cleanup - exit 1 -} - -trap on_err ERR - -function print_and_run_cmd { - echo -e "${BLUE}Running:${END_COLOR}" "$@" - echo -e "${BLUE}Output:${END_COLOR}" - gcloud compute ssh $INSTANCE_NAME -- "sh -c \"$@\"" - echo -} - -function explanatory_message { - echo -e "${BLUE}$@${END_COLOR}" -} - -explanatory_message "Starting gcloud instance" -gcloud compute instances create $INSTANCE_NAME \ - --image="ubuntu-2004-focal-v20220404" \ - --image-project="ubuntu-os-cloud" \ - --machine-type=$INSTANCE_TYPE \ - --zone=$ZONE -sleep 60 - -explanatory_message "Installing new version of ubuntu-advantage-tools from local copy" -gcloud compute scp $ua_deb $INSTANCE_NAME:/tmp/ubuntu-advantage-tools.deb -gcloud compute ssh $INSTANCE_NAME -- "sudo apt update" -gcloud compute ssh $INSTANCE_NAME -- "sudo apt install ubuntu-advantage-tools -y" -print_and_run_cmd "sudo dpkg -i /tmp/ubuntu-advantage-tools.deb" - -explanatory_message "skip initial license check" -print_and_run_cmd "sudo sed -zi \\\"s/cloud.is_pro_license_present(\n wait_for_change=False\n )/False/\\\" /usr/lib/python3/dist-packages/uaclient/daemon.py" - -explanatory_message "turn on polling in config file" -print_and_run_cmd "sudo sh -c \\\"printf \\\\\\\" poll_for_pro_license: true\\\\\\\" >> /etc/ubuntu-advantage/uaclient.conf\\\"" - -explanatory_message "change won't happen while daemon is running, so set short timeout to simulate the long poll returning" -print_and_run_cmd "sudo sed -i \\\"s/wait_for_change=true/wait_for_change=true\&timeout_sec=5/\\\" /usr/lib/python3/dist-packages/uaclient/clouds/gcp.py" - -explanatory_message "Checking the status and logs beforehand" -print_and_run_cmd "sudo ua status --wait" -print_and_run_cmd "sudo cat /var/log/ubuntu-advantage-daemon.log" -gcloud compute ssh $INSTANCE_NAME -- "sudo truncate -s 0 /var/log/ubuntu-advantage-daemon.log" - -explanatory_message "Stopping the machine, adding license, restarting..." -gcloud compute instances stop $INSTANCE_NAME -gcloud beta compute disks update $INSTANCE_NAME --zone=$ZONE --update-user-licenses="https://www.googleapis.com/compute/v1/projects/ubuntu-os-pro-cloud/global/licenses/ubuntu-pro-2004-lts" -gcloud compute instances start $INSTANCE_NAME -sleep 60 - -explanatory_message "Now with the license, it will succeed auto_attaching" -print_and_run_cmd "sudo ua status --wait" -print_and_run_cmd "sudo cat /var/log/ubuntu-advantage-daemon.log" -result=$(gcloud compute ssh $INSTANCE_NAME -- "sudo ua status --format json") -echo $result | jq -r ".attached" | grep "true" - -echo -e "${GREEN}Test Passed${END_COLOR}" -cleanup diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.9/gcp_auto_attach_on_boot.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.9/gcp_auto_attach_on_boot.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.9/gcp_auto_attach_on_boot.sh 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.9/gcp_auto_attach_on_boot.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -#!/bin/sh -ua_deb=$1 -ZONE="us-east1-b" -INSTANCE_NAME="test-auto-attach" -INSTANCE_TYPE="n1-standard-1" -DISK_NAME="persistent-disk-0" - -set -e - -GREEN="\e[32m" -RED="\e[31m" -BLUE="\e[36m" -END_COLOR="\e[0m" - -function cleanup { - gcloud compute ssh $INSTANCE_NAME -- "sudo ua detach --assume-yes || true" - gcloud compute instances delete $INSTANCE_NAME -} - -function on_err { - echo -e "${RED}Test Failed${END_COLOR}" - cleanup - exit 1 -} - -trap on_err ERR - -function print_and_run_cmd { - echo -e "${BLUE}Running:${END_COLOR}" "$@" - echo -e "${BLUE}Output:${END_COLOR}" - gcloud compute ssh $INSTANCE_NAME -- "sh -c \"$@\"" - echo -} - -function explanatory_message { - echo -e "${BLUE}$@${END_COLOR}" -} - -explanatory_message "Starting gcloud instance" -gcloud compute instances create $INSTANCE_NAME \ - --image="ubuntu-2004-focal-v20220404" \ - --image-project="ubuntu-os-cloud" \ - --machine-type=$INSTANCE_TYPE \ - --zone=$ZONE -sleep 60 - - -explanatory_message "Installing new version of ubuntu-advantage-tools from local copy" -gcloud compute scp $ua_deb $INSTANCE_NAME:/tmp/ubuntu-advantage-tools.deb -gcloud compute ssh $INSTANCE_NAME -- "sudo apt update" -gcloud compute ssh $INSTANCE_NAME -- "sudo apt install ubuntu-advantage-tools jq -y" -print_and_run_cmd "sudo dpkg -i /tmp/ubuntu-advantage-tools.deb" - -explanatory_message "Checking the status and logs beforehand" -print_and_run_cmd "sudo ua status --wait" -print_and_run_cmd "sudo cat /var/log/ubuntu-advantage-daemon.log" -print_and_run_cmd "sudo truncate -s 0 /var/log/ubuntu-advantage-daemon.log" - -explanatory_message "Stopping the machine, adding license, restarting..." -gcloud compute instances stop $INSTANCE_NAME -gcloud beta compute disks update $INSTANCE_NAME --zone=$ZONE --update-user-licenses="https://www.googleapis.com/compute/v1/projects/ubuntu-os-pro-cloud/global/licenses/ubuntu-pro-2004-lts" -gcloud compute instances start $INSTANCE_NAME -sleep 30 - -explanatory_message "Now with the license, it will succeed auto_attaching on boot" -print_and_run_cmd "sudo ua status --wait" -print_and_run_cmd "sudo cat /var/log/ubuntu-advantage-daemon.log" -result=$(gcloud compute ssh $INSTANCE_NAME -- "sudo ua status --format json") -echo $result | jq -r ".attached" | grep "true" - -echo -e "${GREEN}Test Passed${END_COLOR}" -cleanup diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.9/remove_old_license_check_timer.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.9/remove_old_license_check_timer.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.9/remove_old_license_check_timer.sh 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.9/remove_old_license_check_timer.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -series=$1 -deb=$2 - -set -e - -GREEN="\e[32m" -RED="\e[31m" -BLUE="\e[36m" -END_COLOR="\e[0m" - -function cleanup { - lxc delete test --force -} - -function on_err { - echo -e "${RED}Test Failed${END_COLOR}" - cleanup - exit 1 -} - -trap on_err ERR - -function print_and_run_cmd { - echo -e "${BLUE}Running:${END_COLOR}" "$@" - echo -e "${BLUE}Output:${END_COLOR}" - lxc exec test -- sh -c "$@" - echo -} - -function explanatory_message { - echo -e "${BLUE}$@${END_COLOR}" -} - -explanatory_message "Starting $series container and updating ubuntu-advantage-tools" -lxc launch ubuntu-daily:$series test >/dev/null 2>&1 -sleep 10 - -lxc exec test -- apt-get update >/dev/null -lxc exec test -- apt-get install -y ubuntu-advantage-tools locate >/dev/null -print_and_run_cmd "ua version" -explanatory_message "Note where all license-check artifacts are before upgrade" -print_and_run_cmd "updatedb" -print_and_run_cmd "locate ua-license-check" - -explanatory_message "installing new version of ubuntu-advantage-tools from local copy" -lxc file push $deb test/tmp/ua.deb > /dev/null -print_and_run_cmd "dpkg -i /tmp/ua.deb" -print_and_run_cmd "ua version" - -explanatory_message "license-check artifacts should be gone" -print_and_run_cmd "updatedb" -print_and_run_cmd "locate ua-license-check || true" -result=$(lxc exec test -- locate ua-license-check || true) -test -z "$result" - -echo -e "${GREEN}Test Passed${END_COLOR}" -cleanup diff -Nru ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.9/remove_old_marker_file.sh ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.9/remove_old_marker_file.sh --- ubuntu-advantage-tools-27.9~18.04.1/sru/release-27.9/remove_old_marker_file.sh 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/sru/release-27.9/remove_old_marker_file.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -series=$1 -deb=$2 - -set -e - -GREEN="\e[32m" -RED="\e[31m" -BLUE="\e[36m" -END_COLOR="\e[0m" - -function cleanup { - lxc delete test --force -} - -function on_err { - echo -e "${RED}Test Failed${END_COLOR}" - cleanup - exit 1 -} - -trap on_err ERR - -function print_and_run_cmd { - echo -e "${BLUE}Running:${END_COLOR}" "$@" - echo -e "${BLUE}Output:${END_COLOR}" - lxc exec test -- sh -c "$@" - echo -} - -function explanatory_message { - echo -e "${BLUE}$@${END_COLOR}" -} - - -explanatory_message "Starting $series container and updating ubuntu-advantage-tools" -lxc launch ubuntu-daily:$series test >/dev/null 2>&1 -sleep 10 - -lxc exec test -- apt-get update >/dev/null -lxc exec test -- apt-get install -y ubuntu-advantage-tools >/dev/null -print_and_run_cmd "ua version" -explanatory_message "manually creating the marker file" -print_and_run_cmd "touch /var/lib/ubuntu-advantage/marker-license-check" -print_and_run_cmd "ls /var/lib/ubuntu-advantage" - -explanatory_message "installing new version of ubuntu-advantage-tools from local copy" -lxc file push $deb test/tmp/ua.deb > /dev/null -print_and_run_cmd "dpkg -i /tmp/ua.deb" -print_and_run_cmd "ua version" - - -explanatory_message "make sure the marker file is not longer there" -print_and_run_cmd "ls /var/lib/ubuntu-advantage" -result=$(lxc exec test -- ls /var/lib/ubuntu-advantage) -echo "$result" | grep -v marker-license-check - -echo -e "${GREEN}Test Passed${END_COLOR}" -cleanup diff -Nru ubuntu-advantage-tools-27.9~18.04.1/tools/base_travis_integration_tests.sh ubuntu-advantage-tools-27.10.1~18.04.1/tools/base_travis_integration_tests.sh --- ubuntu-advantage-tools-27.9~18.04.1/tools/base_travis_integration_tests.sh 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/tools/base_travis_integration_tests.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -#!/bin/bash -set -e - -UA_STAGING_PPA=ppa:ua-client/staging -UA_STAGING_PPA_KEYID=6E34E7116C0BC933 - -remove_lxd() { - sudo apt-get remove --yes --purge lxd lxd-client - sudo rm -Rf /var/lib/lxd -} - -copy_deb_packages() { - mkdir deb-artifacts - cp *-debs/* deb-artifacts -} - -create_pr_tar_file() { - cd $TRAVIS_BUILD_DIR/.. - tar -zcf pr_source.tar.gz ubuntu-advantage-client - cp pr_source.tar.gz /tmp - ls -lh /tmp - cd $TRAVIS_BUILD_DIR -} diff -Nru ubuntu-advantage-tools-27.9~18.04.1/tools/check-versions-are-consistent.py ubuntu-advantage-tools-27.10.1~18.04.1/tools/check-versions-are-consistent.py --- ubuntu-advantage-tools-27.9~18.04.1/tools/check-versions-are-consistent.py 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/tools/check-versions-are-consistent.py 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,26 @@ +import re +import subprocess +import sys + +sys.path.insert(0, ".") + +from uaclient.version import __VERSION__ + +python_version = __VERSION__ +changelog_version = ( + subprocess.check_output(["dpkg-parsechangelog", "-S", "version"]) + .decode("utf-8") + .strip() +) + +# remove tilde and suffix of changelog_version if present +base_changelog_version = changelog_version.split("~")[0] + +if python_version != base_changelog_version: + print( + 'version.py says "{}" but changelog says "{}"'.format( + python_version, changelog_version + ), + file=sys.stderr, + ) + sys.exit(1) diff -Nru ubuntu-advantage-tools-27.9~18.04.1/tools/constraints-bionic.txt ubuntu-advantage-tools-27.10.1~18.04.1/tools/constraints-bionic.txt --- ubuntu-advantage-tools-27.9~18.04.1/tools/constraints-bionic.txt 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/tools/constraints-bionic.txt 2022-07-12 18:09:51.000000000 +0000 @@ -2,7 +2,7 @@ flake8==3.5.0 py==1.5.2 pycodestyle==2.3.1 -pyflakes==2.2.0 +pyflakes==1.6.0 pytest==3.3.2 pytest-cov==2.5.1 pyyaml==3.12 diff -Nru ubuntu-advantage-tools-27.9~18.04.1/tools/constraints-focal.txt ubuntu-advantage-tools-27.10.1~18.04.1/tools/constraints-focal.txt --- ubuntu-advantage-tools-27.9~18.04.1/tools/constraints-focal.txt 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/tools/constraints-focal.txt 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,8 @@ +attrs==19.3 +flake8==3.7.9 +py==1.8.1 +pycodestyle==2.5.0 +pyflakes==2.1.1 +pytest==4.6.9 +pytest-cov==2.8.1 +pyyaml==5.3.1 \ No newline at end of file diff -Nru ubuntu-advantage-tools-27.9~18.04.1/tools/constraints-xenial.txt ubuntu-advantage-tools-27.10.1~18.04.1/tools/constraints-xenial.txt --- ubuntu-advantage-tools-27.9~18.04.1/tools/constraints-xenial.txt 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/tools/constraints-xenial.txt 2022-07-12 18:09:51.000000000 +0000 @@ -2,7 +2,9 @@ flake8==2.5.4 pep8==1.7.0 py==1.4.31 -pyflakes==2.2.0 +# Xenial ships pyflakes 1.1.0, but there is a dependency mismatch between the +# deb and the pip versions of flake8==2.5.4, which requires pyflakes. +pyflakes==1.0.0 pytest==2.8.7 pytest-cov==2.2.1 pyyaml==3.11 diff -Nru ubuntu-advantage-tools-27.9~18.04.1/tools/create-lp-release-branches.sh ubuntu-advantage-tools-27.10.1~18.04.1/tools/create-lp-release-branches.sh --- ubuntu-advantage-tools-27.9~18.04.1/tools/create-lp-release-branches.sh 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/tools/create-lp-release-branches.sh 2022-07-12 18:09:51.000000000 +0000 @@ -1,13 +1,18 @@ #!/usr/bin/bash -DRY_RUN_USAGE="usage: env DEVEL_RELEASE=impish UA_VERSION=27.3 SRU_BUG=1942929 LP_USER=username bash tools/create-lp-release-branches.sh" -DO_IT_USAGE="usage: env DO_IT=1 DEVEL_RELEASE=impish UA_VERSION=27.3 SRU_BUG=1942929 LP_USER=username bash tools/create-lp-release-branches.sh" +DRY_RUN_USAGE="usage: env DEVEL_RELEASE=kinetic RELEASES=\"xenial bionic focal impish jammy\" UA_VERSION=27.3 SRU_BUG=1942929 LP_USER=username bash tools/create-lp-release-branches.sh" +DO_IT_USAGE="usage: env DO_IT=1 DEVEL_RELEASE=kinetic RELEASES=\"xenial bionic focal impish jammy\" UA_VERSION=27.3 SRU_BUG=1942929 LP_USER=username bash tools/create-lp-release-branches.sh" if [ -z "$DEVEL_RELEASE" ]; then echo "please set DEVEL_RELEASE" echo "$DRY_RUN_USAGE" exit 1 fi +if [ -z "$RELEASES" ]; then + echo "please set RELEASES" + echo "$DRY_RUN_USAGE" + exit 1 +fi if [ -z "$UA_VERSION" ]; then echo "please set UA_VERSION" echo "$DRY_RUN_USAGE" @@ -32,7 +37,7 @@ set -e fi -for release in xenial bionic focal impish +for release in $RELEASES do echo echo $release @@ -49,8 +54,10 @@ bionic) version=${UA_VERSION}~18.04.1;; focal) version=${UA_VERSION}~20.04.1;; impish) version=${UA_VERSION}~21.10.1;; + jammy) version=${UA_VERSION}~22.04.1;; + kinetic) version=${UA_VERSION}~22.10.1;; esac - dch_cmd=(dch -v ${version} -D ${release} -b "Backport new upstream release: (LP: #${SRU_BUG}) to $release") + dch_cmd=(dch -v "${version}" -D "${release}" -b "Backport new upstream release: (LP: #${SRU_BUG}) to $release") if [ -z "$DO_IT" ]; then echo "${dch_cmd[@]}" else diff -Nru ubuntu-advantage-tools-27.9~18.04.1/tools/make-release ubuntu-advantage-tools-27.10.1~18.04.1/tools/make-release --- ubuntu-advantage-tools-27.9~18.04.1/tools/make-release 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/tools/make-release 2022-07-12 18:09:51.000000000 +0000 @@ -31,7 +31,7 @@ } -which build-package 2>&1 > /dev/null +which build-package > /dev/null 2>&1 if [ $? -ne 0 ]; then echo "Missing build-package script." echo "Install with 'git clone git@github.com:CanonicalLtd/uss-tableflip.git'" diff -Nru ubuntu-advantage-tools-27.9~18.04.1/tools/refresh-keyrings.sh ubuntu-advantage-tools-27.10.1~18.04.1/tools/refresh-keyrings.sh --- ubuntu-advantage-tools-27.9~18.04.1/tools/refresh-keyrings.sh 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/tools/refresh-keyrings.sh 2022-07-12 18:09:51.000000000 +0000 @@ -14,7 +14,7 @@ tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX) -if [ $# != 1 -o ! -d $1 ]; then +if [ $# != 1 ] || [ ! -d $1 ]; then echo "Usage: $0 " exit 1 fi @@ -32,25 +32,24 @@ generate_keyrings() { KEYRING_DIR="$1" shift - KEYS="$@" - + KEYS="$*" # Intentionally unquoted so GPG gets the keys as separate arguments for key in $KEYS; do case $key in - $EAL_KEY_ID) + "$EAL_KEY_ID") service_name="cc-eal";; - $ESM_INFRA_KEY_ID) + "$ESM_INFRA_KEY_ID") service_name="esm-infra-trusty";; - $ESM_APPS_KEY_ID) + "$ESM_APPS_KEY_ID") service_name="esm-apps";; - $FIPS_KEY_ID) + "$FIPS_KEY_ID") service_name="fips";; # Same FIPS key for any series - $CIS_KEY_ID) + "$CIS_KEY_ID") service_name="cis";; - $ROS_KEY_ID) + "$ROS_KEY_ID") service_name="ros";; - $REALTIME_KEY_ID) + "$REALTIME_KEY_ID") service_name="realtime-kernel";; *) echo "Unhandled key id provided: " $key diff -Nru ubuntu-advantage-tools-27.9~18.04.1/tools/run_aws_travis_integration_tests.sh ubuntu-advantage-tools-27.10.1~18.04.1/tools/run_aws_travis_integration_tests.sh --- ubuntu-advantage-tools-27.9~18.04.1/tools/run_aws_travis_integration_tests.sh 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/tools/run_aws_travis_integration_tests.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -#!/bin/bash -source tools/base_travis_integration_tests.sh - -copy_deb_packages - -if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then - BUILD_PR=0 - if [ "$TRAVIS_BRANCH" != "${TRAVIS_BRANCH/release-}" ]; then - # Run cron of release-XX branches against UA_STAGING_PPA - export UACLIENT_BEHAVE_PPA=${UA_STAGING_PPA} - export UACLIENT_BEHAVE_PPA_KEYID=${UA_STAGING_PPA_KEYID} - fi -else - create_pr_tar_file -fi - -UACLIENT_BEHAVE_BUILD_PR=${BUILD_PR} make test - -for key_name in `ls *pem`; do - K=${key_name/ec2-/}; - python3 server-test-scripts/ubuntu-advantage-client/ec2_cleanup.py -t ${K%.pem} || true -done; diff -Nru ubuntu-advantage-tools-27.9~18.04.1/tools/run_azure_travis_integration_tests.sh ubuntu-advantage-tools-27.10.1~18.04.1/tools/run_azure_travis_integration_tests.sh --- ubuntu-advantage-tools-27.9~18.04.1/tools/run_azure_travis_integration_tests.sh 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/tools/run_azure_travis_integration_tests.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -#!/bin/bash -source tools/base_travis_integration_tests.sh - -install_pycloudlib() { - git clone https://github.com/canonical/pycloudlib.git - cd pycloudlib - pip install -r requirements.txt - cd .. -} - -copy_deb_packages - -if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then - BUILD_PR=0 - if [ "$TRAVIS_BRANCH" != "${TRAVIS_BRANCH/release-}" ]; then - # Run cron of release-XX branches against UA_STAGING_PPA - export UACLIENT_BEHAVE_PPA=${UA_STAGING_PPA} - export UACLIENT_BEHAVE_PPA_KEYID=${UA_STAGING_PPA_KEYID} - fi -else - create_pr_tar_file -fi - -UACLIENT_BEHAVE_BUILD_PR=${BUILD_PR} make test - -install_pycloudlib -echo $TRAVIS_JOB_NUMBER -python3 server-test-scripts/ubuntu-advantage-client/azure_cleanup.py --suffix-tag ${TRAVIS_JOB_NUMBER/./-} --client-id ${UACLIENT_BEHAVE_AZ_CLIENT_ID} --client-secret ${UACLIENT_BEHAVE_AZ_CLIENT_SECRET} --subscription-id ${UACLIENT_BEHAVE_AZ_SUBSCRIPTION_ID} --tenant-id ${UACLIENT_BEHAVE_AZ_TENANT_ID} || true diff -Nru ubuntu-advantage-tools-27.9~18.04.1/tools/run_lxd_travis_integration_tests.sh ubuntu-advantage-tools-27.10.1~18.04.1/tools/run_lxd_travis_integration_tests.sh --- ubuntu-advantage-tools-27.9~18.04.1/tools/run_lxd_travis_integration_tests.sh 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/tools/run_lxd_travis_integration_tests.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -#!/bin/bash -source tools/base_travis_integration_tests.sh - -install_lxd() { - sudo snap install lxd - sudo lxd init --auto - sudo usermod -a -G lxd $USER -} - -copy_deb_packages - -if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then - BUILD_PR=0 - if [ "$TRAVIS_BRANCH" != "${TRAVIS_BRANCH/release-}" ]; then - # Run cron of release-XX branches against UA_STAGING_PPA - export UACLIENT_BEHAVE_PPA=${UA_STAGING_PPA} - export UACLIENT_BEHAVE_PPA_KEYID=${UA_STAGING_PPA_KEYID} - fi -else - create_pr_tar_file -fi - -# Because we are using dist:bionic for the travis host, we need -# to remove the lxd deb-installed package to avoid -# confusion over lxd versions -remove_lxd - -install_lxd -sg lxd -c "UACLIENT_BEHAVE_BUILD_PR=${BUILD_PR} make test" diff -Nru ubuntu-advantage-tools-27.9~18.04.1/tools/setup_pyenv.sh ubuntu-advantage-tools-27.10.1~18.04.1/tools/setup_pyenv.sh --- ubuntu-advantage-tools-27.9~18.04.1/tools/setup_pyenv.sh 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/tools/setup_pyenv.sh 2022-07-12 18:09:51.000000000 +0000 @@ -0,0 +1,30 @@ +#!/bin/bash + +set -e + +sudo apt-get update +sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \ +libreadline-dev libsqlite3-dev wget curl llvm libncursesw5-dev xz-utils \ +tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev clang + +curl http://pyenv.run | bash + +export PYENV_ROOT="$HOME/.pyenv" +command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" +eval "$(pyenv init -)" +eval "$(pyenv virtualenv-init -)" + +# gcc will segfault while compiling some python versions +export CC=clang + +pyenv install 3.10.4 +pyenv install 3.8.10 +pyenv install 3.6.9 +# Xenial has 3.5.2, which requires old libssl and is not worth it for the tests +pyenv install 3.5.3 + +pyenv local 3.10.4 3.8.10 3.6.9 3.5.3 + +python -m pip install tox +python -m pip install tox-setuptools-version +python -m pip install tox-pyenv diff -Nru ubuntu-advantage-tools-27.9~18.04.1/tox.ini ubuntu-advantage-tools-27.10.1~18.04.1/tox.ini --- ubuntu-advantage-tools-27.9~18.04.1/tox.ini 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/tox.ini 2022-07-12 18:09:51.000000000 +0000 @@ -1,40 +1,43 @@ [tox] -envlist = py3, flake8, py3-{xenial,bionic}, flake8-{xenial,bionic}, mypy, black, isort +envlist = {py35, py36, py38, py310}-{test, flake8}, mypy, black, isort, shellcheck -[testenv:flake8-bionic] -pip_version = 9.0.2 -setuptools_version = 59.8.0 - -[testenv:flake8-xenial] -pip_version = 9.0.2 -setuptools_version = 59.8.0 - -[testenv:py3-xenial] -pip_version = 9.0.2 -setuptools_version = 59.8.0 - -[testenv:py3-bionic] -pip_version = 9.0.2 -setuptools_version = 59.8.0 +[testenv:py35-flake8] +setuptools_version = 20.7.0 + +[testenv:py35-test] +setuptools_version = 20.7.0 + +[testenv:py36-flake8] +setuptools_version = 39.0.1 + +[testenv:py36-test] +setuptools_version = 39.0.1 + +[testenv:py38-flake8] +setuptools_version = 45.2.0 + +[testenv:py38-test] +setuptools_version = 45.2.0 [testenv] +allowlist_externals=/usr/bin/bash deps = -rrequirements.txt -rtest-requirements.txt - xenial: -ctools/constraints-xenial.txt - bionic: -ctools/constraints-bionic.txt + py35: -ctools/constraints-xenial.txt + py36: -ctools/constraints-bionic.txt + py38: -ctools/constraints-focal.txt mypy: -rtypes-requirements.txt mypy: -ctools/constraints-mypy.txt black: -rdev-requirements.txt isort: -rdev-requirements.txt behave: -rintegration-requirements.txt + shellcheck: -rdev-requirements.txt passenv = - GOOGLE_APPLICATION_CREDENTIALS PYCLOUDLIB_CONFIG + GCE_CREDENTIALS_PATH AZURE_CONFIG_DIR UACLIENT_BEHAVE_* - TRAVIS - TRAVIS_* https_proxy setenv = awsgeneric: UACLIENT_BEHAVE_MACHINE_TYPE = aws.generic @@ -49,14 +52,15 @@ vm: UACLIENT_BEHAVE_MACHINE_TYPE = lxd.vm docker: UACLIENT_BEHAVE_MACHINE_TYPE = lxd.vm commands = - py3: py.test --junitxml=pytest_results.xml {posargs:--cov uaclient uaclient} - flake8: flake8 uaclient lib setup.py - flake8-bionic: flake8 features - mypy: mypy --python-version 3.5 uaclient/ + test: py.test --junitxml=pytest_results.xml {posargs:--cov uaclient uaclient} + flake8: flake8 uaclient lib setup.py features + mypy: mypy --python-version 3.5 uaclient/ features/ lib/ mypy: mypy --python-version 3.6 uaclient/ features/ lib/ - mypy-focal: mypy --python-version 3.7 uaclient/ features/ lib/ + mypy: mypy --python-version 3.8 uaclient/ features/ lib/ + mypy: mypy --python-version 3.10 uaclient/ features/ lib/ black: black --check --diff uaclient/ features/ lib/ setup.py isort: isort --check --diff uaclient/ features/ lib/ setup.py + shellcheck: bash -O extglob -O nullglob -c "shellcheck -S warning tools/{*.sh,make-release,make-tarball} debian/*.{config,postinst,postrm,prerm} lib/*.sh sru/*.sh update-motd.d/*" behave-lxd-16.04: behave -v {posargs} --tags="uses.config.machine_type.lxd.container" --tags="series.xenial,series.lts,series.all" --tags="~upgrade" behave-lxd-18.04: behave -v {posargs} --tags="uses.config.machine_type.lxd.container" --tags="series.bionic,series.lts,series.all" --tags="~upgrade" @@ -85,6 +89,7 @@ behave-awspro-16.04: behave -v {posargs} --tags="uses.config.machine_type.aws.pro" --tags="series.xenial,series.lts,series.all" behave-awspro-18.04: behave -v {posargs} --tags="uses.config.machine_type.aws.pro" --tags="series.bionic,series.lts,series.all" behave-awspro-20.04: behave -v {posargs} --tags="uses.config.machine_type.aws.pro" --tags="series.focal,series.lts,series.all" + behave-awspro-22.04: behave -v {posargs} --tags="uses.config.machine_type.aws.pro" --tags="series.jammy,series.lts,series.all" behave-awspro-fips-16.04: behave -v {posargs} --tags="uses.config.machine_type.aws.pro.fips" --tags="series.xenial,series.lts,series.all" behave-awspro-fips-18.04: behave -v {posargs} --tags="uses.config.machine_type.aws.pro.fips" --tags="series.bionic,series.lts,series.all" @@ -98,6 +103,7 @@ behave-azurepro-16.04: behave -v {posargs} --tags="uses.config.machine_type.azure.pro" --tags="series.xenial,series.lts,series.all" behave-azurepro-18.04: behave -v {posargs} --tags="uses.config.machine_type.azure.pro" --tags="series.bionic,series.lts,series.all" behave-azurepro-20.04: behave -v {posargs} --tags="uses.config.machine_type.azure.pro" --tags="series.focal,series.lts,series.all" + behave-azurepro-22.04: behave -v {posargs} --tags="uses.config.machine_type.azure.pro" --tags="series.jammy,series.lts,series.all" behave-azurepro-fips-16.04: behave -v {posargs} --tags="uses.config.machine_type.azure.pro.fips" --tags="series.xenial,series.lts,series.all" behave-azurepro-fips-18.04: behave -v {posargs} --tags="uses.config.machine_type.azure.pro.fips" --tags="series.bionic,series.lts,series.all" @@ -112,6 +118,8 @@ behave-gcppro-16.04: behave -v {posargs} --tags="uses.config.machine_type.gcp.pro" --tags="series.xenial,series.lts,series.all" --tags="~upgrade" behave-gcppro-18.04: behave -v {posargs} --tags="uses.config.machine_type.gcp.pro" --tags="series.bionic,series.lts,series.all" --tags="~upgrade" behave-gcppro-20.04: behave -v {posargs} --tags="uses.config.machine_type.gcp.pro" --tags="series.focal,series.lts,series.all" --tags="~upgrade" + behave-gcppro-22.04: behave -v {posargs} --tags="uses.config.machine_type.gcp.pro" --tags="series.jammy,series.lts,series.all" --tags="~upgrade" + behave-gcppro-fips-18.04: behave -v {posargs} --tags="uses.config.machine_type.gcp.pro.fips" --tags="series.bionic,series.lts,series.all" --tags="~upgrade" behave-gcppro-fips-20.04: behave -v {posargs} --tags="uses.config.machine_type.gcp.pro.fips" --tags="series.focal,series.lts,series.all" --tags="~upgrade" diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/actions.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/actions.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/actions.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/actions.py 2022-07-12 18:09:51.000000000 +0000 @@ -1,5 +1,4 @@ import logging -import sys from typing import Optional # noqa: F401 from uaclient import ( @@ -40,7 +39,6 @@ update_apt_and_motd_messages(cfg) raise exc except exceptions.UserFacingError as exc: - event.info(exc.msg, file_type=sys.stderr) # Persist updated status in the event of partial attach ua_status.status(cfg=cfg) update_apt_and_motd_messages(cfg) diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/apt.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/apt.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/apt.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/apt.py 2022-07-12 18:09:51.000000000 +0000 @@ -4,6 +4,7 @@ import os import re import subprocess +import sys import tempfile from functools import lru_cache from typing import Dict, List, Optional @@ -355,7 +356,7 @@ [line for line in apt_auth.splitlines() if auth_prefix not in line] ) if not content: - os.unlink(apt_auth_file) + util.remove_file(apt_auth_file) else: util.write_file(apt_auth_file, content, mode=0o600) @@ -364,10 +365,10 @@ repo_filename: str, repo_url: str, keyring_file: str = None ) -> None: """Remove an authenticated apt repo and credentials to the system""" - util.del_file(repo_filename) + util.remove_file(repo_filename) if keyring_file: keyring_file = os.path.join(APT_KEYS_DIR, keyring_file) - util.del_file(keyring_file) + util.remove_file(keyring_file) remove_repo_from_apt_auth_file(repo_url) @@ -432,8 +433,7 @@ def remove_apt_list_files(repo_url, series): """Remove any apt list files present for this repo_url and series.""" for path in find_apt_list_files(repo_url, series): - if os.path.exists(path): - os.unlink(path) + util.remove_file(path) def clean_apt_files(*, _entitlements=None): @@ -455,14 +455,18 @@ continue repo_file = ent_cls.repo_list_file_tmpl.format(name=ent_cls.name) pref_file = ent_cls.repo_pref_file_tmpl.format(name=ent_cls.name) - if os.path.exists(repo_file): - logging.info("Removing apt source file: %s", repo_file) - os.unlink(repo_file) - + event.info( + "Removing apt source file: {}".format(repo_file), + file_type=sys.stderr, + ) + util.remove_file(repo_file) if os.path.exists(pref_file): - logging.info("Removing apt preferences file: %s", pref_file) - os.unlink(pref_file) + event.info( + "Removing apt preferences file: {}".format(pref_file), + file_type=sys.stderr, + ) + util.remove_file(pref_file) def get_installed_packages() -> List[str]: diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/cli.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/cli.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/cli.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/cli.py 2022-07-12 18:09:51.000000000 +0000 @@ -3,6 +3,7 @@ """Client to manage Ubuntu Advantage services on a machine.""" import argparse +import glob import json import logging import os @@ -15,7 +16,7 @@ import textwrap import time from functools import wraps -from typing import Dict, List, Optional, Tuple # noqa +from typing import List, Optional, Tuple # noqa import yaml @@ -43,8 +44,10 @@ CONFIG_FIELD_ENVVAR_ALLOWLIST, DEFAULT_CONFIG_FILE, DEFAULT_LOG_FORMAT, + DEFAULT_LOG_PREFIX, PRINT_WRAP_WIDTH, ) +from uaclient.entitlements import entitlements_disable_order from uaclient.entitlements.entitlement_status import ( ApplicationStatus, CanDisableFailure, @@ -422,6 +425,16 @@ " Format: CVE-yyyy-nnnn, CVE-yyyy-nnnnnnn or USN-nnnn-dd" ), ) + parser.add_argument( + "--dry-run", + action="store_true", + help=( + "If used, fix will not actually run but will display" + " everything that will happen on the machine during the" + " command." + ), + ) + return parser @@ -463,24 +476,30 @@ "Refresh existing Ubuntu Advantage contract and update services." ) parser.usage = USAGE_TMPL.format( - name=NAME, command="refresh [contract|config]" + name=NAME, command="refresh [contract|config|messages]" ) + parser._optionals.title = "Flags" + parser.formatter_class = argparse.RawDescriptionHelpFormatter + parser.description = textwrap.dedent( + """\ + Refresh three distinct UA related artifacts in the system: + + * contract: Update contract details from the server. + * config: Reload the config file. + * messages: Update APT and MOTD messages related to UA. + + You can individually target any of the three specific actions, + by passing it's target to nome to the command. If no `target` + is specified, all targets are refreshed. + """ + ) parser.add_argument( "target", choices=["contract", "config", "messages"], nargs="?", default=None, - help=( - "Target to refresh. `ua refresh contract` will update contract" - " details from the server and perform any updates necessary." - " `ua refresh config` will reload" - " /etc/ubuntu-advantage/uaclient.conf and perform any changes" - " necessary. `ua refresh messages` will refresh" - " the APT and MOTD messages associated with UA." - " `ua refresh` is the equivalent of `ua refresh" - " config && ua refresh contract && ua refresh motd`." - ), + help="Target to refresh.", ) return parser @@ -506,7 +525,11 @@ ).format(args.security_issue) raise exceptions.UserFacingError(msg) - fix_status = security.fix_security_issue_id(cfg, args.security_issue) + fix_status = security.fix_security_issue_id( + cfg=cfg, + issue_id=args.security_issue, + dry_run=args.dry_run, + ) return fix_status.value @@ -1179,7 +1202,11 @@ @return: 0 on success, 1 otherwise """ - return _detach(cfg, assume_yes=args.assume_yes) + ret = _detach(cfg, assume_yes=args.assume_yes) + if ret == 0: + daemon.start() + event.process_events() + return ret def _detach(cfg: config.UAConfig, assume_yes: bool) -> int: @@ -1193,7 +1220,12 @@ @return: 0 on success, 1 otherwise """ to_disable = [] - for ent_cls in entitlements.ENTITLEMENT_CLASSES: + for ent_name in entitlements_disable_order(cfg): + try: + ent_cls = entitlements.entitlement_factory(cfg=cfg, name=ent_name) + except exceptions.EntitlementNotFoundError: + continue + ent = ent_cls(cfg=cfg, assume_yes=assume_yes) # For detach, we should not consider that a service # cannot be disabled because of dependent services, @@ -1202,23 +1234,6 @@ if ret: to_disable.append(ent) - """ - We will make sure that services without dependencies are disabled first - PS: This will only work because we have only three services with reverse - dependencies: - * ros: ros-updates - * esm-infra: ros, ros-updates - * esm-apps: ros, ros-updates - - Therefore, this logic will guarantee that we will always disable ros and - ros-updates before diabling the esm services. If that dependency chain - change, this logic won't hold anymore and must be properly fixed. - - More details can be seen here: - https://github.com/canonical/ubuntu-advantage-client/issues/1831 - """ - to_disable.sort(key=lambda ent: len(ent.dependent_services)) - if to_disable: suffix = "s" if len(to_disable) > 1 else "" event.info( @@ -1232,10 +1247,8 @@ _perform_disable(ent, cfg, assume_yes=assume_yes, update_status=False) cfg.delete_cache() - daemon.start() update_apt_and_motd_messages(cfg) event.info(messages.DETACH_SUCCESS) - event.process_events() return 0 @@ -1320,9 +1333,7 @@ try: actions.auto_attach(cfg, instance) except exceptions.UrlError: - event.info(messages.ATTACH_FAILURE) - return 1 - except exceptions.UserFacingError: + event.info(messages.ATTACH_FAILURE.msg) return 1 else: _post_cli_attach(cfg) @@ -1457,7 +1468,8 @@ return_codes=[0, 3], ) - ua_logs = ( + # include cfg log files here because they could be set to non default + state_files = [ cfg.cfg_path or DEFAULT_CONFIG_FILE, cfg.log_file, cfg.timer_log_file, @@ -1469,14 +1481,15 @@ for entitlement in entitlements.ENTITLEMENT_CLASSES if issubclass(entitlement, entitlements.repo.RepoEntitlement) ), - ) + ] - for log in ua_logs: - if os.path.isfile(log): - log_content = util.load_file(log) + # also get default logrotated log files + for f in state_files + glob.glob(DEFAULT_LOG_PREFIX + "*"): + if os.path.isfile(f): + log_content = util.load_file(f) log_content = util.redact_sensitive_logs(log_content) - util.write_file(log, log_content) - shutil.copy(log, output_dir) + util.write_file(f, log_content) + shutil.copy(f, output_dir) with tarfile.open(output_file, "w:gz") as results: results.add(output_dir, arcname="logs/") @@ -1499,7 +1512,7 @@ parser.add_argument( "--version", action="version", - version=get_version(), + version=version.get_version(), help="show version of {}".format(NAME), ) parser._optionals.title = "Flags" @@ -1630,15 +1643,8 @@ return ret -def get_version(_args=None, _cfg=None): - if _cfg is None: - _cfg = config.UAConfig() - - return version.get_version(features=_cfg.features) - - def print_version(_args=None, cfg=None): - print(get_version(_args, cfg)) + print(version.get_version()) def _action_refresh_config(args, cfg: config.UAConfig): diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/clouds/gcp.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/clouds/gcp.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/clouds/gcp.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/clouds/gcp.py 2022-07-12 18:09:51.000000000 +0000 @@ -5,7 +5,7 @@ from typing import Any, Dict, List, Optional # noqa: F401 from urllib.error import HTTPError -from uaclient import exceptions, util +from uaclient import exceptions, messages, util from uaclient.clouds import AutoAttachCloudInstance LOG = logging.getLogger("ua.clouds.gcp") @@ -42,11 +42,33 @@ # mypy does not handle @property around inner decorators # https://github.com/python/mypy/issues/1362 @property # type: ignore - @util.retry(HTTPError, retry_sleeps=[1, 2, 5]) + @util.retry(exceptions.GCPProAccountError, retry_sleeps=[1, 2, 5]) def identity_doc(self) -> Dict[str, Any]: - url_response, _headers = util.readurl( - TOKEN_URL, headers={"Metadata-Flavor": "Google"} - ) + try: + headers = {"Metadata-Flavor": "Google"} + url_response, _headers = util.readurl(TOKEN_URL, headers=headers) + except HTTPError as e: + body = getattr(e, "body", None) + error_desc = None + if body: + try: + error_details = json.loads( + body, cls=util.DatetimeAwareJSONDecoder + ) + except ValueError: + error_details = None + if error_details: + error_desc = error_details.get("error_description", None) + msg = error_desc if error_desc else e.reason + msg_code = None + if error_desc and "service account" in error_desc.lower(): + msg = messages.GCP_SERVICE_ACCT_NOT_ENABLED_ERROR.msg.format( + error_msg=msg + ) + msg_code = messages.GCP_SERVICE_ACCT_NOT_ENABLED_ERROR.name + raise exceptions.GCPProAccountError( + msg=msg, msg_code=msg_code, code=getattr(e, "code", 0) + ) return {"identityToken": url_response} @property diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/clouds/tests/test_gcp.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/clouds/tests/test_gcp.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/clouds/tests/test_gcp.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/clouds/tests/test_gcp.py 2022-07-12 18:09:51.000000000 +0000 @@ -12,6 +12,7 @@ WAIT_FOR_CHANGE, UAAutoAttachGCPInstance, ) +from uaclient.exceptions import GCPProAccountError M_PATH = "uaclient.clouds.gcp." @@ -57,7 +58,7 @@ instance = UAAutoAttachGCPInstance() if exception: - with pytest.raises(HTTPError) as excinfo: + with pytest.raises(GCPProAccountError) as excinfo: instance.identity_doc assert 704 == excinfo.value.code else: @@ -69,9 +70,12 @@ assert expected_sleep_calls == sleep.call_args_list expected_logs = [ - "HTTP Error 701: funky error msg Retrying 3 more times.", - "HTTP Error 702: funky error msg Retrying 2 more times.", - "HTTP Error 703: funky error msg Retrying 1 more times.", + "GCPProServiceAccount Error 701: " + + "funky error msg Retrying 3 more times.", + "GCPProServiceAccount Error 702: " + + "funky error msg Retrying 2 more times.", + "GCPProServiceAccount Error 703: " + + "funky error msg Retrying 1 more times.", ] logs = caplog_text() for log in expected_logs: diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/config.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/config.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/config.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/config.py 2022-07-12 18:09:51.000000000 +0000 @@ -317,7 +317,7 @@ lock_pid, lock_holder, ) - os.unlink(lock_path) + util.remove_file(lock_path) return no_lock @property @@ -569,8 +569,7 @@ (This is a separate method to allow easier disabling of deletion during tests.) """ - if os.path.exists(cache_path): - os.unlink(cache_path) + util.remove_file(cache_path) def delete_cache_key(self, key: str) -> None: """Remove specific cache file.""" diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/conftest.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/conftest.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/conftest.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/conftest.py 2022-07-12 18:09:51.000000000 +0000 @@ -107,6 +107,7 @@ cls, account_name: str = "test_account", machine_token: Dict[str, Any] = None, + status_cache: Dict[str, Any] = None, ): if not machine_token: machine_token = { @@ -133,8 +134,13 @@ }, }, } + + if not status_cache: + status_cache = {"attached": True} + config = cls() config.write_cache("machine-token", machine_token) + config.write_cache("status-cache", status_cache) return config def override_features(self, features_override): diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/contract.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/contract.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/contract.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/contract.py 2022-07-12 18:09:51.000000000 +0000 @@ -61,14 +61,8 @@ def request_resources(self) -> Dict[str, Any]: """Requests list of entitlements available to this machine type.""" - platform = util.get_platform_info() - query_params = { - "architecture": platform["arch"], - "series": platform["series"], - "kernel": platform["kernel"], - } resource_response, headers = self.request_url( - API_V1_RESOURCES, query_params=query_params + API_V1_RESOURCES, query_params=self._get_platform_basic_info() ) return resource_response @@ -198,10 +192,14 @@ headers = self.headers() headers.update({"Authorization": "Bearer {}".format(machine_token)}) url = API_V1_TMPL_CONTEXT_MACHINE_TOKEN_RESOURCE.format( - contract=contract_id, machine=machine_id + contract=contract_id, + machine=machine_id, ) response, headers = self.request_url( - url, method="GET", headers=headers + url, + method="GET", + headers=headers, + query_params=self._get_platform_basic_info(), ) if headers.get("expires"): response["expires"] = headers["expires"] @@ -264,6 +262,15 @@ "os": platform_os, } + def _get_platform_basic_info(self): + """Return a dict of platform basic info for some contract requests""" + platform = util.get_platform_info() + return { + "architecture": platform["arch"], + "series": platform["series"], + "kernel": platform["kernel"], + } + def _get_activity_info(self, machine_id: Optional[str] = None): """Return a dict of activity info data for contract requests""" from uaclient.entitlements import ENTITLEMENT_CLASSES @@ -309,9 +316,19 @@ :param series_overrides: Boolean set True if series overrides should be applied to the new_access dict. """ + from uaclient.entitlements import entitlements_enable_order + delta_error = False unexpected_error = False - for name, new_entitlement in sorted(new_entitlements.items()): + + # We need to sort our entitlements because some of them + # depend on other service to be enable first. + for name in entitlements_enable_order(cfg): + try: + new_entitlement = new_entitlements[name] + except KeyError: + continue + try: deltas, service_enabled = process_entitlement_delta( cfg=cfg, @@ -320,8 +337,6 @@ allow_enable=allow_enable, series_overrides=series_overrides, ) - except exceptions.EntitlementNotFoundError: - continue except exceptions.UserFacingError: delta_error = True event.service_failed(name) diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/daemon.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/daemon.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/daemon.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/daemon.py 2022-07-12 18:09:51.000000000 +0000 @@ -1,5 +1,6 @@ import logging import time +from subprocess import TimeoutExpired from uaclient import actions, exceptions, lock, messages, util from uaclient.clouds import AutoAttachCloudInstance @@ -12,15 +13,19 @@ def start(): try: - util.subp(["systemctl", "start", "ubuntu-advantage.service"]) - except exceptions.ProcessExecutionError as e: + util.subp( + ["systemctl", "start", "ubuntu-advantage.service"], timeout=2.0 + ) + except (exceptions.ProcessExecutionError, TimeoutExpired) as e: LOG.warning(e) def stop(): try: - util.subp(["systemctl", "stop", "ubuntu-advantage.service"]) - except exceptions.ProcessExecutionError as e: + util.subp( + ["systemctl", "stop", "ubuntu-advantage.service"], timeout=2.0 + ) + except (exceptions.ProcessExecutionError, TimeoutExpired) as e: LOG.warning(e) diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/data_types.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/data_types.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/data_types.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/data_types.py 2022-07-12 18:09:51.000000000 +0000 @@ -1,9 +1,10 @@ -from typing import Any, List, Optional, Type, TypeVar +import json +from typing import Any, List, Optional, Type, TypeVar, Union from uaclient import exceptions INCORRECT_TYPE_ERROR_MESSAGE = ( - "Expected value with type {type} but got value: {value}" + "Expected value with type {expected_type} but got type: {got_type}" ) INCORRECT_LIST_ELEMENT_TYPE_ERROR_MESSAGE = ( "Got value with incorrect type at index {index}: {nested_msg}" @@ -14,10 +15,10 @@ class IncorrectTypeError(exceptions.UserFacingError): - def __init__(self, expected_type: str, got_value: Any): + def __init__(self, expected_type: str, got_type: str): super().__init__( INCORRECT_TYPE_ERROR_MESSAGE.format( - type=expected_type, value=repr(got_value) + expected_type=expected_type, got_type=got_type ) ) @@ -58,7 +59,7 @@ @staticmethod def from_value(val: Any) -> str: if not isinstance(val, str): - raise IncorrectTypeError("string", val) + raise IncorrectTypeError("str", type(val).__name__) return val @@ -72,7 +73,7 @@ @staticmethod def from_value(val: Any) -> int: if not isinstance(val, int) or isinstance(val, bool): - raise IncorrectTypeError("int", val) + raise IncorrectTypeError("int", type(val).__name__) return val @@ -86,7 +87,7 @@ @staticmethod def from_value(val: Any) -> bool: if not isinstance(val, bool): - raise IncorrectTypeError("bool", val) + raise IncorrectTypeError("bool", type(val).__name__) return val @@ -101,17 +102,32 @@ @staticmethod def from_value(val: Any) -> List: if not isinstance(val, list): - raise IncorrectTypeError("list", val) + raise IncorrectTypeError("list", type(val).__name__) + new_val = [] for i, item in enumerate(val): try: - val[i] = data_cls.from_value(item) + new_val.append(data_cls.from_value(item)) except IncorrectTypeError as e: raise IncorrectListElementTypeError(e, i) - return val + return new_val return _DataList +def data_list_to_list( + val: List[Union["DataObject", list, str, int, bool]] +) -> list: + new_val = [] # type: list + for item in val: + if isinstance(item, DataObject): + new_val.append(item.to_dict()) + elif isinstance(item, list): + new_val.append(data_list_to_list(item)) + else: + new_val.append(item) + return new_val + + class Field: """ For defining the fields static property of a DataObject. @@ -151,6 +167,27 @@ def __init__(self, **_kwargs): pass + def to_dict(self, keep_none: bool = True) -> dict: + d = {} + for field in self.fields: + val = getattr(self, field.key, None) + new_val = None # type: Any + + if isinstance(val, DataObject): + new_val = val.to_dict() + elif isinstance(val, list): + new_val = data_list_to_list(val) + else: + # simple type, just copy + new_val = val + + if new_val is not None or keep_none: + d[field.key] = new_val + return d + + def to_json(self, keep_null: bool = True) -> str: + return json.dumps(self.to_dict(keep_none=keep_null), sort_keys=True) + @classmethod def from_dict(cls: Type[T], d: dict) -> T: kwargs = {} @@ -160,7 +197,7 @@ except KeyError: if field.required: raise IncorrectFieldTypeError( - IncorrectTypeError(field.data_cls.__name__, None), + IncorrectTypeError(field.data_cls.__name__, "null"), field.key, ) else: @@ -176,7 +213,7 @@ @classmethod def from_value(cls, val: Any): if not isinstance(val, dict): - raise IncorrectTypeError("dict", val) + raise IncorrectTypeError("dict", type(val).__name__) return cls.from_dict(val) diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/defaults.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/defaults.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/defaults.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/defaults.py 2022-07-12 18:09:51.000000000 +0000 @@ -24,6 +24,9 @@ CONTRACT_EXPIRY_GRACE_PERIOD_DAYS = 14 CONTRACT_EXPIRY_PENDING_DAYS = 20 ATTACH_FAIL_DATE_FORMAT = "%B %d, %Y" +DEFAULT_LOG_DIR = "/var/log" +DEFAULT_LOG_FILE_BASE_NAME = "ubuntu-advantage" +DEFAULT_LOG_PREFIX = DEFAULT_LOG_DIR + "/" + DEFAULT_LOG_FILE_BASE_NAME DEFAULT_LOG_FORMAT = ( "%(asctime)s - %(filename)s:(%(lineno)d) [%(levelname)s]: %(message)s" ) diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/base.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/base.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/base.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/base.py 2022-07-12 18:09:51.000000000 +0000 @@ -8,7 +8,7 @@ import yaml -from uaclient import config, contract, event_logger, exceptions, messages, util +from uaclient import config, contract, event_logger, messages, util from uaclient.defaults import DEFAULT_HELP_FILE from uaclient.entitlements.entitlement_status import ( ApplicabilityStatus, @@ -59,10 +59,10 @@ _incompatible_services = () # type: Tuple[IncompatibleService, ...] # List of services that must be active before enabling this service - _required_services = () # type: Tuple[str, ...] + _required_services = () # type: Tuple[Type[UAEntitlement], ...] # List of services that depend on this service - _dependent_services = () # type: Tuple[str, ...] + _dependent_services = () # type: Tuple[Type[UAEntitlement], ...] @property @abc.abstractmethod @@ -132,7 +132,7 @@ return self._incompatible_services @property - def required_services(self) -> Tuple[str, ...]: + def required_services(self) -> Tuple[Type["UAEntitlement"], ...]: """ Return a list of packages that must be active before enabling this service. When we are enabling the entitlement we can directly ask @@ -142,7 +142,7 @@ return self._required_services @property - def dependent_services(self) -> Tuple[str, ...]: + def dependent_services(self) -> Tuple[Type["UAEntitlement"], ...]: """ Return a list of packages that depend on this service. We will use that list during disable operations, where @@ -353,23 +353,6 @@ return (True, None) - def _check_any_service_is_active(self, services: Tuple[str, ...]) -> bool: - from uaclient.entitlements import ( - EntitlementNotFoundError, - entitlement_factory, - ) - - for service in services: - try: - ent_cls = entitlement_factory(cfg=self.cfg, name=service) - except EntitlementNotFoundError: - continue - ent_status, _ = ent_cls(self.cfg).application_status() - if ent_status == ApplicationStatus.ENABLED: - return True - - return False - def detect_dependent_services(self) -> bool: """ Check for depedent services. @@ -378,9 +361,14 @@ True if there are dependent services enabled False if there are no dependent services enabled """ - return self._check_any_service_is_active( - services=self.dependent_services - ) + for dependent_service_cls in self.dependent_services: + ent_status, _ = dependent_service_cls( + self.cfg + ).application_status() + if ent_status == ApplicationStatus.ENABLED: + return True + + return False def check_required_services_active(self): """ @@ -390,18 +378,10 @@ True if all required services are active False is at least one of the required services is disabled """ - from uaclient.entitlements import entitlement_factory - - for required_service in self.required_services: - try: - ent_cls = entitlement_factory( - cfg=self.cfg, name=required_service - ) - ent_status, _ = ent_cls(self.cfg).application_status() - if ent_status != ApplicationStatus.ENABLED: - return False - except exceptions.EntitlementNotFoundError: - pass + for required_service_cls in self.required_services: + ent_status, _ = required_service_cls(self.cfg).application_status() + if ent_status != ApplicationStatus.ENABLED: + return False return True @@ -490,20 +470,8 @@ that must be enabled first. In that situation, we can ask the user if the required service should be enabled before proceeding. """ - from uaclient.entitlements import entitlement_factory - - for required_service in self.required_services: - try: - ent_cls = entitlement_factory( - cfg=self.cfg, name=required_service - ) - except exceptions.EntitlementNotFoundError: - msg = messages.REQUIRED_SERVICE_NOT_FOUND.format( - service=required_service - ) - return False, msg - - ent = ent_cls(self.cfg, allow_beta=True) + for required_service_cls in self.required_services: + ent = required_service_cls(self.cfg, allow_beta=True) is_service_disabled = ( ent.application_status()[0] == ApplicationStatus.DISABLED @@ -529,7 +497,7 @@ ret, fail = ent.enable(silent=True) if not ret: error_msg = "" - if fail.message and fail.message.msg: + if fail and fail.message and fail.message.msg: error_msg = "\n" + fail.message.msg msg = messages.ERROR_ENABLING_REQUIRED_SERVICE.format( @@ -659,21 +627,8 @@ @param silent: Boolean set True to silence print/log of messages """ - from uaclient.entitlements import entitlement_factory - - for dependent_service in self.dependent_services: - try: - ent_cls = entitlement_factory( - cfg=self.cfg, name=dependent_service - ) - except exceptions.EntitlementNotFoundError: - msg = messages.DEPENDENT_SERVICE_NOT_FOUND.format( - service=dependent_service - ) - event.info(info_msg=msg.msg, file_type=sys.stderr) - return False, msg - - ent = ent_cls(cfg=self.cfg, assume_yes=True) + for dependent_service_cls in self.dependent_services: + ent = dependent_service_cls(cfg=self.cfg, assume_yes=True) is_service_enabled = ( ent.application_status()[0] == ApplicationStatus.ENABLED @@ -705,7 +660,7 @@ ret, fail = ent.disable(silent=True) if not ret: error_msg = "" - if fail.message and fail.message.msg: + if fail and fail.message and fail.message.msg: error_msg = "\n" + fail.message.msg msg = messages.FAILED_DISABLING_DEPENDENT_SERVICE.format( diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/esm.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/esm.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/esm.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/esm.py 2022-07-12 18:09:51.000000000 +0000 @@ -1,14 +1,23 @@ -from typing import Optional, Tuple, Union # noqa: F401 +from typing import Optional, Tuple, Type, Union # noqa: F401 from uaclient import util from uaclient.entitlements import repo +from uaclient.entitlements.base import UAEntitlement from uaclient.entitlements.entitlement_status import CanDisableFailure from uaclient.jobs.update_messaging import update_apt_and_motd_messages class ESMBaseEntitlement(repo.RepoEntitlement): help_doc_url = "https://ubuntu.com/security/esm" - _dependent_services = ("ros", "ros-updates") # type: Tuple[str, ...] + + @property + def dependent_services(self) -> Tuple[Type[UAEntitlement], ...]: + from uaclient.entitlements.ros import ( + ROSEntitlement, + ROSUpdatesEntitlement, + ) + + return (ROSEntitlement, ROSUpdatesEntitlement) def _perform_enable(self, silent: bool = False) -> bool: enable_performed = super()._perform_enable(silent=silent) diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/fips.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/fips.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/fips.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/fips.py 2022-07-12 18:09:51.000000000 +0000 @@ -311,9 +311,14 @@ return super_status, super_msg if os.path.exists(self.FIPS_PROC_FILE): - self.cfg.remove_notice( - "", messages.FIPS_SYSTEM_REBOOT_REQUIRED.msg - ) + + # We are now only removing the notice if there is no reboot + # required information regarding the fips metapackage we install. + if not util.should_reboot(set(self.packages)): + self.cfg.remove_notice( + "", messages.FIPS_SYSTEM_REBOOT_REQUIRED.msg + ) + self.cfg.remove_notice("", messages.FIPS_REBOOT_REQUIRED_MSG) if util.load_file(self.FIPS_PROC_FILE).strip() == "1": self.cfg.remove_notice( @@ -559,6 +564,7 @@ def _perform_enable(self, silent: bool = False) -> bool: if super()._perform_enable(silent=silent): + self.cfg.remove_notice("", messages.FIPS_DISABLE_REBOOT_REQUIRED) services_once_enabled = ( self.cfg.read_cache("services-once-enabled") or {} ) diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/__init__.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/__init__.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/__init__.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/__init__.py 2022-07-12 18:09:51.000000000 +0000 @@ -1,4 +1,5 @@ -from typing import List, Type # noqa: F401 +import enum +from typing import Dict, List, Type # noqa: F401 from uaclient.config import UAConfig from uaclient.entitlements import fips @@ -78,3 +79,68 @@ for entitlement in entitlements ] ) + + +@enum.unique +class SortOrder(enum.Enum): + REQUIRED_SERVICES = object() + DEPENDENT_SERVICES = object() + + +def entitlements_disable_order(cfg: UAConfig) -> List[str]: + """ + Return the entitlements disable order based on dependent services logic. + """ + return _sort_entitlements(cfg=cfg, sort_order=SortOrder.DEPENDENT_SERVICES) + + +def entitlements_enable_order(cfg: UAConfig) -> List[str]: + """ + Return the entitlements enable order based on required services logic. + """ + return _sort_entitlements(cfg=cfg, sort_order=SortOrder.REQUIRED_SERVICES) + + +def _sort_entitlements_visit( + cfg: UAConfig, + ent_cls: Type[UAEntitlement], + sort_order: SortOrder, + visited: Dict[str, bool], + order: List[str], +): + if ent_cls.name in visited: + return + + if sort_order == SortOrder.REQUIRED_SERVICES: + cls_list = ent_cls(cfg).required_services + else: + cls_list = ent_cls(cfg).dependent_services + + for cls_dependency in cls_list: + if ent_cls.name not in visited: + _sort_entitlements_visit( + cfg=cfg, + ent_cls=cls_dependency, + sort_order=sort_order, + visited=visited, + order=order, + ) + + order.append(str(ent_cls.name)) + visited[str(ent_cls.name)] = True + + +def _sort_entitlements(cfg: UAConfig, sort_order: SortOrder) -> List[str]: + order = [] # type: List[str] + visited = {} # type: Dict[str, bool] + + for ent_cls in ENTITLEMENT_CLASSES: + _sort_entitlements_visit( + cfg=cfg, + ent_cls=ent_cls, + sort_order=sort_order, + visited=visited, + order=order, + ) + + return order diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/repo.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/repo.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/repo.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/repo.py 2022-07-12 18:09:51.000000000 +0000 @@ -352,8 +352,9 @@ self.origin, self.repo_pin_priority, ) - elif os.path.exists(repo_pref_file): - os.unlink(repo_pref_file) # Remove disabling apt pref file + else: + # Remove disabling apt pref file + util.remove_file(repo_pref_file) prerequisite_pkgs = [] if not os.path.exists(apt.APT_METHOD_HTTPS_FILE): @@ -424,8 +425,8 @@ self.origin, self.repo_pin_priority, ) - elif os.path.exists(repo_pref_file): - os.unlink(repo_pref_file) + else: + util.remove_file(repo_pref_file) if run_apt_update: if not silent: diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/ros.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/ros.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/ros.py 2022-04-01 13:27:49.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/ros.py 2022-07-12 18:09:51.000000000 +0000 @@ -1,6 +1,7 @@ -from typing import Tuple # noqa: F401 +from typing import Tuple, Type # noqa: F401 from uaclient.entitlements import repo +from uaclient.entitlements.base import UAEntitlement class ROSCommonEntitlement(repo.RepoEntitlement): @@ -13,16 +14,38 @@ name = "ros" title = "ROS ESM Security Updates" description = "Security Updates for the Robot Operating System" - _required_services = ("esm-infra", "esm-apps") # type: Tuple[str, ...] - _dependent_services = ("ros-updates",) # type: Tuple[str, ...] + + @property + def required_services(self) -> Tuple[Type[UAEntitlement], ...]: + from uaclient.entitlements.esm import ( + ESMAppsEntitlement, + ESMInfraEntitlement, + ) + + return ( + ESMInfraEntitlement, + ESMAppsEntitlement, + ) + + @property + def dependent_services(self) -> Tuple[Type[UAEntitlement], ...]: + return (ROSUpdatesEntitlement,) class ROSUpdatesEntitlement(ROSCommonEntitlement): name = "ros-updates" title = "ROS ESM All Updates" description = "All Updates for the Robot Operating System" - _required_services = ( - "esm-infra", - "esm-apps", - "ros", - ) # type: Tuple[str, ...] + + @property + def required_services(self) -> Tuple[Type[UAEntitlement], ...]: + from uaclient.entitlements.esm import ( + ESMAppsEntitlement, + ESMInfraEntitlement, + ) + + return ( + ESMInfraEntitlement, + ESMAppsEntitlement, + ROSEntitlement, + ) diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/tests/test_base.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/tests/test_base.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/tests/test_base.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/tests/test_base.py 2022-07-12 18:09:51.000000000 +0000 @@ -1,12 +1,12 @@ """Tests related to uaclient.entitlement.base module.""" import logging -from typing import Dict, Optional, Tuple +from typing import Any, Dict, Optional, Tuple import mock import pytest from uaclient import config, messages, util -from uaclient.entitlements import EntitlementNotFoundError, base +from uaclient.entitlements import base from uaclient.entitlements.entitlement_status import ( ApplicabilityStatus, ApplicationStatus, @@ -34,6 +34,7 @@ application_status=None, allow_beta=False, dependent_services=None, + required_services=None, blocking_incompatible_services=None, **kwargs ): @@ -42,7 +43,8 @@ self._enable = enable self._applicability_status = applicability_status self._application_status = application_status - self._dependent_services = (dependent_services,) + self._dependent_services = dependent_services + self._required_services = required_services self._blocking_incompatible_services = blocking_incompatible_services def _perform_disable(self, **kwargs): @@ -79,7 +81,8 @@ allow_beta: bool = False, enable: bool = False, disable: bool = False, - dependent_services: Tuple[str, ...] = None + dependent_services: Tuple[Any, ...] = None, + required_services: Tuple[Any, ...] = None ) -> ConcreteTestEntitlement: cfg = config.UAConfig(cfg={"data_dir": tmpdir.strpath}) machineToken = { @@ -108,6 +111,7 @@ enable=enable, disable=disable, dependent_services=dependent_services, + required_services=required_services, ) return factory @@ -154,24 +158,23 @@ ) assert expected_msg == fail.message.msg - @mock.patch("uaclient.entitlements.entitlement_factory") def test_can_disable_false_on_dependent_service( - self, m_ent_factory, concrete_entitlement_factory + self, concrete_entitlement_factory ): """When status is INACTIVE, can_disable returns False.""" - entitlement = concrete_entitlement_factory( - entitled=True, - application_status=(ApplicationStatus.ENABLED, ""), - dependent_services=("test",), - ) - m_ent_cls = mock.Mock() + type(m_ent_cls).name = mock.PropertyMock(return_value="test") m_ent_obj = m_ent_cls.return_value m_ent_obj.application_status.return_value = ( ApplicationStatus.ENABLED, None, ) - m_ent_factory.return_value = m_ent_cls + + entitlement = concrete_entitlement_factory( + entitled=True, + application_status=(ApplicationStatus.ENABLED, ""), + dependent_services=(m_ent_cls,), + ) ret, fail = entitlement.can_disable() assert not ret @@ -388,26 +391,22 @@ def test_can_enable_when_required_service_found( self, concrete_entitlement_factory ): + m_ent_cls = mock.MagicMock() + type(m_ent_cls).name = mock.PropertyMock(return_value="test") + m_ent_obj = m_ent_cls.return_value + m_ent_obj.application_status.return_value = [ + ApplicationStatus.DISABLED, + "", + ] + type(m_ent_obj).title = mock.PropertyMock(return_value="test") base_ent = concrete_entitlement_factory( entitled=True, applicability_status=(ApplicabilityStatus.APPLICABLE, ""), application_status=(ApplicationStatus.DISABLED, ""), + required_services=(m_ent_cls,), ) - base_ent._required_services = ["test"] - - m_entitlement_cls = mock.MagicMock() - m_entitlement_obj = m_entitlement_cls.return_value - m_entitlement_obj.application_status.return_value = [ - ApplicationStatus.DISABLED, - "", - ] - type(m_entitlement_obj).title = mock.PropertyMock(return_value="test") - with mock.patch( - "uaclient.entitlements.entitlement_factory", - return_value=m_entitlement_cls, - ): - ret, reason = base_ent.can_enable() + ret, reason = base_ent.can_enable() assert ret is False assert ( @@ -478,31 +477,28 @@ self, m_prompt, assume_yes, concrete_entitlement_factory ): m_prompt.return_value = assume_yes + + m_ent_cls = mock.MagicMock() + type(m_ent_cls).name = mock.PropertyMock(return_value="test") + m_ent_obj = m_ent_cls.return_value + m_ent_obj.application_status.return_value = [ + ApplicationStatus.DISABLED, + "", + ] + m_ent_obj.enable.return_value = (True, "") + type(m_ent_obj).title = mock.PropertyMock(return_value="test") + base_ent = concrete_entitlement_factory( entitled=True, enable=True, applicability_status=(ApplicabilityStatus.APPLICABLE, ""), application_status=(ApplicationStatus.DISABLED, ""), + required_services=(m_ent_cls,), ) - base_ent._required_services = ("test",) - - m_entitlement_cls = mock.MagicMock() - m_entitlement_obj = m_entitlement_cls.return_value - m_entitlement_obj.application_status.return_value = [ - ApplicationStatus.DISABLED, - "", - ] - m_entitlement_obj.enable.return_value = (True, "") - type(m_entitlement_obj).title = mock.PropertyMock(return_value="test") - with mock.patch( - "uaclient.entitlements.entitlement_factory", - return_value=m_entitlement_cls, - ): - ret, reason = base_ent.enable() + ret, reason = base_ent.enable() expected_prompt_call = 1 - expected_ret = False expected_reason = CanEnableFailureReason.INACTIVE_REQUIRED_SERVICES if assume_yes: @@ -516,7 +512,7 @@ else: assert reason.reason == expected_reason assert m_prompt.call_count == expected_prompt_call - assert m_entitlement_obj.enable.call_count == expected_enable_call + assert m_ent_obj.enable.call_count == expected_enable_call @pytest.mark.parametrize( "can_enable_fail,handle_incompat_calls,enable_req_calls", @@ -597,12 +593,10 @@ @pytest.mark.parametrize("enable_fail_message", (("not entitled"), (None))) @mock.patch("uaclient.util.handle_message_operations") - @mock.patch("uaclient.entitlements.entitlement_factory") @mock.patch("uaclient.util.prompt_for_confirmation") def test_enable_false_when_fails_to_enable_required_service( self, m_handle_msg, - m_ent_factory, m_prompt_for_confirmation, enable_fail_message, concrete_entitlement_factory, @@ -623,6 +617,7 @@ ) m_ent_cls = mock.Mock() + type(m_ent_cls).name = mock.PropertyMock(return_value="Test") m_ent_obj = m_ent_cls.return_value m_ent_obj.enable.return_value = (False, enable_fail_reason) m_ent_obj.application_status.return_value = ( @@ -630,15 +625,14 @@ None, ) type(m_ent_obj).title = mock.PropertyMock(return_value="Test") - m_ent_factory.return_value = m_ent_cls m_prompt_for_confirmation.return_vale = True entitlement = concrete_entitlement_factory( entitled=True, application_status=(ApplicationStatus.DISABLED, ""), + required_services=(m_ent_cls,), ) - entitlement._required_services = "test" with mock.patch.object(entitlement, "can_enable") as m_can_enable: m_can_enable.return_value = (False, fail_reason) @@ -650,7 +644,6 @@ expected_msg += "\n" + enable_fail_reason.message.msg assert expected_msg == fail.message.msg assert 1 == m_can_enable.call_count - assert 1 == m_ent_factory.call_count @pytest.mark.parametrize( "orig_access,delta", @@ -794,27 +787,23 @@ self, m_prompt, concrete_entitlement_factory ): m_prompt.return_value = True + + m_ent_cls = mock.MagicMock() + m_ent_obj = m_ent_cls.return_value + m_ent_obj.application_status.return_value = [ + ApplicationStatus.ENABLED, + "", + ] + m_ent_obj.disable.return_value = (True, None) + type(m_ent_obj).title = mock.PropertyMock(return_value="test") base_ent = concrete_entitlement_factory( entitled=True, disable=True, application_status=(ApplicationStatus.ENABLED, ""), - dependent_services=("test",), + dependent_services=(m_ent_cls,), ) - m_entitlement_cls = mock.MagicMock() - m_entitlement_obj = m_entitlement_cls.return_value - m_entitlement_obj.application_status.return_value = [ - ApplicationStatus.ENABLED, - "", - ] - m_entitlement_obj.disable.return_value = (True, None) - type(m_entitlement_obj).title = mock.PropertyMock(return_value="test") - - with mock.patch( - "uaclient.entitlements.entitlement_factory", - return_value=m_entitlement_cls, - ): - ret, fail = base_ent.disable() + ret, fail = base_ent.disable() expected_prompt_call = 1 expected_ret = True @@ -823,16 +812,14 @@ assert ret == expected_ret assert fail is None assert m_prompt.call_count == expected_prompt_call - assert m_entitlement_obj.disable.call_count == expected_disable_call + assert m_ent_obj.disable.call_count == expected_disable_call @pytest.mark.parametrize("disable_fail_message", (("error"), (None))) @mock.patch("uaclient.util.handle_message_operations") - @mock.patch("uaclient.entitlements.entitlement_factory") @mock.patch("uaclient.util.prompt_for_confirmation") def test_disable_false_when_fails_to_disable_dependent_service( self, m_handle_msg, - m_ent_factory, m_prompt_for_confirmation, disable_fail_message, concrete_entitlement_factory, @@ -852,6 +839,7 @@ ) m_ent_cls = mock.Mock() + type(m_ent_cls).name = mock.PropertyMock(return_value="Test") m_ent_obj = m_ent_cls.return_value m_ent_obj.disable.return_value = (False, disable_fail_reason) m_ent_obj.application_status.return_value = ( @@ -859,14 +847,13 @@ None, ) type(m_ent_obj).title = mock.PropertyMock(return_value="Test") - m_ent_factory.return_value = m_ent_cls m_prompt_for_confirmation.return_vale = True entitlement = concrete_entitlement_factory( entitled=True, application_status=(ApplicationStatus.DISABLED, ""), - dependent_services=("test"), + dependent_services=(m_ent_cls,), ) with mock.patch.object(entitlement, "can_disable") as m_can_disable: @@ -879,36 +866,6 @@ expected_msg += "\n" + disable_fail_reason.message.msg assert expected_msg == fail.message.msg assert 1 == m_can_disable.call_count - assert 1 == m_ent_factory.call_count - - @mock.patch("uaclient.util.handle_message_operations") - @mock.patch("uaclient.entitlements.entitlement_factory") - def test_disable_false_when_dependent_service_doesnt_exist( - self, m_ent_factory, m_handle_msg, concrete_entitlement_factory - ): - m_handle_msg.return_value = True - - fail_reason = CanDisableFailure( - CanDisableFailureReason.ACTIVE_DEPENDENT_SERVICES - ) - - m_ent_factory.side_effect = EntitlementNotFoundError() - - entitlement = concrete_entitlement_factory( - entitled=True, - application_status=(ApplicationStatus.DISABLED, ""), - dependent_services=("test"), - ) - - with mock.patch.object(entitlement, "can_disable") as m_can_disable: - m_can_disable.return_value = (False, fail_reason) - ret, fail = entitlement.disable() - - assert not ret - expected_msg = "Dependent service test not found." - assert expected_msg == fail.message.msg - assert 1 == m_can_disable.call_count - assert 1 == m_ent_factory.call_count @pytest.mark.parametrize( "p_name,expected", diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/tests/test_entitlements.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/tests/test_entitlements.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/tests/test_entitlements.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/tests/test_entitlements.py 2022-07-12 18:09:51.000000000 +0000 @@ -68,3 +68,119 @@ ) with pytest.raises(exceptions.EntitlementNotFoundError): entitlements.entitlement_factory(cfg=cfg, name="nonexistent") + + +class TestSortEntitlements: + def test_disable_order(self, FakeConfig): + m_cls_1 = mock.MagicMock() + m_obj_1 = m_cls_1.return_value + type(m_obj_1).dependent_services = mock.PropertyMock(return_value=()) + type(m_cls_1).name = mock.PropertyMock(return_value="ent1") + + m_cls_2 = mock.MagicMock() + m_obj_2 = m_cls_2.return_value + type(m_obj_2).dependent_services = mock.PropertyMock(return_value=()) + type(m_cls_2).name = mock.PropertyMock(return_value="ent2") + + m_cls_3 = mock.MagicMock() + m_obj_3 = m_cls_3.return_value + type(m_obj_3).dependent_services = mock.PropertyMock( + return_value=(m_cls_1, m_cls_2) + ) + type(m_cls_3).name = mock.PropertyMock(return_value="ent3") + + m_cls_5 = mock.MagicMock() + m_obj_5 = m_cls_5.return_value + type(m_obj_5).dependent_services = mock.PropertyMock(return_value=()) + type(m_cls_5).name = mock.PropertyMock(return_value="ent5") + + m_cls_6 = mock.MagicMock() + m_obj_6 = m_cls_6.return_value + type(m_obj_6).dependent_services = mock.PropertyMock(return_value=()) + type(m_cls_6).name = mock.PropertyMock(return_value="ent6") + + m_cls_4 = mock.MagicMock() + m_obj_4 = m_cls_4.return_value + type(m_obj_4).dependent_services = mock.PropertyMock( + return_value=(m_cls_5, m_cls_6) + ) + type(m_cls_4).name = mock.PropertyMock(return_value="ent4") + + m_entitlements = [ + m_cls_1, + m_cls_2, + m_cls_3, + m_cls_4, + m_cls_5, + m_cls_6, + ] + + with mock.patch.object( + entitlements, "ENTITLEMENT_CLASSES", m_entitlements + ): + assert [ + "ent1", + "ent2", + "ent3", + "ent5", + "ent6", + "ent4", + ] == entitlements.entitlements_disable_order(FakeConfig()) + + def test_enable_order(self, FakeConfig): + m_cls_2 = mock.MagicMock() + m_obj_2 = m_cls_2.return_value + type(m_obj_2).required_services = mock.PropertyMock(return_value=()) + type(m_cls_2).name = mock.PropertyMock(return_value="ent2") + + m_cls_1 = mock.MagicMock() + m_obj_1 = m_cls_1.return_value + type(m_obj_1).required_services = mock.PropertyMock( + return_value=(m_cls_2,) + ) + type(m_cls_1).name = mock.PropertyMock(return_value="ent1") + + m_cls_3 = mock.MagicMock() + m_obj_3 = m_cls_3.return_value + type(m_obj_3).required_services = mock.PropertyMock( + return_value=(m_cls_1, m_cls_2) + ) + type(m_cls_3).name = mock.PropertyMock(return_value="ent3") + + m_cls_5 = mock.MagicMock() + m_obj_5 = m_cls_5.return_value + type(m_obj_5).required_services = mock.PropertyMock(return_value=()) + type(m_cls_5).name = mock.PropertyMock(return_value="ent5") + + m_cls_6 = mock.MagicMock() + m_obj_6 = m_cls_6.return_value + type(m_obj_6).required_services = mock.PropertyMock(return_value=()) + type(m_cls_6).name = mock.PropertyMock(return_value="ent6") + + m_cls_4 = mock.MagicMock() + m_obj_4 = m_cls_4.return_value + type(m_obj_4).required_services = mock.PropertyMock( + return_value=(m_cls_5, m_cls_6) + ) + type(m_cls_4).name = mock.PropertyMock(return_value="ent4") + + m_entitlements = [ + m_cls_1, + m_cls_2, + m_cls_3, + m_cls_4, + m_cls_5, + m_cls_6, + ] + + with mock.patch.object( + entitlements, "ENTITLEMENT_CLASSES", m_entitlements + ): + assert [ + "ent2", + "ent1", + "ent3", + "ent5", + "ent6", + "ent4", + ] == entitlements.entitlements_enable_order(cfg=FakeConfig()) diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/tests/test_esm.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/tests/test_esm.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/tests/test_esm.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/tests/test_esm.py 2022-07-12 18:09:51.000000000 +0000 @@ -230,8 +230,8 @@ M_REPOPATH + "os.path.exists", side_effect=fake_exists ) ) - m_unlink = stack.enter_context( - mock.patch("uaclient.apt.os.unlink") + m_remove_file = stack.enter_context( + mock.patch("uaclient.util.remove_file") ) # Note that this patch uses a PropertyMock and happens on the # entitlement's type because packages is a property @@ -284,14 +284,14 @@ assert 0 == m_add_pinning.call_count assert subp_calls == m_subp.call_args_list if entitlement.name == "esm-infra": # Remove "never" apt pref pin - unlink_calls = [ + remove_file_calls = [ mock.call( "/etc/apt/preferences.d/ubuntu-{}".format(entitlement.name) ) ] else: - unlink_calls = [] # esm-apps doesn't write an apt pref file - assert unlink_calls == m_unlink.call_args_list + remove_file_calls = [] # esm-apps doesn't write an apt pref file + assert remove_file_calls == m_remove_file.call_args_list assert [ mock.call(entitlement.cfg) ] == m_update_apt_and_motd_msgs.call_args_list @@ -349,8 +349,8 @@ M_REPOPATH + "os.path.exists", side_effect=fake_exists ) ) - m_unlink = stack.enter_context( - mock.patch("uaclient.apt.os.unlink") + m_remove_file = stack.enter_context( + mock.patch("uaclient.util.remove_file") ) m_can_enable.return_value = (True, None) @@ -386,14 +386,16 @@ assert subp_calls == m_subp.call_args_list if entitlement.name == "esm-infra": # Enable esm-infra xenial removes apt preferences pin 'never' file - unlink_calls = [ + remove_file_calls = [ mock.call( "/etc/apt/preferences.d/ubuntu-{}".format(entitlement.name) ) ] else: - unlink_calls = [] # esm-apps there is no apt pref file to remove - assert unlink_calls == m_unlink.call_args_list + remove_file_calls = ( + [] + ) # esm-apps there is no apt pref file to remove + assert remove_file_calls == m_remove_file.call_args_list assert [ mock.call(run_apt_update=False) ] == m_remove_apt_config.call_args_list diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/tests/test_fips.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/tests/test_fips.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/tests/test_fips.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/tests/test_fips.py 2022-07-12 18:09:51.000000000 +0000 @@ -922,13 +922,14 @@ ] == entitlement.cfg.read_cache("notices") +@mock.patch("uaclient.util.should_reboot") class TestFIPSEntitlementApplicationStatus: @pytest.mark.parametrize( "super_application_status", [s for s in ApplicationStatus if s is not ApplicationStatus.ENABLED], ) def test_non_enabled_passed_through( - self, entitlement, super_application_status + self, _m_should_reboot, entitlement, super_application_status ): msg = "sure is some status here" with mock.patch( @@ -939,11 +940,18 @@ assert (super_application_status, msg) == application_status + @pytest.mark.parametrize("should_reboot", ((True), (False))) @pytest.mark.parametrize("path_exists", ((True), (False))) @pytest.mark.parametrize("proc_content", (("0"), ("1"))) def test_proc_file_is_used_to_determine_application_status_message( - self, proc_content, path_exists, entitlement + self, + m_should_reboot, + proc_content, + path_exists, + should_reboot, + entitlement, ): + m_should_reboot.return_value = should_reboot orig_load_file = util.load_file def fake_load_file(path): @@ -985,29 +993,41 @@ ) = entitlement.application_status() expected_status = ApplicationStatus.ENABLED - if path_exists and proc_content == "1": + expected_msg = msg + if path_exists and should_reboot and proc_content == "1": + expected_msg = msg + assert [ + ["", messages.FIPS_SYSTEM_REBOOT_REQUIRED.msg] + ] == entitlement.cfg.read_cache("notices") + elif path_exists and not should_reboot and proc_content == "1": expected_msg = msg assert entitlement.cfg.read_cache("notices") is None - elif path_exists and proc_content == "0": + elif path_exists and should_reboot and proc_content == "0": expected_msg = messages.FIPS_PROC_FILE_ERROR.format( file_name=entitlement.FIPS_PROC_FILE ) expected_status = ApplicationStatus.DISABLED assert [ - ["", messages.NOTICE_FIPS_MANUAL_DISABLE_URL] + ["", messages.FIPS_SYSTEM_REBOOT_REQUIRED.msg], + ["", messages.NOTICE_FIPS_MANUAL_DISABLE_URL], ] == entitlement.cfg.read_cache("notices") - else: - expected_msg = messages.FIPS_REBOOT_REQUIRED + elif path_exists and not should_reboot and proc_content == "0": + expected_msg = messages.FIPS_PROC_FILE_ERROR.format( + file_name=entitlement.FIPS_PROC_FILE + ) + expected_status = ApplicationStatus.DISABLED assert [ - ["", messages.FIPS_SYSTEM_REBOOT_REQUIRED.msg] + ["", messages.NOTICE_FIPS_MANUAL_DISABLE_URL], ] == entitlement.cfg.read_cache("notices") + else: + expected_msg = messages.FIPS_REBOOT_REQUIRED assert actual_status == expected_status assert expected_msg.msg == actual_msg.msg assert expected_msg.name == actual_msg.name def test_fips_does_not_show_enabled_when_fips_updates_is( - self, entitlement + self, _m_should_reboot, entitlement ): with mock.patch( "uaclient.apt.run_apt_cache_policy_command" @@ -1264,11 +1284,16 @@ class TestFIPSUpdatesEntitlementEnable: @pytest.mark.parametrize("enable_ret", ((True), (False))) + @mock.patch("uaclient.config.UAConfig.remove_notice") @mock.patch( "uaclient.entitlements.fips.FIPSCommonEntitlement._perform_enable" ) def test_fips_updates_enable_write_service_once_enable_file( - self, m_perform_enable, enable_ret, entitlement_factory + self, + m_perform_enable, + m_remove_notice, + enable_ret, + entitlement_factory, ): m_perform_enable.return_value = enable_ret m_write_cache = mock.MagicMock() @@ -1278,6 +1303,7 @@ cfg = mock.MagicMock() cfg.read_cache = m_read_cache cfg.write_cache = m_write_cache + cfg.remove_notice = m_remove_notice fips_updates_ent = entitlement_factory(FIPSUpdatesEntitlement, cfg=cfg) assert fips_updates_ent._perform_enable() == enable_ret @@ -1290,6 +1316,9 @@ key="services-once-enabled", content={"fips-updates": True} ) ] == m_write_cache.call_args_list + assert [ + mock.call("", messages.FIPS_DISABLE_REBOOT_REQUIRED) + ] == m_remove_notice.call_args_list else: assert not m_read_cache.call_count assert not m_write_cache.call_count diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/tests/test_repo.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/tests/test_repo.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/entitlements/tests/test_repo.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/entitlements/tests/test_repo.py 2022-07-12 18:09:51.000000000 +0000 @@ -736,7 +736,7 @@ ) ] == m_add_ppa_pinning.call_args_list - @mock.patch(M_PATH + "os.unlink") + @mock.patch(M_PATH + "util.remove_file") @mock.patch(M_PATH + "apt.remove_auth_apt_repo") @mock.patch(M_PATH + "apt.remove_apt_list_files") @mock.patch(M_PATH + "apt.run_apt_command") @@ -749,7 +749,7 @@ _m_run_apt_command, _m_remove_apt_list_files, _m_remove_auth_apt_repo, - m_unlink, + m_remove_file, entitlement_factory, ): """Remove apt preferences file when repo_pin_priority is an int.""" @@ -760,12 +760,10 @@ ) assert 1000 == entitlement.repo_pin_priority - with mock.patch(M_PATH + "os.path.exists") as m_exists: - m_exists.return_value = True - entitlement.remove_apt_config() - expected_call = [mock.call("/etc/apt/preferences.d/ubuntu-repotest")] - assert expected_call == m_exists.call_args_list - assert expected_call == m_unlink.call_args_list + entitlement.remove_apt_config() + assert [ + mock.call("/etc/apt/preferences.d/ubuntu-repotest") + ] == m_remove_file.call_args_list class TestSetupAptConfig: @@ -915,7 +913,7 @@ ) @mock.patch("uaclient.apt.setup_apt_proxy") - @mock.patch(M_PATH + "os.unlink") + @mock.patch(M_PATH + "util.remove_file") @mock.patch(M_PATH + "apt.add_auth_apt_repo") @mock.patch(M_PATH + "apt.run_apt_command") @mock.patch(M_PATH + "util.get_platform_info") @@ -926,7 +924,7 @@ m_get_platform_info, m_run_apt_command, m_add_auth_repo, - m_unlink, + m_remove_file, _m_setup_apt_proxy, entitlement_factory, ): @@ -940,13 +938,12 @@ m_exists.return_value = True entitlement.setup_apt_config() assert [ - mock.call("/etc/apt/preferences.d/ubuntu-repotest"), mock.call("/usr/lib/apt/methods/https"), mock.call("/usr/sbin/update-ca-certificates"), ] == m_exists.call_args_list assert [ mock.call("/etc/apt/preferences.d/ubuntu-repotest") - ] == m_unlink.call_args_list + ] == m_remove_file.call_args_list @mock.patch("uaclient.apt.setup_apt_proxy") @mock.patch(M_PATH + "apt.add_auth_apt_repo") diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/exceptions.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/exceptions.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/exceptions.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/exceptions.py 2022-07-12 18:09:51.000000000 +0000 @@ -258,6 +258,19 @@ ) +class GCPProAccountError(UserFacingError): + """An exception raised when GCP Pro service account is not enabled""" + + def __init__(self, msg: str, msg_code: Optional[str], code=None): + self.code = code + super().__init__(msg, msg_code) + + def __str__(self): + return "GCPProServiceAccount Error {code}: {msg}".format( + code=self.code, msg=self.msg + ) + + class CloudFactoryError(Exception): def __init__(self, cloud_type: Optional[str]) -> None: self.cloud_type = cloud_type diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/messages.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/messages.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/messages.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/messages.py 2022-07-12 18:09:51.000000000 +0000 @@ -74,6 +74,32 @@ USN_FIXED = "{issue} is addressed." CVE_FIXED = "{issue} is resolved." SECURITY_URL = "{issue}: {title}\nhttps://ubuntu.com/security/{url_path}" +SECURITY_DRY_RUN_UA_SERVICE_NOT_ENABLED = """\ +{bold}UA service: {{service}} is not enabled. +To proceed with the fix, a prompt would ask permission to automatically enable +this service. +{{{{ ua enable {{service}} }}}}{end_bold}""".format( + bold=TxtColor.BOLD, end_bold=TxtColor.ENDC +) +SECURITY_DRY_RUN_UA_NOT_ATTACHED = """\ +{bold}The machine is not attached to an Ubuntu Advantage (UA) subscription. +To proceed with the fix, a prompt would ask for a valid UA token. +{{ ua attach TOKEN }}{end_bold}""".format( + bold=TxtColor.BOLD, end_bold=TxtColor.ENDC +) +SECURITY_DRY_RUN_UA_EXPIRED_SUBSCRIPTION = """\ +{bold}The machine has an expired subscription. +To proceed with the fix, a prompt would ask for a new Ubuntu Advantage (UA) +token to renew the subscription. +{{ ua detach --assume-yes }} +{{ ua attach NEW_TOKEN }}{end_bold}""".format( + bold=TxtColor.BOLD, end_bold=TxtColor.ENDC +) +SECURITY_DRY_RUN_WARNING = """\ +{bold}WARNING: The option --dry-run is being used. +No packages will be installed when running this command.{end_bold}""".format( + bold=TxtColor.BOLD, end_bold=TxtColor.ENDC +) SECURITY_UA_SERVICE_NOT_ENABLED = """\ Error: UA service: {service} is not enabled. Without it, we cannot fix the system.""" @@ -743,6 +769,13 @@ "Cannot install Real-Time Kernel on a container.", ) +GCP_SERVICE_ACCT_NOT_ENABLED_ERROR = NamedMessage( + "gcp-pro-service-account-not-enabled", + "Failed to attach machine\n" + "{error_msg}\n" + "For more information, " + "see https://cloud.google.com/iam/docs/service-accounts", +) LOG_CONNECTIVITY_ERROR_TMPL = CONNECTIVITY_ERROR.msg + " {error}" LOG_CONNECTIVITY_ERROR_WITH_URL_TMPL = ( @@ -839,7 +872,7 @@ PROMPT_EXPIRED_ENTER_TOKEN = """\ Enter your new token to renew UA subscription on this system:""" PROMPT_UA_SUBSCRIPTION_URL = """\ -Open a browser to: {}/subscribe""".format( +Open a browser to: {}""".format( BASE_UA_URL ) diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/security.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/security.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/security.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/security.py 2022-07-12 18:09:51.000000000 +0000 @@ -545,7 +545,12 @@ return list(sorted(related_usns.values(), key=lambda x: x.id)) -def fix_security_issue_id(cfg: UAConfig, issue_id: str) -> FixStatus: +def fix_security_issue_id( + cfg: UAConfig, issue_id: str, dry_run: bool = False +) -> FixStatus: + if dry_run: + print(messages.SECURITY_DRY_RUN_WARNING) + issue_id = issue_id.upper() client = UASecurityClient(cfg=cfg) installed_packages = query_installed_source_pkg_versions() @@ -607,6 +612,7 @@ affected_pkg_status=affected_pkg_status, installed_packages=installed_packages, usn_released_pkgs=usn_released_pkgs, + dry_run=dry_run, ) @@ -829,6 +835,7 @@ binary_pocket_pkgs: Dict[str, List[str]], pkg_index: int, num_pkgs: int, + dry_run: bool, ) -> ReleasedPackagesInstallResult: """Handle the packages that could be fixed and have a released status. @@ -871,7 +878,10 @@ pkg_index += len(pkg_src_group) upgrade_status &= upgrade_packages_and_attach( - cfg, binary_pkgs, pocket + cfg=cfg, + upgrade_pkgs=binary_pkgs, + pocket=pocket, + dry_run=dry_run, ) if not upgrade_status: @@ -912,6 +922,7 @@ affected_pkg_status: Dict[str, CVEPackageStatus], installed_packages: Dict[str, Dict[str, str]], usn_released_pkgs: Dict[str, Dict[str, Dict[str, str]]], + dry_run: bool, ) -> FixStatus: """Process security CVE dict returning a CVEStatus object. @@ -982,6 +993,7 @@ binary_pocket_pkgs=binary_pocket_pkgs, pkg_index=pkg_index, num_pkgs=count, + dry_run=dry_run, ) unfixed_pkgs += released_pkgs_install_result.unfixed_pkgs @@ -1129,8 +1141,16 @@ return False +def _check_attached(cfg: UAConfig, dry_run: bool) -> bool: + """Verify if machine is attached to an UA subscription.""" + if dry_run: + print(messages.SECURITY_DRY_RUN_UA_NOT_ATTACHED) + return True + return _prompt_for_attach(cfg) + + def _check_subscription_for_required_service( - pocket: str, cfg: UAConfig + pocket: str, cfg: UAConfig, dry_run: bool ) -> bool: """Verify if the ua subscription has the required service enabled.""" ent = _get_service_for_pocket(pocket, cfg) @@ -1143,6 +1163,14 @@ applicability_status, _ = ent.applicability_status() if applicability_status == ApplicabilityStatus.APPLICABLE: + if dry_run: + print( + messages.SECURITY_DRY_RUN_UA_SERVICE_NOT_ENABLED.format( + service=ent.name + ) + ) + return True + if _prompt_for_enable(cfg, ent.name): return True else: @@ -1190,21 +1218,31 @@ return False -def _check_subscription_is_expired(cfg: UAConfig) -> bool: +def _check_subscription_is_expired( + status_cache: Dict[str, Any], cfg: UAConfig, dry_run: bool +) -> bool: """Check if user UA subscription is expired. :returns: True if subscription is expired and not renewed. """ - contract_expiry_datetime = cfg.contract_expiry_datetime + contract_expiry_datetime = status_cache.get("expires") + # If we don't have an expire information on the status-cache, we + # can assume that the machine is not attached. + if contract_expiry_datetime is None: + return False + tzinfo = contract_expiry_datetime.tzinfo if contract_expiry_datetime < datetime.now(tzinfo): + if dry_run: + print(messages.SECURITY_DRY_RUN_UA_EXPIRED_SUBSCRIPTION) + return False return not _prompt_for_new_token(cfg) return False def upgrade_packages_and_attach( - cfg: UAConfig, upgrade_packages: List[str], pocket: str + cfg: UAConfig, upgrade_pkgs: List[str], pocket: str, dry_run: bool ) -> bool: """Upgrade available packages to fix a CVE. @@ -1213,23 +1251,30 @@ :return: True if package upgrade completed or unneeded, False otherwise. """ - if not upgrade_packages: + if not upgrade_pkgs: return True - if os.getuid() != 0: + # If we are running on --dry-run mode, we don't need to be root + # to understand what will happen with the system + if os.getuid() != 0 and not dry_run: print(messages.SECURITY_APT_NON_ROOT) return False if pocket != UBUNTU_STANDARD_UPDATES_POCKET: - if not cfg.is_attached: - if not _prompt_for_attach(cfg): - return False # User opted to cancel - elif _check_subscription_is_expired(cfg): - # UA subscription is expired and the user has not - # renewed it + # We are now using status-cache because non-root users won't + # have access to the private machine_token.json file. We + # can use the status-cache as a proxy for the attached + # information + status_cache = cfg.read_cache("status-cache") or {} + if not status_cache.get("attached", False): + if not _check_attached(cfg, dry_run): + return False + elif _check_subscription_is_expired( + status_cache=status_cache, cfg=cfg, dry_run=dry_run + ): return False - if not _check_subscription_for_required_service(pocket, cfg): + if not _check_subscription_for_required_service(pocket, cfg, dry_run): # User subscription does not have required service enabled return False @@ -1238,16 +1283,19 @@ [ ["apt", "update", "&&"] + ["apt", "install", "--only-upgrade", "-y"] - + sorted(upgrade_packages) + + sorted(upgrade_pkgs) ] ) ) - apt.run_apt_update_command() - apt.run_apt_command( - cmd=["apt-get", "install", "--only-upgrade", "-y"] + upgrade_packages, - error_msg=messages.APT_INSTALL_FAILED.msg, - env={"DEBIAN_FRONTEND": "noninteractive"}, - ) + + if not dry_run: + apt.run_apt_update_command() + apt.run_apt_command( + cmd=["apt-get", "install", "--only-upgrade", "-y"] + upgrade_pkgs, + error_msg=messages.APT_INSTALL_FAILED.msg, + env={"DEBIAN_FRONTEND": "noninteractive"}, + ) + return True diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/security_status.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/security_status.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/security_status.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/security_status.py 2022-07-12 18:09:51.000000000 +0000 @@ -167,6 +167,7 @@ "service_name": service_name, "status": status, "origin": origin_site, + "download_size": candidate.size, } ) diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/serviceclient.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/serviceclient.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/serviceclient.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/serviceclient.py 2022-07-12 18:09:51.000000000 +0000 @@ -11,7 +11,7 @@ class UAServiceClient(metaclass=abc.ABCMeta): - url_timeout = None # type: Optional[int] + url_timeout = 30 # type: Optional[int] # Cached serviceclient_url_responses if provided in uaclient.conf # via features: {serviceclient_url_responses: /some/file.json} _response_overlay = None # type: Dict[str, Any] diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/status.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/status.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/status.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/status.py 2022-07-12 18:09:51.000000000 +0000 @@ -83,6 +83,7 @@ "services": [], "execution_status": UserFacingConfigStatus.INACTIVE.value, "execution_details": messages.NO_ACTIVE_OPERATIONS, + "features": {}, "notices": [], "contract": { "id": "", @@ -152,7 +153,6 @@ tech_support_level = UserFacingStatus.INAPPLICABLE.value response.update( { - "version": version.get_version(features=cfg.features), "machine_id": machineTokenInfo["machineId"], "attached": True, "origin": contractInfo.get("origin"), @@ -214,7 +214,6 @@ """Return unattached status as a dict.""" response = copy.deepcopy(DEFAULT_STATUS) - response["version"] = version.get_version(features=cfg.features) resources = get_available_resources(cfg) for resource in resources: @@ -317,6 +316,7 @@ "notices": notices, "config_path": cfg.cfg_path, "config": cfg.cfg, + "features": cfg.features, } @@ -399,7 +399,6 @@ response.update( { - "version": version.get_version(features=cfg.features), "contract": { "id": contract_info.get("id", ""), "name": contract_info.get("name", ""), @@ -573,6 +572,12 @@ ] for service in status["services"]: content.append(STATUS_UNATTACHED_TMPL.format(**service)) + + if status.get("features"): + content.append("\nFEATURES") + for key, value in sorted(status["features"].items()): + content.append("{}: {}".format(key, value)) + content.extend(["", messages.UNATTACHED.msg]) return "\n".join(content) @@ -598,6 +603,12 @@ status.get("notices") or [], header="NOTICES" ) ) + + if status.get("features"): + content.append("\nFEATURES") + for key, value in sorted(status["features"].items()): + content.append("{}: {}".format(key, value)) + content.append("\nEnable services with: ua enable ") pairs = [] diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_apt.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_apt.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_apt.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_apt.py 2022-07-12 18:09:51.000000000 +0000 @@ -578,14 +578,17 @@ return TestRepo - @mock.patch("uaclient.apt.os.unlink") - def test_no_removals_for_no_repo_entitlements(self, m_os_unlink): + @mock.patch("os.path.exists", return_value=True) + @mock.patch("uaclient.util.remove_file") + def test_removals_for_repo_entitlements( + self, m_remove_file, _m_path_exists + ): m_entitlements = mock.Mock() m_entitlements.ENTITLEMENT_CLASSES = [RepoTestEntitlement] clean_apt_files(_entitlements=m_entitlements) - assert 0 == m_os_unlink.call_count + assert 2 == m_remove_file.call_count def test_files_for_all_series_removed(self, mock_apt_entitlement, tmpdir): m_entitlements = mock.Mock() @@ -639,9 +642,9 @@ class TestRemoveAuthAptRepo: @mock.patch("uaclient.apt.util.subp") @mock.patch("uaclient.apt.remove_repo_from_apt_auth_file") - @mock.patch("uaclient.apt.util.del_file") + @mock.patch("uaclient.apt.util.remove_file") def test_repo_file_deleted( - self, m_del_file, _mock, __mock, remove_auth_apt_repo_kwargs + self, m_remove_file, _mock, __mock, remove_auth_apt_repo_kwargs ): """Ensure that repo_filename is deleted, regardless of other params.""" repo_filename, repo_url = mock.sentinel.filename, mock.sentinel.url @@ -650,10 +653,10 @@ repo_filename, repo_url, **remove_auth_apt_repo_kwargs ) - assert mock.call(repo_filename) in m_del_file.call_args_list + assert mock.call(repo_filename) in m_remove_file.call_args_list @mock.patch("uaclient.apt.util.subp") - @mock.patch("uaclient.apt.util.del_file") + @mock.patch("uaclient.apt.util.remove_file") @mock.patch("uaclient.apt.remove_repo_from_apt_auth_file") def test_remove_from_auth_file_called( self, m_remove_repo, _mock, __mock, remove_auth_apt_repo_kwargs @@ -669,9 +672,9 @@ @mock.patch("uaclient.apt.util.subp") @mock.patch("uaclient.apt.remove_repo_from_apt_auth_file") - @mock.patch("uaclient.apt.util.del_file") + @mock.patch("uaclient.apt.util.remove_file") def test_keyring_file_deleted_if_given( - self, m_del_file, _mock, __mock, remove_auth_apt_repo_kwargs + self, m_remove_file, _mock, __mock, remove_auth_apt_repo_kwargs ): """We should always delete the keyring file if it is given""" repo_filename, repo_url = mock.sentinel.filename, mock.sentinel.url @@ -684,18 +687,18 @@ if keyring_file: assert ( mock.call(os.path.join(APT_KEYS_DIR, keyring_file)) - in m_del_file.call_args_list + in m_remove_file.call_args_list ) else: - assert mock.call(keyring_file) not in m_del_file.call_args_list + assert mock.call(keyring_file) not in m_remove_file.call_args_list class TestRemoveRepoFromAptAuthFile: - @mock.patch("uaclient.apt.os.unlink") + @mock.patch("uaclient.util.remove_file") @mock.patch("uaclient.apt.util.write_file") @mock.patch("uaclient.apt.get_apt_auth_file_from_apt_config") def test_auth_file_doesnt_exist_means_we_dont_remove_or_write_it( - self, m_get_apt_auth_file, m_write_file, m_unlink, tmpdir + self, m_get_apt_auth_file, m_write_file, m_remove_file, tmpdir ): """If the auth file doesn't exist, we shouldn't do anything to it""" m_get_apt_auth_file.return_value = tmpdir.join("nonexistent").strpath @@ -703,7 +706,7 @@ remove_repo_from_apt_auth_file("http://url") assert 0 == m_write_file.call_count - assert 0 == m_unlink.call_count + assert 0 == m_remove_file.call_count @pytest.mark.parametrize("trailing_slash", (True, False)) @pytest.mark.parametrize( @@ -719,14 +722,14 @@ ), ), ) - @mock.patch("uaclient.apt.os.unlink") + @mock.patch("uaclient.util.remove_file") @mock.patch("uaclient.apt.util.write_file") @mock.patch("uaclient.apt.get_apt_auth_file_from_apt_config") def test_file_removal( self, m_get_apt_auth_file, m_write_file, - m_unlink, + m_remove_file, tmpdir, trailing_slash, repo_url, @@ -742,7 +745,7 @@ ) assert 0 == m_write_file.call_count - assert [mock.call(auth_file.strpath)] == m_unlink.call_args_list + assert [mock.call(auth_file.strpath)] == m_remove_file.call_args_list @pytest.mark.parametrize("trailing_slash", (True, False)) @pytest.mark.parametrize( @@ -771,12 +774,12 @@ ), ), ) - @mock.patch("uaclient.apt.os.unlink") + @mock.patch("uaclient.util.remove_file") @mock.patch("uaclient.apt.get_apt_auth_file_from_apt_config") def test_file_rewrite( self, m_get_apt_auth_file, - m_unlink, + m_remove_file, tmpdir, repo_url, before_content, @@ -792,7 +795,7 @@ repo_url + ("" if not trailing_slash else "/") ) - assert 0 == m_unlink.call_count + assert 0 == m_remove_file.call_count assert 0o600 == stat.S_IMODE(os.lstat(auth_file.strpath).st_mode) assert after_content == auth_file.read("rb") diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_cli_attach.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_cli_attach.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_cli_attach.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_cli_attach.py 2022-07-12 18:09:51.000000000 +0000 @@ -443,7 +443,7 @@ error=( "Got value with " 'incorrect type for field\n"enable_services": ' - "Expected value with type list but got value: 'cis'" + "Expected value with type list but got type: str" ), ) @@ -533,6 +533,7 @@ } assert expected == json.loads(fake_stdout.getvalue()) + @mock.patch("uaclient.entitlements.entitlements_enable_order") @mock.patch("uaclient.contract.process_entitlement_delta") @mock.patch("uaclient.util.apply_contract_overrides") @mock.patch("uaclient.contract.UAContractClient.request_url") @@ -543,6 +544,7 @@ m_request_url, _m_apply_contract_overrides, m_process_entitlement_delta, + m_enable_order, _m_getuid, FakeConfig, event, @@ -550,6 +552,7 @@ args = mock.MagicMock(token="token", attach_config=None) cfg = FakeConfig() + m_enable_order.return_value = ["test1", "test2"] m_process_entitlement_delta.side_effect = [ ({"test": 123}, True), UserFacingError("error"), diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_cli_collect_logs.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_cli_collect_logs.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_cli_collect_logs.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_cli_collect_logs.py 2022-07-12 18:09:51.000000000 +0000 @@ -51,6 +51,13 @@ out, _err = capsys.readouterr() assert re.match(HELP_OUTPUT, out) + @mock.patch( + M_PATH + "glob.glob", + return_value=[ + "/var/log/ubuntu-advantage.log", + "/var/log/ubuntu-advantage.log.1", + ], + ) @mock.patch(M_PATH + "tarfile.open") @mock.patch("builtins.open") @mock.patch(M_PATH + "util.redact_sensitive_logs", return_value="test") @@ -68,6 +75,7 @@ redact, _fopen, _tarfile, + _glob, _getuid, FakeConfig, ): @@ -118,8 +126,37 @@ ), ] - assert m_copy.call_count == 15 - assert redact.call_count == 15 + assert m_copy.call_count == 17 + assert m_copy.call_args_list == [ + mock.call("/etc/ubuntu-advantage/uaclient.conf", mock.ANY), + mock.call("/var/log/ubuntu-advantage.log", mock.ANY), + mock.call("/var/log/ubuntu-advantage-timer.log", mock.ANY), + mock.call("/var/log/ubuntu-advantage-daemon.log", mock.ANY), + mock.call(cfg.data_dir + "/jobs-status.json", mock.ANY), + mock.call("/etc/cloud/build.info", mock.ANY), + mock.call("/etc/apt/sources.list.d/ubuntu-cc-eal.list", mock.ANY), + mock.call("/etc/apt/sources.list.d/ubuntu-cis.list", mock.ANY), + mock.call( + "/etc/apt/sources.list.d/ubuntu-esm-apps.list", mock.ANY + ), + mock.call( + "/etc/apt/sources.list.d/ubuntu-esm-infra.list", mock.ANY + ), + mock.call("/etc/apt/sources.list.d/ubuntu-fips.list", mock.ANY), + mock.call( + "/etc/apt/sources.list.d/ubuntu-fips-updates.list", mock.ANY + ), + mock.call( + "/etc/apt/sources.list.d/ubuntu-realtime-kernel.list", mock.ANY + ), + mock.call("/etc/apt/sources.list.d/ubuntu-ros.list", mock.ANY), + mock.call( + "/etc/apt/sources.list.d/ubuntu-ros-updates.list", mock.ANY + ), + mock.call("/var/log/ubuntu-advantage.log", mock.ANY), + mock.call("/var/log/ubuntu-advantage.log.1", mock.ANY), + ] + assert redact.call_count == 17 class TestParser: diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_cli_detach.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_cli_detach.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_cli_detach.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_cli_detach.py 2022-07-12 18:09:51.000000000 +0000 @@ -149,14 +149,16 @@ "prompt_response,assume_yes,expect_disable", [(True, False, True), (False, False, False), (True, True, True)], ) - @mock.patch("uaclient.cli.entitlements") @mock.patch("uaclient.contract.UAContractClient") @mock.patch("uaclient.cli.update_apt_and_motd_messages") + @mock.patch("uaclient.cli.entitlements_disable_order") + @mock.patch("uaclient.cli.entitlements.entitlement_factory") def test_entitlements_disabled_appropriately( self, + m_ent_factory, + m_disable_order, m_update_apt_and_motd_msgs, m_client, - m_entitlements, m_getuid, m_prompt, prompt_response, @@ -179,33 +181,18 @@ m_client.return_value = fake_client m_prompt.return_value = prompt_response + disabled_cls = entitlement_cls_mock_factory(True, name="test") - m_entitlements.ENTITLEMENT_CLASSES = [ - entitlement_cls_mock_factory(False), - entitlement_cls_mock_factory(True, name="test"), - entitlement_cls_mock_factory(False), - ] + m_disable_order.return_value = ["test"] + m_ent_factory.return_value = disabled_cls args = mock.MagicMock(assume_yes=assume_yes) return_code = action_detach(args, cfg=cfg) - # Check that can_disable is called correctly - for ent_cls in m_entitlements.ENTITLEMENT_CLASSES: - assert [ - mock.call(ignore_dependent_services=True) - ] == ent_cls.return_value.can_disable.call_args_list - - assert [ - mock.call(cfg=cfg, assume_yes=assume_yes) - ] == ent_cls.call_args_list + assert [ + mock.call(ignore_dependent_services=True) + ] == disabled_cls.return_value.can_disable.call_args_list - # Check that disable is only called when can_disable is true - for undisabled_cls in [ - m_entitlements.ENTITLEMENT_CLASSES[0], - m_entitlements.ENTITLEMENT_CLASSES[2], - ]: - assert 0 == undisabled_cls.return_value.disable.call_count - disabled_cls = m_entitlements.ENTITLEMENT_CLASSES[1] if expect_disable: assert [ mock.call() @@ -241,21 +228,21 @@ } assert expected == json.loads(fake_stdout.getvalue()) - @mock.patch("uaclient.cli.entitlements") + @mock.patch("uaclient.cli.entitlements_disable_order") @mock.patch("uaclient.contract.UAContractClient") @mock.patch("uaclient.cli.update_apt_and_motd_messages") def test_config_cache_deleted( self, m_update_apt_and_motd_msgs, m_client, - m_entitlements, + m_disable_order, m_getuid, _m_prompt, FakeConfig, tmpdir, ): m_getuid.return_value = 0 - m_entitlements.ENTITLEMENT_CLASSES = [] + m_disable_order.return_value = [] fake_client = FakeContractClient(FakeConfig.for_attached_machine()) m_client.return_value = fake_client @@ -268,14 +255,14 @@ assert [mock.call()] == m_cfg.delete_cache.call_args_list assert [mock.call(m_cfg)] == m_update_apt_and_motd_msgs.call_args_list - @mock.patch("uaclient.cli.entitlements") + @mock.patch("uaclient.cli.entitlements_disable_order") @mock.patch("uaclient.contract.UAContractClient") @mock.patch("uaclient.cli.update_apt_and_motd_messages") def test_correct_message_emitted( self, m_update_apt_and_motd_msgs, m_client, - m_entitlements, + m_disable_order, m_getuid, _m_prompt, capsys, @@ -283,7 +270,7 @@ tmpdir, ): m_getuid.return_value = 0 - m_entitlements.ENTITLEMENT_CLASSES = [] + m_disable_order.return_value = [] fake_client = FakeContractClient(FakeConfig.for_attached_machine()) m_client.return_value = fake_client @@ -298,21 +285,21 @@ assert messages.DETACH_SUCCESS + "\n" == out assert [mock.call(m_cfg)] == m_update_apt_and_motd_msgs.call_args_list - @mock.patch("uaclient.cli.entitlements") + @mock.patch("uaclient.cli.entitlements_disable_order") @mock.patch("uaclient.contract.UAContractClient") @mock.patch("uaclient.cli.update_apt_and_motd_messages") def test_returns_zero( self, m_update_apt_and_motd_msgs, m_client, - m_entitlements, + m_disable_order, m_getuid, _m_prompt, FakeConfig, tmpdir, ): m_getuid.return_value = 0 - m_entitlements.ENTITLEMENT_CLASSES = [] + m_disable_order.return_value = [] fake_client = FakeContractClient(FakeConfig.for_attached_machine()) m_client.return_value = fake_client @@ -326,7 +313,7 @@ assert [mock.call(m_cfg)] == m_update_apt_and_motd_msgs.call_args_list @pytest.mark.parametrize( - "classes,expected_message,disabled_services", + "classes,disable_order,expected_message,disabled_services", [ ( [ @@ -334,6 +321,7 @@ entitlement_cls_mock_factory(False, name="ent2"), entitlement_cls_mock_factory(True, name="ent3"), ], + ["ent1", "ent2", "ent3"], dedent( """\ Detach will disable the following services: @@ -347,6 +335,7 @@ entitlement_cls_mock_factory(True, name="ent1"), entitlement_cls_mock_factory(False, name="ent2"), ], + ["ent1", "ent2"], dedent( """\ Detach will disable the following service: @@ -356,18 +345,21 @@ ), ], ) - @mock.patch("uaclient.cli.entitlements") @mock.patch("uaclient.contract.UAContractClient") @mock.patch("uaclient.cli.update_apt_and_motd_messages") + @mock.patch("uaclient.entitlements.entitlement_factory") + @mock.patch("uaclient.cli.entitlements_disable_order") def test_informational_message_emitted( self, + m_disable_order, + m_ent_factory, m_update_apt_and_motd_msgs, m_client, - m_entitlements, m_getuid, _m_prompt, capsys, classes, + disable_order, expected_message, disabled_services, FakeConfig, @@ -375,7 +367,8 @@ event, ): m_getuid.return_value = 0 - m_entitlements.ENTITLEMENT_CLASSES = classes + m_ent_factory.side_effect = classes + m_disable_order.return_value = disable_order fake_client = FakeContractClient(FakeConfig.for_attached_machine()) m_client.return_value = fake_client @@ -394,6 +387,7 @@ cfg = FakeConfig.for_attached_machine() fake_stdout = io.StringIO() + m_ent_factory.side_effect = classes with contextlib.redirect_stdout(fake_stdout): with mock.patch.object( event, "_event_logger_mode", event_logger.EventLoggerMode.JSON diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_cli_fix.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_cli_fix.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_cli_fix.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_cli_fix.py 2022-07-12 18:09:51.000000000 +0000 @@ -22,6 +22,9 @@ Flags: -h, --help show this help message and exit + --dry-run If used, fix will not actually run but will display + everything that will happen on the machine during the + command. """ ) @@ -60,12 +63,12 @@ ): """Check that root and non-root will emit attached status""" cfg = FakeConfig() - args = mock.MagicMock(security_issue=issue) + args = mock.MagicMock(security_issue=issue, dry_run=False) m_fix_security_issue_id.return_value = FixStatus.SYSTEM_NON_VULNERABLE if is_valid: assert 0 == action_fix(args, cfg=cfg) assert [ - mock.call(cfg, issue) + mock.call(cfg=cfg, issue_id=issue, dry_run=False) ] == m_fix_security_issue_id.call_args_list else: with pytest.raises(exceptions.UserFacingError) as excinfo: diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_cli_refresh.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_cli_refresh.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_cli_refresh.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_cli_refresh.py 2022-07-12 18:09:51.000000000 +0000 @@ -5,20 +5,21 @@ from uaclient.cli import action_refresh, main HELP_OUTPUT = """\ -usage: ua refresh [contract|config] [flags] +usage: ua refresh [contract|config|messages] [flags] -Refresh existing Ubuntu Advantage contract and update services. +Refresh three distinct UA related artifacts in the system: + +* contract: Update contract details from the server. +* config: Reload the config file. +* messages: Update APT and MOTD messages related to UA. + +You can individually target any of the three specific actions, +by passing it's target to nome to the command. If no `target` +is specified, all targets are refreshed. positional arguments: {contract,config,messages} - Target to refresh. `ua refresh contract` will update - contract details from the server and perform any - updates necessary. `ua refresh config` will reload - /etc/ubuntu-advantage/uaclient.conf and perform any - changes necessary. `ua refresh messages` will refresh - the APT and MOTD messages associated with UA. `ua - refresh` is the equivalent of `ua refresh config && ua - refresh contract && ua refresh motd`. + Target to refresh. Flags: -h, --help show this help message and exit @@ -33,7 +34,6 @@ with mock.patch("sys.argv", ["/usr/bin/ua", "refresh", "--help"]): main() out, _err = capsys.readouterr() - print(out) assert HELP_OUTPUT in out def test_non_root_users_are_rejected(self, getuid, FakeConfig): diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_cli_status.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_cli_status.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_cli_status.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_cli_status.py 2022-07-12 18:09:51.000000000 +0000 @@ -11,7 +11,7 @@ import pytest import yaml -from uaclient import exceptions, messages, status, version +from uaclient import exceptions, messages, status from uaclient.cli import action_status, get_parser, main, status_parser from uaclient.event_logger import EventLoggerMode from uaclient.tests.test_cli import M_PATH_UACONFIG @@ -98,7 +98,7 @@ realtime-kernel no {dash} Beta-version Ubuntu Kernel with PREEMPT_RT patches ros no {dash} Security Updates for the Robot Operating System ros-updates no {dash} All Updates for the Robot Operating System -{notices} +{notices}{features} Enable services with: ua enable Account: test_account @@ -114,7 +114,7 @@ fips no {dash} NIST-certified core packages fips-updates no {dash} NIST-certified core packages with priority security updates livepatch no {dash} Canonical Livepatch service -{notices} +{notices}{features} Enable services with: ua enable Account: test_account @@ -300,6 +300,16 @@ ), ), ) + @pytest.mark.parametrize( + "features,feature_status", + ( + ({}, ""), + ( + {"one": True, "other": False, "some": "thing"}, + "\nFEATURES\none: True\nother: False\nsome: thing\n", + ), + ), + ) def test_attached( self, _m_getuid, @@ -310,6 +320,8 @@ _m_contract_changed, notices, notice_status, + features, + feature_status, use_all, capsys, FakeConfig, @@ -317,9 +329,14 @@ """Check that root and non-root will emit attached status""" cfg = FakeConfig.for_attached_machine() cfg.write_cache("notices", notices) - assert 0 == action_status( - mock.MagicMock(all=use_all, simulate_with_token=None), cfg=cfg - ) + with mock.patch( + "uaclient.config.UAConfig.features", + new_callable=mock.PropertyMock, + return_value=features, + ): + assert 0 == action_status( + mock.MagicMock(all=use_all, simulate_with_token=None), cfg=cfg + ) # capsys already converts colorized non-printable chars to space # Strip non-printables from output printable_stdout = capsys.readouterr()[0].replace(" " * 17, " " * 8) @@ -335,7 +352,11 @@ if sys.stdout.encoding and "UTF-8" in sys.stdout.encoding.upper(): expected_dash = "\u2014" assert ( - status_tmpl.format(dash=expected_dash, notices=notice_status) + status_tmpl.format( + dash=expected_dash, + notices=notice_status, + features=feature_status, + ) == printable_stdout ) @@ -486,13 +507,14 @@ "considered Experimental and may change" ), "_schema_version": "0.1", - "version": version.get_version(features=cfg.features), + "version": mock.ANY, "execution_status": status.UserFacingConfigStatus.INACTIVE.value, "execution_details": messages.NO_ACTIVE_OPERATIONS, "attached": False, "machine_id": None, "effective": None, "expires": None, + "features": {}, "notices": [], "services": expected_services, "environment_vars": expected_environment, @@ -623,13 +645,14 @@ "considered Experimental and may change" ), "_schema_version": "0.1", - "version": version.get_version(features=cfg.features), + "version": mock.ANY, "execution_status": status.UserFacingConfigStatus.INACTIVE.value, "execution_details": messages.NO_ACTIVE_OPERATIONS, "attached": True, "machine_id": "test_machine_id", "effective": effective, "expires": expires, + "features": {}, "notices": [], "services": filtered_services, "environment_vars": expected_environment, @@ -782,6 +805,7 @@ "_schema_version": "0.1", "attached": False, "machine_id": None, + "features": {}, "notices": [], "account": { "created_at": "2019-06-14T06:45:50Z", @@ -803,7 +827,7 @@ "effective": None, "services": expected_services, "simulated": True, - "version": version.get_version(features=cfg.features), + "version": mock.ANY, "config_path": None, "config": {"data_dir": mock.ANY}, "errors": [], @@ -872,7 +896,9 @@ # comparison out = out.replace(" " * 17, " " * 8) - expected_out = ATTACHED_STATUS.format(dash=expected_dash, notices="") + expected_out = ATTACHED_STATUS.format( + dash=expected_dash, notices="", features="" + ) assert expected_out == out @pytest.mark.parametrize( diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_contract.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_contract.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_contract.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_contract.py 2022-07-12 18:09:51.000000000 +0000 @@ -156,7 +156,12 @@ return {"machineId": machine_id} m_platform_data.side_effect = fake_platform_data - get_platform_info.return_value = {"arch": "arch", "kernel": "kernel"} + get_platform_info.return_value = { + "arch": "arch", + "kernel": "kernel", + "series": "series", + } + get_machine_id.return_value = "machineId" machine_token = {"machineTokenInfo": {}} if machine_id_response: @@ -628,10 +633,11 @@ assert "Machine token refresh fail" == str(exc.value) + @mock.patch("uaclient.entitlements.entitlements_enable_order") @mock.patch("uaclient.util.get_machine_id", return_value="mid") @mock.patch(M_PATH + "UAContractClient") def test_user_facing_error_on_service_token_refresh_failure( - self, client, get_machine_id, FakeConfig + self, client, get_machine_id, m_enable_order, FakeConfig ): """When attaching, error on any failed specific service refresh.""" @@ -647,6 +653,7 @@ } }, } + m_enable_order.return_value = ["ent2", "ent1"] def fake_contract_client(cfg): fake_client = FakeContractClient(cfg) @@ -689,6 +696,7 @@ ), ), ) + @mock.patch("uaclient.entitlements.entitlements_enable_order") @mock.patch(M_PATH + "process_entitlement_delta") @mock.patch("uaclient.util.get_machine_id", return_value="mid") @mock.patch(M_PATH + "UAContractClient") @@ -697,6 +705,7 @@ client, get_machine_id, process_entitlement_delta, + m_enable_order, first_error, second_error, ux_error_msg, @@ -731,6 +740,7 @@ } }, } + m_enable_order.return_value = ["ent3", "ent2", "ent1"] cfg = FakeConfig.for_attached_machine(machine_token=machine_token) fake_client = FakeContractClient(cfg) @@ -751,20 +761,26 @@ assert 3 == process_entitlement_delta.call_count assert ux_error_msg.msg == str(exc.value.msg) + @mock.patch("uaclient.entitlements.entitlements_enable_order") @mock.patch(M_PATH + "process_entitlement_delta") @mock.patch("uaclient.util.get_machine_id", return_value="mid") @mock.patch(M_PATH + "UAContractClient") def test_attached_config_refresh_machine_token_and_services( - self, client, get_machine_id, process_entitlement_delta, FakeConfig + self, + client, + get_machine_id, + process_entitlement_delta, + m_enable_order, + FakeConfig, ): """When attached, refresh machine token and entitled services. Processing service deltas are processed in a sorted order based on - name to ensure operations occur the same regardless of dict ordering. + service dependencies to ensure operations occur the same regardless + of dict ordering. """ + m_enable_order.return_value = ["ent2", "ent1"] - # resourceEntitlements specifically ordered reverse alphabetically - # to ensure proper sorting for process_contract_delta calls below machine_token = { "machineToken": "mToken", "machineTokenInfo": { @@ -793,21 +809,14 @@ assert None is request_updated_contract(cfg) assert new_token == cfg.read_cache("machine-token") - # Deltas are processed in a sorted fashion so that if enableByDefault - # is true, the order of enablement operations is the same regardless - # of dict key ordering. process_calls = [ mock.call( cfg=cfg, orig_access={ - "entitlement": {"entitled": True, "type": "ent1"} + "entitlement": {"entitled": False, "type": "ent2"} }, new_access={ - "entitlement": { - "entitled": True, - "type": "ent1", - "new": "newval", - } + "entitlement": {"entitled": False, "type": "ent2"} }, allow_enable=False, series_overrides=True, @@ -815,10 +824,14 @@ mock.call( cfg=cfg, orig_access={ - "entitlement": {"entitled": False, "type": "ent2"} + "entitlement": {"entitled": True, "type": "ent1"} }, new_access={ - "entitlement": {"entitled": False, "type": "ent2"} + "entitlement": { + "entitled": True, + "type": "ent1", + "new": "newval", + } }, allow_enable=False, series_overrides=True, diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_daemon.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_daemon.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_daemon.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_daemon.py 2022-07-12 18:09:51.000000000 +0000 @@ -1,3 +1,5 @@ +from subprocess import TimeoutExpired + import mock import pytest @@ -19,16 +21,26 @@ def test_start_success(self, m_subp): start() assert [ - mock.call(["systemctl", "start", "ubuntu-advantage.service"]) + mock.call( + ["systemctl", "start", "ubuntu-advantage.service"], timeout=2.0 + ) ] == m_subp.call_args_list + @pytest.mark.parametrize( + "err", + ( + exceptions.ProcessExecutionError("cmd"), + TimeoutExpired("cmd", 2.0), + ), + ) @mock.patch(M_PATH + "LOG.warning") - def test_start_warning(self, m_log_warning, m_subp): - err = exceptions.ProcessExecutionError("cmd") + def test_start_warning(self, m_log_warning, m_subp, err): m_subp.side_effect = err start() assert [ - mock.call(["systemctl", "start", "ubuntu-advantage.service"]) + mock.call( + ["systemctl", "start", "ubuntu-advantage.service"], timeout=2.0 + ) ] == m_subp.call_args_list assert [mock.call(err)] == m_log_warning.call_args_list @@ -38,16 +50,26 @@ def test_stop_success(self, m_subp): stop() assert [ - mock.call(["systemctl", "stop", "ubuntu-advantage.service"]) + mock.call( + ["systemctl", "stop", "ubuntu-advantage.service"], timeout=2.0 + ) ] == m_subp.call_args_list + @pytest.mark.parametrize( + "err", + ( + exceptions.ProcessExecutionError("cmd"), + TimeoutExpired("cmd", 2.0), + ), + ) @mock.patch(M_PATH + "LOG.warning") - def test_stop_warning(self, m_log_warning, m_subp): - err = exceptions.ProcessExecutionError("cmd") + def test_stop_warning(self, m_log_warning, m_subp, err): m_subp.side_effect = err stop() assert [ - mock.call(["systemctl", "stop", "ubuntu-advantage.service"]) + mock.call( + ["systemctl", "stop", "ubuntu-advantage.service"], timeout=2.0 + ) ] == m_subp.call_args_list assert [mock.call(err)] == m_log_warning.call_args_list diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_data_types.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_data_types.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_data_types.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_data_types.py 2022-07-12 18:09:51.000000000 +0000 @@ -34,10 +34,10 @@ @pytest.mark.parametrize( "val, error", ( - (True, IncorrectTypeError("string", True)), - (1, IncorrectTypeError("string", 1)), - ([], IncorrectTypeError("string", [])), - ({}, IncorrectTypeError("string", {})), + (True, IncorrectTypeError("str", "bool")), + (1, IncorrectTypeError("str", "int")), + ([], IncorrectTypeError("str", "list")), + ({}, IncorrectTypeError("str", "dict")), ), ) def test_string_data_value_error(self, val, error): @@ -54,11 +54,11 @@ @pytest.mark.parametrize( "val, error", ( - (True, IncorrectTypeError("int", True)), - ("hello", IncorrectTypeError("int", "hello")), - ("1", IncorrectTypeError("int", "1")), - ([], IncorrectTypeError("int", [])), - ({}, IncorrectTypeError("int", {})), + (True, IncorrectTypeError("int", "bool")), + ("hello", IncorrectTypeError("int", "str")), + ("1", IncorrectTypeError("int", "str")), + ([], IncorrectTypeError("int", "list")), + ({}, IncorrectTypeError("int", "dict")), ), ) def test_int_data_value_error(self, val, error): @@ -75,10 +75,10 @@ @pytest.mark.parametrize( "val, error", ( - ("hello", IncorrectTypeError("bool", "hello")), - (1, IncorrectTypeError("bool", 1)), - ([], IncorrectTypeError("bool", [])), - ({}, IncorrectTypeError("bool", {})), + ("hello", IncorrectTypeError("bool", "str")), + (1, IncorrectTypeError("bool", "int")), + ([], IncorrectTypeError("bool", "list")), + ({}, IncorrectTypeError("bool", "dict")), ), ) def test_bool_data_value_error(self, val, error): @@ -106,28 +106,28 @@ @pytest.mark.parametrize( "data_cls, val, error", ( - (IntDataValue, "hello", IncorrectTypeError("list", "hello")), - (IntDataValue, 1, IncorrectTypeError("list", 1)), - (IntDataValue, {}, IncorrectTypeError("list", {})), + (IntDataValue, "hello", IncorrectTypeError("list", "str")), + (IntDataValue, 1, IncorrectTypeError("list", "int")), + (IntDataValue, {}, IncorrectTypeError("list", "dict")), ( IntDataValue, ["one"], IncorrectListElementTypeError( - IncorrectTypeError("int", "one"), 0 + IncorrectTypeError("int", "str"), 0 ), ), ( IntDataValue, [1, 2, 3, []], IncorrectListElementTypeError( - IncorrectTypeError("int", []), 3 + IncorrectTypeError("int", "list"), 3 ), ), ( StringDataValue, ["one", "two", "three", {}], IncorrectListElementTypeError( - IncorrectTypeError("string", {}), 3 + IncorrectTypeError("str", "dict"), 3 ), ), ( @@ -135,7 +135,7 @@ [["one", "two"], ["three"], ["four", 5]], IncorrectListElementTypeError( IncorrectListElementTypeError( - IncorrectTypeError("string", 5), 1 + IncorrectTypeError("str", "int"), 1 ), 2, ), @@ -202,20 +202,60 @@ self.objlist_opt = objlist_opt +example_data_object_dict_no_optionals = { + "string": "string", + "integer": 1, + "obj": {"string": "nestedstring", "integer": 2}, + "stringlist": ["one", "two"], + "integerlist": [3, 4, 5], + "objlist": [ + {"string": "nestedstring2", "integer": 6}, + {"string": "nestedstring3", "integer": 7}, + ], +} +example_data_object_dict_no_optionals_with_none = { + "string": "string", + "string_opt": None, + "integer": 1, + "integer_opt": None, + "obj": {"string": "nestedstring", "integer": 2}, + "obj_opt": None, + "stringlist": ["one", "two"], + "stringlist_opt": None, + "integerlist": [3, 4, 5], + "integerlist_opt": None, + "objlist": [ + {"string": "nestedstring2", "integer": 6}, + {"string": "nestedstring3", "integer": 7}, + ], + "objlist_opt": None, +} +example_data_object_dict_with_optionals = { + "string": "string", + "string_opt": "string_opt", + "integer": 1, + "integer_opt": 11, + "obj": {"string": "nestedstring", "integer": 2}, + "obj_opt": {"string": "nestedstring_opt", "integer": 22}, + "stringlist": ["one", "two"], + "stringlist_opt": ["one_opt", "two_opt"], + "integerlist": [3, 4, 5], + "integerlist_opt": [33, 44, 55], + "objlist": [ + {"string": "nestedstring2", "integer": 6}, + {"string": "nestedstring3", "integer": 7}, + ], + "objlist_opt": [ + {"string": "nestedstring2_opt", "integer": 66}, + {"string": "nestedstring3_opt", "integer": 77}, + ], +} + + class TestDataObject: def test_success_no_optionals(self): result = ExampleDataObject.from_dict( - { - "string": "string", - "integer": 1, - "obj": {"string": "nestedstring", "integer": 2}, - "stringlist": ["one", "two"], - "integerlist": [3, 4, 5], - "objlist": [ - {"string": "nestedstring2", "integer": 6}, - {"string": "nestedstring3", "integer": 7}, - ], - } + example_data_object_dict_no_optionals ) assert result.string == "string" assert result.string_opt is None @@ -236,26 +276,7 @@ def test_success_with_optionals(self): result = ExampleDataObject.from_dict( - { - "string": "string", - "string_opt": "string_opt", - "integer": 1, - "integer_opt": 11, - "obj": {"string": "nestedstring", "integer": 2}, - "obj_opt": {"string": "nestedstring_opt", "integer": 22}, - "stringlist": ["one", "two"], - "stringlist_opt": ["one_opt", "two_opt"], - "integerlist": [3, 4, 5], - "integerlist_opt": [33, 44, 55], - "objlist": [ - {"string": "nestedstring2", "integer": 6}, - {"string": "nestedstring3", "integer": 7}, - ], - "objlist_opt": [ - {"string": "nestedstring2_opt", "integer": 66}, - {"string": "nestedstring3_opt", "integer": 77}, - ], - } + example_data_object_dict_with_optionals ) assert result.string == "string" assert result.string_opt == "string_opt" @@ -295,7 +316,7 @@ ], }, IncorrectFieldTypeError( - IncorrectTypeError("StringDataValue", None), "string" + IncorrectTypeError("StringDataValue", "null"), "string" ), ), ( @@ -311,7 +332,7 @@ ], }, IncorrectFieldTypeError( - IncorrectTypeError("int", "1"), "integer" + IncorrectTypeError("int", "str"), "integer" ), ), ( @@ -328,7 +349,7 @@ }, IncorrectFieldTypeError( IncorrectFieldTypeError( - IncorrectTypeError("string", 8), "string" + IncorrectTypeError("str", "int"), "string" ), "obj", ), @@ -347,7 +368,7 @@ }, IncorrectFieldTypeError( IncorrectListElementTypeError( - IncorrectTypeError("string", 2), 1 + IncorrectTypeError("str", "int"), 1 ), "stringlist", ), @@ -367,20 +388,38 @@ IncorrectFieldTypeError( IncorrectListElementTypeError( IncorrectFieldTypeError( - IncorrectTypeError("int", "6"), "integer" + IncorrectTypeError("int", "str"), "integer" ), 0, ), "objlist", ), ), - ("string", IncorrectTypeError("dict", "string")), - (1, IncorrectTypeError("dict", 1)), - (True, IncorrectTypeError("dict", True)), - ([], IncorrectTypeError("dict", [])), + ("string", IncorrectTypeError("dict", "str")), + (1, IncorrectTypeError("dict", "int")), + (True, IncorrectTypeError("dict", "bool")), + ([], IncorrectTypeError("dict", "list")), ), ) def test_error(self, val, error): with pytest.raises(type(error)) as e: ExampleDataObject.from_value(val) assert e.value.msg == error.msg + + @pytest.mark.parametrize( + "d", + ( + example_data_object_dict_no_optionals, + example_data_object_dict_with_optionals, + ), + ) + def test_dict_round_trip(self, d): + assert d == ExampleDataObject.from_dict(d).to_dict(keep_none=False) + + def test_to_dict_keep_none(self): + assert ( + example_data_object_dict_no_optionals_with_none + == ExampleDataObject.from_dict( + example_data_object_dict_no_optionals + ).to_dict() + ) diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_security.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_security.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_security.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_security.py 2022-07-12 18:09:51.000000000 +0000 @@ -1,4 +1,5 @@ import copy +import datetime import textwrap from collections import defaultdict @@ -18,6 +19,9 @@ PROMPT_ENTER_TOKEN, PROMPT_EXPIRED_ENTER_TOKEN, SECURITY_APT_NON_ROOT, + SECURITY_DRY_RUN_UA_EXPIRED_SUBSCRIPTION, + SECURITY_DRY_RUN_UA_NOT_ATTACHED, + SECURITY_DRY_RUN_UA_SERVICE_NOT_ENABLED, SECURITY_ISSUE_NOT_RESOLVED, SECURITY_SERVICE_DISABLED, SECURITY_UA_SERVICE_NOT_ENABLED, @@ -36,6 +40,9 @@ CVEPackageStatus, FixStatus, UASecurityClient, + _check_attached, + _check_subscription_for_required_service, + _check_subscription_is_expired, fix_security_issue_id, get_cve_affected_source_packages_status, get_related_usns, @@ -985,6 +992,7 @@ affected_pkg_status=affected_pkg_status, installed_packages=installed_packages, usn_released_pkgs=usn_released_pkgs, + dry_run=False, ) assert ( "Error: USN-### metadata defines no fixed version for sl.\n" @@ -1401,6 +1409,7 @@ affected_pkg_status=affected_pkg_status, installed_packages=installed_packages, usn_released_pkgs=usn_released_pkgs, + dry_run=False, ) assert expected_ret == actual_ret out, err = capsys.readouterr() @@ -1522,6 +1531,7 @@ affected_pkg_status=affected_pkg_status, installed_packages=installed_packages, usn_released_pkgs=usn_released_pkgs, + dry_run=False, ) out, err = capsys.readouterr() assert expected in out @@ -1590,6 +1600,7 @@ affected_pkg_status=affected_pkg_status, installed_packages=installed_packages, usn_released_pkgs=usn_released_pkgs, + dry_run=False, ) out, err = capsys.readouterr() assert expected in out @@ -1695,6 +1706,7 @@ affected_pkg_status=affected_pkg_status, installed_packages=installed_packages, usn_released_pkgs=usn_released_pkgs, + dry_run=False, ) out, err = capsys.readouterr() assert expected in out @@ -1790,6 +1802,7 @@ affected_pkg_status=affected_pkg_status, installed_packages=installed_packages, usn_released_pkgs=usn_released_pkgs, + dry_run=False, ) out, err = capsys.readouterr() assert expected in out @@ -1879,6 +1892,7 @@ affected_pkg_status=affected_pkg_status, installed_packages=installed_packages, usn_released_pkgs=usn_released_pkgs, + dry_run=False, ) out, err = capsys.readouterr() assert expected in out @@ -1950,10 +1964,9 @@ cfg = FakeConfig() cfg.for_attached_machine( - machine_token={ - "machineTokenInfo": { - "contractInfo": {"effectiveTo": "1999-12-01T00:00:00Z"} - } + status_cache={ + "expires": "1999-12-01T00:00:00Z", + "attached": True, } ) with mock.patch("uaclient.util._subp", side_effect=_subp): @@ -1969,6 +1982,7 @@ affected_pkg_status=affected_pkg_status, installed_packages=installed_packages, usn_released_pkgs=usn_released_pkgs, + dry_run=False, ) out, err = capsys.readouterr() @@ -2021,10 +2035,9 @@ cfg = FakeConfig() cfg.for_attached_machine( - machine_token={ - "machineTokenInfo": { - "contractInfo": {"effectiveTo": "1999-12-01T00:00:00Z"} - } + status_cache={ + "expires": "1999-12-01T00:00:00Z", + "attached": True, } ) @@ -2041,6 +2054,7 @@ affected_pkg_status=affected_pkg_status, installed_packages=installed_packages, usn_released_pkgs=usn_released_pkgs, + dry_run=False, ) out, err = capsys.readouterr() @@ -2108,6 +2122,7 @@ affected_pkg_status=affected_pkg_status, installed_packages=installed_pkgs, usn_released_pkgs=usn_released_pkgs, + dry_run=False, ) assert exp_ret == actual_ret out, err = capsys.readouterr() @@ -2173,6 +2188,7 @@ affected_pkg_status=affected_pkg_status, installed_packages=installed_packages, usn_released_pkgs=usn_released_pkgs, + dry_run=False, ) out, err = capsys.readouterr() assert expected in out @@ -2190,8 +2206,9 @@ upgrade_packages_and_attach( cfg=None, - upgrade_packages=["t1", "t2"], + upgrade_pkgs=["t1", "t2"], pocket="Ubuntu standard updates", + dry_run=False, ) out, err = capsys.readouterr() @@ -2494,3 +2511,92 @@ assert override.response == orig_cve.response else: assert expected == override.response + + +class TestCheckAttached: + def test_check_attached_print_message_and_succeed_on_dry_run( + self, + FakeConfig, + capsys, + ): + cfg = FakeConfig() + assert _check_attached(cfg, dry_run=True) + + out, _ = capsys.readouterr() + assert SECURITY_DRY_RUN_UA_NOT_ATTACHED in out + + +class TestCheckSubscriptionForRequiredService: + @mock.patch("uaclient.security._get_service_for_pocket") + def test_check_subscription_print_message_and_succeed_on_dry_run( + self, + m_get_service, + FakeConfig, + capsys, + ): + ent_mock = mock.MagicMock() + ent_mock.user_facing_status.return_value = ( + UserFacingStatus.INACTIVE, + None, + ) + ent_mock.applicability_status.return_value = ( + ApplicabilityStatus.APPLICABLE, + None, + ) + type(ent_mock).name = mock.PropertyMock(return_value="test") + + m_get_service.return_value = ent_mock + cfg = FakeConfig() + assert _check_subscription_for_required_service( + pocket="", cfg=cfg, dry_run=True + ) + + out, _ = capsys.readouterr() + assert ( + SECURITY_DRY_RUN_UA_SERVICE_NOT_ENABLED.format(service="test") + in out + ) + + @mock.patch("uaclient.security._get_service_for_pocket") + def test_check_subscription_when_service_enabled( + self, m_get_service, FakeConfig + ): + ent_mock = mock.MagicMock() + ent_mock.user_facing_status.return_value = ( + UserFacingStatus.ACTIVE, + None, + ) + + m_get_service.return_value = ent_mock + cfg = FakeConfig() + assert _check_subscription_for_required_service( + pocket="", cfg=cfg, dry_run=False + ) + + +class TestCheckSubscriptionIsExpired: + def test_check_subscription_is_expired_passes_on_dry_run( + self, FakeConfig, capsys + ): + now = datetime.datetime.utcnow() + expire_date = now + datetime.timedelta(days=-10) + status_cache = {"expires": expire_date} + + assert not _check_subscription_is_expired( + status_cache=status_cache, cfg=None, dry_run=True + ) + + out, _ = capsys.readouterr() + assert SECURITY_DRY_RUN_UA_EXPIRED_SUBSCRIPTION in out + + @mock.patch("uaclient.security._prompt_for_new_token") + def test_check_subscription_is_expired(self, m_prompt, FakeConfig, capsys): + m_prompt.return_value = False + now = datetime.datetime.utcnow() + expire_date = now + datetime.timedelta(days=-10) + status_cache = {"expires": expire_date} + + assert _check_subscription_is_expired( + status_cache=status_cache, cfg=None, dry_run=False + ) + assert 1 == m_prompt.call_count diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_security_status.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_security_status.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_security_status.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_security_status.py 2022-07-12 18:09:51.000000000 +0000 @@ -28,12 +28,15 @@ def mock_version( - version: str, origin_list: List[mock.MagicMock] = [] + version: str, + origin_list: List[mock.MagicMock] = [], + size: int = 1, ) -> mock.MagicMock: mock_version = mock.MagicMock() mock_version.__gt__ = lambda self, other: self.version > other.version mock_version.version = version mock_version.origins = origin_list + mock_version.size = size return mock_version @@ -326,7 +329,7 @@ ): """Make sure the output format matches the expected JSON""" cfg = FakeConfig() - m_version = mock_version("1.0") + m_version = mock_version("1.0", size=123456) m_package = mock_package("example_package", m_version) m_cache.return_value = [m_package] * 10 @@ -341,6 +344,7 @@ "service_name": "esm-infra", "status": "pending_attach", "origin": "some.url.for.esm", + "download_size": 123456, }, { "package": "example_package", @@ -348,6 +352,7 @@ "service_name": "esm-infra", "status": "pending_attach", "origin": "some.url.for.esm", + "download_size": 123456, }, ], "summary": { diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_serviceclient.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_serviceclient.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_serviceclient.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_serviceclient.py 2022-07-12 18:09:51.000000000 +0000 @@ -89,7 +89,7 @@ data=None, headers=client.headers(), method=None, - timeout=None, + timeout=30, potentially_sensitive=True, ) ] == m_readurl.call_args_list diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_status.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_status.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_status.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_status.py 2022-07-12 18:09:51.000000000 +0000 @@ -7,7 +7,7 @@ import mock import pytest -from uaclient import messages, status, version +from uaclient import messages, status from uaclient.config import UAConfig from uaclient.entitlements import ( ENTITLEMENT_CLASSES, @@ -471,7 +471,7 @@ expected = copy.deepcopy(DEFAULT_STATUS) expected.update( { - "version": version.get_version(features=cfg.features), + "version": mock.ANY, "attached": True, "machine_id": "test_machine_id", "services": expected_services, @@ -563,6 +563,7 @@ other_cfg = FakeConfig.for_attached_machine() cfg.write_cache("accounts", {"accounts": other_cfg.accounts}) cfg.write_cache("machine-token", other_cfg.machine_token) + cfg.delete_cache_key("status-cache") assert status._attached_status(cfg=cfg) != before # Run as regular user and confirm that we see the result from @@ -697,7 +698,7 @@ expected = copy.deepcopy(status.DEFAULT_STATUS) expected.update( { - "version": version.get_version(features=cfg.features), + "version": mock.ANY, "attached": True, "machine_id": "test_machine_id", "contract": { @@ -835,6 +836,7 @@ { "execution_status": reboot_required, "execution_details": details, + "features": {}, "notices": [], "config_path": None, "config": {"data_dir": mock.ANY}, diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_version.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_version.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/tests/test_version.py 2022-04-01 13:27:49.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/tests/test_version.py 2022-07-12 18:09:51.000000000 +0000 @@ -1,39 +1,27 @@ import os.path import mock -import pytest -from uaclient import exceptions from uaclient.version import get_version @mock.patch("uaclient.util.subp") class TestGetVersion: - @pytest.mark.parametrize( - "features,suffix", (({}, ""), ({"on": True}, " +on")) - ) @mock.patch("uaclient.version.os.path.exists", return_value=True) - def test_get_version_returns_packaged_version( - self, m_exists, m_subp, features, suffix - ): + def test_get_version_returns_packaged_version(self, m_exists, m_subp): with mock.patch("uaclient.version.PACKAGED_VERSION", "24.1~18.04.1"): - assert "24.1~18.04.1" + suffix == get_version(features=features) + assert "24.1~18.04.1" == get_version() assert 0 == m_subp.call_count - @pytest.mark.parametrize( - "features,suffix", (({}, ""), ({"on": True}, " +on")) - ) @mock.patch("uaclient.version.os.path.exists", return_value=True) def test_get_version_returns_matching_git_describe_long( - self, m_exists, m_subp, features, suffix + self, m_exists, m_subp ): m_subp.return_value = ("24.1-5-g12345678", "") with mock.patch( "uaclient.version.PACKAGED_VERSION", "@@PACKAGED_VERSION" ): - assert "24.1-5-g12345678" + suffix == get_version( - features=features - ) + assert "24.1-5-g12345678" == get_version() assert [ mock.call( ["git", "describe", "--abbrev=8", "--match=[0-9]*", "--long"] @@ -42,34 +30,3 @@ top_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) top_dir_git = os.path.join(top_dir, ".git") assert [mock.call(top_dir_git)] == m_exists.call_args_list - - @mock.patch("uaclient.version.PACKAGED_VERSION", "@@PACKAGED_VERSION") - @mock.patch("uaclient.version.os.path.exists", return_value=True) - def test_returns_dpkg_parsechangelog_on_git_ubuntu_pkg_branch( - self, m_exists, m_subp - ): - """Call dpkg-parsechangelog if git describe fails to --match=[0-9]*""" - - def fake_subp(cmd): - if cmd[0] == "git": - # Not matching tag on git-ubuntu pkg branches - raise exceptions.ProcessExecutionError( - "fatal: No names found, cannot describe anything." - ) - if cmd[0] == "dpkg-parsechangelog": - return ("24.1\n", "") - assert False, "Unexpected subp cmd {}".format(cmd) - - m_subp.side_effect = fake_subp - - assert "24.1" == get_version() - expected_calls = [ - mock.call( - ["git", "describe", "--abbrev=8", "--match=[0-9]*", "--long"] - ), - mock.call(["dpkg-parsechangelog", "-S", "version"]), - ] - assert expected_calls == m_subp.call_args_list - top_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - top_dir_git = os.path.join(top_dir, ".git") - assert [mock.call(top_dir_git)] == m_exists.call_args_list diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/util.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/util.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/util.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/util.py 2022-07-12 18:09:51.000000000 +0000 @@ -9,7 +9,6 @@ import time import uuid from contextlib import contextmanager -from errno import ENOENT from functools import lru_cache, wraps from http.client import HTTPMessage from typing import ( @@ -181,14 +180,6 @@ orig_access["entitlement"][key] = value -def del_file(path: str) -> None: - try: - os.unlink(path) - except OSError as e: - if e.errno != ENOENT: - raise e - - @contextmanager def disable_log_to_console(): """ diff -Nru ubuntu-advantage-tools-27.9~18.04.1/uaclient/version.py ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/version.py --- ubuntu-advantage-tools-27.9~18.04.1/uaclient/version.py 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/uaclient/version.py 2022-07-12 18:09:51.000000000 +0000 @@ -8,12 +8,11 @@ from uaclient import exceptions, util -__VERSION__ = "27.9" +__VERSION__ = "27.10" PACKAGED_VERSION = "@@PACKAGED_VERSION@@" -VERSION_TMPL = "{version}{feature_suffix}" -def get_version(_args=None, features={}): +def get_version(): """Return the packaged version as a string Prefer the binary PACKAGED_VESION set by debian/rules to DEB_VERSION. @@ -24,29 +23,14 @@ b. If run in a git-ubuntu pkg repo, upstream tags aren't visible, parse the debian/changelog in that case """ - feature_suffix = "" - for key, value in sorted(features.items()): - feature_suffix += " {enabled}{name}".format( - enabled="+" if value else "-", name=key - ) if not PACKAGED_VERSION.startswith("@@PACKAGED_VERSION"): - return VERSION_TMPL.format( - version=PACKAGED_VERSION, feature_suffix=feature_suffix - ) + return PACKAGED_VERSION topdir = os.path.dirname(os.path.dirname(__file__)) if os.path.exists(os.path.join(topdir, ".git")): cmd = ["git", "describe", "--abbrev=8", "--match=[0-9]*", "--long"] try: out, _ = util.subp(cmd) - return out.strip() + feature_suffix + return out.strip() except exceptions.ProcessExecutionError: - # Rely on debian/changelog because we are in a git-ubuntu or other - # packaging repo - cmd = ["dpkg-parsechangelog", "-S", "version"] - out, _ = util.subp(cmd) - return VERSION_TMPL.format( - version=out.strip(), feature_suffix=feature_suffix - ) - return VERSION_TMPL.format( - version=__VERSION__, feature_suffix=feature_suffix - ) + pass + return __VERSION__ diff -Nru ubuntu-advantage-tools-27.9~18.04.1/ubuntu-advantage.1 ubuntu-advantage-tools-27.10.1~18.04.1/ubuntu-advantage.1 --- ubuntu-advantage-tools-27.9~18.04.1/ubuntu-advantage.1 2022-05-18 19:44:17.000000000 +0000 +++ ubuntu-advantage-tools-27.10.1~18.04.1/ubuntu-advantage.1 2022-07-12 18:09:51.000000000 +0000 @@ -220,13 +220,37 @@ .TP .B \fBapt_http_proxy\fP -If set, ua will configure apt to use the specified http proxy by writing a apt -config file to /etc/apt/apt.conf.d/90ubuntu-advantage-aptproxy +\fB[DEPRECATED]\fP If set, ua will configure apt to use the specified http proxy by writing a apt +config file to /etc/apt/apt.conf.d/90ubuntu-advantage-aptproxy. (Please use \fBglobal_apt_http_proxy\fP) .TP .B \fBapt_https_proxy\fP +\fB[DEPRECATED]\fP If set, ua will configure apt to use the specified https proxy by writing a apt +config file to /etc/apt/apt.conf.d/90ubuntu-advantage-aptproxy. (Please use \fBglobal_apt_https_proxy\fP) +.TP +.B +\fBglobal_apt_http_proxy\fP +If set, ua will configure apt to use the specified http proxy by writing a apt +config file to /etc/apt/apt.conf.d/90ubuntu-advantage-aptproxy. Set this if you +prefer a global proxy for all resources, not just the ones from \fIesm.ubuntu.com\fB +.TP +.B +\fBglobal_apt_https_proxy\fP +If set, ua will configure apt to use the specified https proxy by writing a apt +config file to /etc/apt/apt.conf.d/90ubuntu-advantage-aptproxy. Set this if you +prefer a global proxy for all resources, not just the ones from \fIesm.ubuntu.com\fB +.TP +.B +\fBua_apt_http_proxy\fP +If set, ua will configure apt to use the specified http proxy by writing a apt +config file to /etc/apt/apt.conf.d/90ubuntu-advantage-aptproxy. This proxy is limited +to accessing resources from \fIesm.ubuntu.com\fB +.TP +.B +\fBua_apt_https_proxy\fP If set, ua will configure apt to use the specified https proxy by writing a apt -config file to /etc/apt/apt.conf.d/90ubuntu-advantage-aptproxy +config file to /etc/apt/apt.conf.d/90ubuntu-advantage-aptproxy. This proxy is limited +to accessing resources from \fIesm.ubuntu.com\fB .TP .B \fB_timer\fP