diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c9f6c444b4c..a03e58a04a5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -338,7 +338,7 @@ jobs: run: | if [ -e spread.log ]; then echo "Running spread log analyzer" - ./tests/lib/tools/log-parser spread.log --print-detail error-debug --output spread-results.json --cut 100 + ./tests/lib/external/snapd-testing-tools/utils/log-parser spread.log --print-detail error-debug --output spread-results.json --cut 100 while IFS= read -r line; do if [ ! -z "$line" ]; then echo "Reporting spread error..." @@ -420,7 +420,7 @@ jobs: run: | if [ -e spread.log ]; then echo "Running spread log analyzer" - ./tests/lib/tools/log-parser spread.log --print-detail error --output spread-results.json --cut 100 + ./tests/lib/external/snapd-testing-tools/utils/log-parser spread.log --print-detail error --output spread-results.json --cut 100 while IFS= read -r line; do if [ ! -z "$line" ]; then echo "Reporting spread error..." diff --git a/run-checks b/run-checks index c9577298ebc..5fb916e8538 100755 --- a/run-checks +++ b/run-checks @@ -205,7 +205,7 @@ if [ "$STATIC" = 1 ]; then fi unset regexp # also run spread-shellcheck - ./spread-shellcheck spread.yaml tests --exclude "$exclude_tools_path" + ./tests/lib/external/snapd-testing-tools/utils/spread-shellcheck spread.yaml tests --exclude "$exclude_tools_path" fi echo "Checking spelling errors" @@ -267,7 +267,7 @@ if [ "$STATIC" = 1 ]; then if [ -z "${SKIP_TESTS_FORMAT_CHECK-}" ] || [ "$SKIP_TESTS_FORMAT_CHECK" = 0 ]; then echo "Checking tests formatting" - ./tests/utils/check-test-format ./tests + ./tests/lib/external/snapd-testing-tools/utils/check-test-format ./tests fi fi diff --git a/tests/lib/external/snapd-testing-tools/.github/workflows/tests.yaml b/tests/lib/external/snapd-testing-tools/.github/workflows/tests.yaml index 025a25e924b..dd26641cf53 100644 --- a/tests/lib/external/snapd-testing-tools/.github/workflows/tests.yaml +++ b/tests/lib/external/snapd-testing-tools/.github/workflows/tests.yaml @@ -16,10 +16,15 @@ jobs: - name: Run shellCheck for tools run: | + # Run shellcheck from the snap which most likely is newer than what the distro provides sudo apt-get remove --purge shellcheck sudo snap install shellcheck + find tools utils -type f -exec sh -c "head -n 1 {} | egrep -a 'bin/bash|bin/sh' >/dev/null" \; -print -exec shellcheck {} \; - find tools -type f -exec sh -c "head -n 1 {} | egrep -a 'bin/bash|bin/sh' >/dev/null" \; -print -exec shellcheck {} \; + # Run shellcheck from the distro + sudo snap remove shellcheck + sudo apt-get install -y shellcheck + find tools utils -type f -exec sh -c "head -n 1 {} | egrep -a 'bin/bash|bin/sh' >/dev/null" \; -print -exec shellcheck {} \; test: needs: [unit-tests] diff --git a/tests/lib/external/snapd-testing-tools/README.md b/tests/lib/external/snapd-testing-tools/README.md index 9a66f80d85e..9f213f0e15d 100644 --- a/tests/lib/external/snapd-testing-tools/README.md +++ b/tests/lib/external/snapd-testing-tools/README.md @@ -37,6 +37,8 @@ and on [Facebook](https://www.facebook.com/snapcraftio). The tools included in this project are intended to be reused by other projects. +Tools are supported in all the systems included in spread.yaml file. + Read the following considerations before adding new tools: - Each tool needs to be accompanied by at least 1 spread test in `tests//` @@ -45,6 +47,23 @@ Read the following considerations before adding new tools: - All tools need to be as generic as possible - Each tool must also provide a command line interface (CLI), including _help_ output +## Adding new utils + +The utils included in this project are intended to be reused by other projects. + +Utils are used as a complement for spread tests executions. Those are not intended to be used by spread tests. +For example utils are used on github action workflows to analyze tests code and outputs. + +Utils are supported in ubuntu-18.04 and higher. + +Read the following considerations before adding new utils: + + - Each util needs to be accompanied by at least 1 spread test in `tests//` + - At least 1 spread test needs to be included in the tests directory for each util + - If the util is a shell script, it needs to first pass a [ShellCheck](https://github.com/koalaman/shellcheck) assessment + - All utils need to be as generic as possible + - Each util must also provide a command line interface (CLI), including _help_ output + ## Project status diff --git a/tests/lib/external/snapd-testing-tools/spread.yaml b/tests/lib/external/snapd-testing-tools/spread.yaml index 43ac03f6227..7be3ec5b67f 100644 --- a/tests/lib/external/snapd-testing-tools/spread.yaml +++ b/tests/lib/external/snapd-testing-tools/spread.yaml @@ -2,7 +2,7 @@ project: snapd-testing-tools environment: PROJECT_PATH: /root/snapd-testing-tools - PATH: $PATH:$PROJECT_PATH/tools + PATH: $PATH:$PROJECT_PATH/tools:$PROJECT_PATH/utils backends: google: diff --git a/tests/lib/external/snapd-testing-tools/tests/os.query/task.yaml b/tests/lib/external/snapd-testing-tools/tests/os.query/task.yaml index 5764b26748a..5a8e138e56d 100644 --- a/tests/lib/external/snapd-testing-tools/tests/os.query/task.yaml +++ b/tests/lib/external/snapd-testing-tools/tests/os.query/task.yaml @@ -9,6 +9,7 @@ execute: | os.query is-trusty os.query is-classic ! os.query is-core + ! os.query is-s390x ;; ubuntu-16.04-64) os.query is-xenial diff --git a/tests/lib/external/snapd-testing-tools/tests/repack-kernel/task.yaml b/tests/lib/external/snapd-testing-tools/tests/repack-kernel/task.yaml index 8956b41c32d..6f862551799 100644 --- a/tests/lib/external/snapd-testing-tools/tests/repack-kernel/task.yaml +++ b/tests/lib/external/snapd-testing-tools/tests/repack-kernel/task.yaml @@ -3,14 +3,6 @@ summary: tests for the repack-kernel tool # ubuntu-core-initramfs seems to be only available on ubuntu-20.04 systems: [ubuntu-20.04-64] -prepare: | - # install dependencies - apt update -yqq - apt install snapd - -restore: | - apt remove snapd -yqq - execute: | repack-kernel | MATCH 'usage: repack-kernel ' repack-kernel -h | MATCH 'usage: repack-kernel ' @@ -47,7 +39,7 @@ execute: | repack-kernel pack "$kerneldir" --filename=pc-kernel.snap rm -rf "$kerneldir" - if ![ -f "pc-kernel.snap" ]; then + if ! [ -f "pc-kernel.snap" ]; then echo "Repack failed, pc-kernel.snap was not created" exit 1 fi diff --git a/tests/lib/external/snapd-testing-tools/tests/spread-shellcheck/task.yaml b/tests/lib/external/snapd-testing-tools/tests/spread-shellcheck/task.yaml new file mode 100644 index 00000000000..e9ab3bd7597 --- /dev/null +++ b/tests/lib/external/snapd-testing-tools/tests/spread-shellcheck/task.yaml @@ -0,0 +1,37 @@ +summary: smoke test for the spread-shellcheck tool + +systems: [ ubuntu-20.04-64 ] + +prepare: | + snap install shellcheck + +restore: | + snap remove shellcheck + +execute: | + spread-shellcheck -h | MATCH "usage: spread-shellcheck" + + # Check the format of the spread tests in this project + spread-shellcheck "$PROJECT_PATH/tests" + + # Check failing tasks + cp "$PWD/tasks/task1" "$PWD/tasks/task.yaml" + spread-shellcheck "$PWD/tasks" 2>&1 | MATCH "SC1035" + rm "$PWD/tasks/task.yaml" + + cp "$PWD/tasks/task2" "$PWD/tasks/task.yaml" + spread-shellcheck "$PWD/tasks" 2>&1 | MATCH "SC1035" + rm "$PWD/tasks/task.yaml" + + cp "$PWD/tasks/task3" "$PWD/tasks/task.yaml" + spread-shellcheck "$PWD/tasks" 2>&1 | MATCH "SC1035" + rm "$PWD/tasks/task.yaml" + + cp "$PWD/tasks/task4" "$PWD/tasks/task.yaml" + spread-shellcheck "$PWD/tasks" 2>&1 | MATCH "SC1035" + rm "$PWD/tasks/task.yaml" + + # Check that dirs can be excluded + cp "$PWD/tasks/task4" "$PWD/tasks/task.yaml" + spread-shellcheck "$PROJECT_PATH/tests" -e "$PWD/tasks" + rm "$PWD/tasks/task.yaml" diff --git a/tests/lib/external/snapd-testing-tools/tests/spread-shellcheck/tasks/task1 b/tests/lib/external/snapd-testing-tools/tests/spread-shellcheck/tasks/task1 new file mode 100644 index 00000000000..e1f2a493000 --- /dev/null +++ b/tests/lib/external/snapd-testing-tools/tests/spread-shellcheck/tasks/task1 @@ -0,0 +1,13 @@ +summary: this is the summary + +prepare: | + echo "preparing" + +restore: | + echo "restoring" + +debug: | + echo "debuging" + +execute: | + ![ -z "something" ] diff --git a/tests/lib/external/snapd-testing-tools/tests/spread-shellcheck/tasks/task2 b/tests/lib/external/snapd-testing-tools/tests/spread-shellcheck/tasks/task2 new file mode 100644 index 00000000000..54a16834a4b --- /dev/null +++ b/tests/lib/external/snapd-testing-tools/tests/spread-shellcheck/tasks/task2 @@ -0,0 +1,13 @@ +summary: this is the summary + +prepare: | + ![ -z "something" ] + +restore: | + echo "restoring" + +debug: | + echo "debuging" + +execute: | + echo "executing" diff --git a/tests/lib/external/snapd-testing-tools/tests/spread-shellcheck/tasks/task3 b/tests/lib/external/snapd-testing-tools/tests/spread-shellcheck/tasks/task3 new file mode 100644 index 00000000000..b2095df2c44 --- /dev/null +++ b/tests/lib/external/snapd-testing-tools/tests/spread-shellcheck/tasks/task3 @@ -0,0 +1,13 @@ +summary: this is the summary + +prepare: | + echo "preparing" + +restore: | + ![ -z "something" ] + +debug: | + echo "debuging" + +execute: | + echo "executing" diff --git a/tests/lib/external/snapd-testing-tools/tests/spread-shellcheck/tasks/task4 b/tests/lib/external/snapd-testing-tools/tests/spread-shellcheck/tasks/task4 new file mode 100644 index 00000000000..11f915bb3ab --- /dev/null +++ b/tests/lib/external/snapd-testing-tools/tests/spread-shellcheck/tasks/task4 @@ -0,0 +1,13 @@ +summary: this is the summary + +prepare: | + echo "preparing" + +restore: | + echo "restoring" + +debug: | + ![ -z "something" ] + +execute: | + echo "executing" diff --git a/tests/lib/external/snapd-testing-tools/tools/os.query b/tests/lib/external/snapd-testing-tools/tools/os.query index 7918e7d1d9e..a0c657bee68 100755 --- a/tests/lib/external/snapd-testing-tools/tools/os.query +++ b/tests/lib/external/snapd-testing-tools/tools/os.query @@ -6,7 +6,7 @@ show_help() { echo " os.query is-trusty, is-xenial, is-bionic, is-focal, is-impish" echo " os.query is-ubuntu, is-debian, is-fedora, is-amazon-linux, is-arch-linux, is-centos, is-centos-7, is-centos-8, is-opensuse" echo " os.query is-opensuse-tumbleweed, is-debian-sid, is-debian-11, is-debian-10" - echo " os.query is-pc-amd64, is-pc-i386, is-arm, is-armhf, is-arm64" + echo " os.query is-pc-amd64, is-pc-i386, is-arm, is-armhf, is-arm64, is-s390x" echo "" echo "Get general information about the current system" } @@ -131,6 +131,10 @@ is_arm64() { uname -m | grep -Eq '(aarch64.*|armv8.*)' } +is_s390x() { + uname -m | grep -qFx 's390x' +} + main() { if [ $# -eq 0 ]; then diff --git a/tests/utils/check-test-format b/tests/lib/external/snapd-testing-tools/utils/check-test-format similarity index 85% rename from tests/utils/check-test-format rename to tests/lib/external/snapd-testing-tools/utils/check-test-format index 3da213ed781..9fc95ea1dbe 100755 --- a/tests/utils/check-test-format +++ b/tests/lib/external/snapd-testing-tools/utils/check-test-format @@ -1,5 +1,11 @@ #!/usr/bin/python3 +""" +This tool is used to varify a correct format of spread tests +The imput is a directory which is scanned recursively and all +the task.yaml files are check +""" + import argparse import glob import os @@ -69,8 +75,12 @@ def check_task_format(filepath): return False filemap = dict() - with open(filepath, "r") as task: - filemap = yaml.load(task, Loader=yamlordereddictloader.Loader) + try: + with open(filepath, "r") as task: + filemap = yaml.load(task, Loader=yamlordereddictloader.Loader) + except yaml.scanner.ScannerError: + print("Invalid task format, checks failed for task {}".format(filepath)) + return False findings = check_keys_order(filemap.keys()) findings.extend(check_mandatory_keys(filemap.keys())) diff --git a/tests/lib/external/snapd-testing-tools/tools/log-analyzer b/tests/lib/external/snapd-testing-tools/utils/log-analyzer similarity index 100% rename from tests/lib/external/snapd-testing-tools/tools/log-analyzer rename to tests/lib/external/snapd-testing-tools/utils/log-analyzer diff --git a/tests/lib/external/snapd-testing-tools/tools/log-parser b/tests/lib/external/snapd-testing-tools/utils/log-parser similarity index 100% rename from tests/lib/external/snapd-testing-tools/tools/log-parser rename to tests/lib/external/snapd-testing-tools/utils/log-parser diff --git a/spread-shellcheck b/tests/lib/external/snapd-testing-tools/utils/spread-shellcheck similarity index 99% rename from spread-shellcheck rename to tests/lib/external/snapd-testing-tools/utils/spread-shellcheck index b04e84fa530..0cacefeb604 100755 --- a/spread-shellcheck +++ b/tests/lib/external/snapd-testing-tools/utils/spread-shellcheck @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Copyright (C) 2018 Canonical Ltd +# Copyright (C) 2022 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as @@ -14,22 +14,21 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import argparse +import binascii +import hashlib +import itertools import logging import os import subprocess -import argparse -import itertools -import hashlib -import binascii +import yaml + +from collections import namedtuple from concurrent.futures import ThreadPoolExecutor -from threading import Lock from multiprocessing import cpu_count -from typing import Dict from pathlib import Path -from collections import namedtuple - - -import yaml +from threading import Lock +from typing import Dict # default shell for shellcheck diff --git a/tests/lib/tools/log-parser b/tests/lib/tools/log-parser deleted file mode 100755 index e41e465519f..00000000000 --- a/tests/lib/tools/log-parser +++ /dev/null @@ -1,599 +0,0 @@ -#!/usr/bin/env python3 - -""" -This tool reads a spread log and creates a file with all the data -The output file includes the more important information extracted -from the log to be analyzed -""" - -import argparse -import json -import os -import re -import sys - -# Info types -ERROR_TYPE = 'Error' -DEBUG_TYPE = 'Debug' -WARN_TYPE = 'WARNING:' - -# Results -FAILED_TYPE = 'Failed' -ABORTED_TYPE = 'Aborted' -SUCCESSFUL_TYPE = 'Successful' - -# Setups -BEFORE_TYPE = 'Before' -AFTER_TYPE = 'After' - -# Printable names -ALL = 'all' -NONE = 'none' -ACTION = 'action' -OPERATION = 'operation' -INFO = 'info' -ERROR = 'error' -ERROR_DEBUG = 'error-debug' -FAILED = 'failed' -ABORTED = 'aborted' -SUCCESSFUL = 'successful' -SETUP = 'setup' - -RESULT = 'result' -START = 'Found' -SPREAD_FILE = 'spread.yaml' - -EXEC_VERBS = ['Preparing', 'Executing', 'Restoring'] -INFO_TYPES = [ERROR_TYPE, DEBUG_TYPE, WARN_TYPE] -OPERATIONS = [ - 'Rebooting', 'Discarding', 'Allocating', 'Waiting', - 'Allocated', 'Connecting', 'Connected', 'Sending' - ] -RESULTS = ['Successful', 'Aborted', 'Failed'] -SETUP_TYPES = [BEFORE_TYPE, AFTER_TYPE] - - -class Action: - """ - Action represents the main spread tasks actions - The actions can be: Preparing, Executing and Restoring - """ - - def __init__(self, verb, task, date, time, source_line): - self.type = ACTION - self.verb = verb - self.time = time - self.date = date - self.task = task - self.source_line = source_line - - def __repr__(self): - return self.source_line - - def __dict__(self): - return { - 'type': self.type, - 'date': self.date, - 'time': self.time, - 'verb': self.verb, - 'task': self.task - } - -class Setup: - """ - Setup represents the lines used to configure the spread run - which appear before and after a spread run - """ - - def __init__(self, setup_type, source_line): - self.type = SETUP - self.setup_type = setup_type - self.source_line = source_line - - def __repr__(self): - return self.source_line - - def __dict__(self): - return { - 'type': self.type, - 'setup_type': self.setup_type, - 'source_line': self.source_line - } - -class Result: - """ - Result represents the results for a spread run - The results can be: Successful, failed and aborted - """ - - def __init__(self, result_type, level, number, date, time, - detail, source_line): - self.type = RESULT - self.result_type = result_type - self.level = level - self.number = number - self.time = time - self.date = date - self.detail = detail - self.source_line = source_line - - def __repr__(self): - if self.detail: - return '{}{}'.format(self.source_line, str(self.detail)) - return self.source_line - - def __dict__(self): - prepared_detail = None - if self.detail: - prepared_detail = self.detail.__dict__() - return { - 'type': self.type, - 'date': self.date, - 'time': self.time, - 'result_type': self.result_type, - 'level': self.level, - 'number': self.number, - 'detail': prepared_detail - } - - -class Info: - """ - Info represents the extra tasks information which is included in the - spread log. The info can be: Error, Debug and Warning - """ - - def __init__(self, info_type, verb, task, extra, date, time, - detail, source_line): - self.type = INFO - self.info_type = info_type - self.verb = verb - self.time = time - self.date = date - self.task = task - self.extra = extra - self.detail = detail - self.source_line = source_line - - def __repr__(self): - if self.detail: - return '{}{}'.format(self.source_line, self.detail) - return self.source_line - - def __dict__(self): - prepared_detail = None - if self.detail: - prepared_detail = self.detail.__dict__() - return { - 'type': self.type, - 'date': self.date, - 'time': self.time, - 'info_type': self.info_type, - 'verb': self.verb, - 'task': self.task, - 'extra': self.extra, - 'detail': prepared_detail - } - - -class Detail: - """ - Detail represents the extra lines which are displayed after the info - """ - - def __init__(self, lines_limit, lines): - self.lines_limit = lines_limit - self.lines = lines - - def _get_lines(self): - if self.lines_limit < 0 or self.lines_limit > len(self.lines): - return self.lines - - # Use self.lines_limit-1 because the last line is a '.' and we don't - # want to count it as a line in the log details - return self.lines[-self.lines_limit-1:] - - def __repr__(self): - return ''.join(self._get_lines()) - - def __dict__(self): - return {'lines': self.lines[-self.lines_limit-1:]} - - -class Operation: - """ - Operation represents other actions that the spread running can do while - executing tests like: Rebooting, Discarding, Allocating, Waiting, - Allocated, Connecting, Connected, Sending - """ - - def __init__(self, verb, task, extra, date, time, source_line): - self.type = OPERATION - self.verb = verb - self.time = time - self.extra = extra - self.date = date - self.task = task - self.source_line = source_line - - def __repr__(self): - return self.source_line - - def __dict__(self): - return { - 'type': self.type, - 'date': self.date, - 'time': self.time, - 'verb': self.verb, - 'task': self.task, - 'extra': self.extra - } - - -class LogReader: - """ - LogReader manages the spread log, it allows to read, export and print - """ - def __init__(self, filepath, output_type, lines_limit, store_setup): - self.filepath = filepath - self.output_type = output_type - self.lines_limit = lines_limit - self.store_setup = store_setup - self.lines = [] - self.iter = 0 - self.full_log = [] - - def __repr__(self): - return str(self.__dict__()) - - def __dict__(self): - return {'full_log': self.full_log} - - def print_log(self, details, results): - if not self.full_log: - return - - # Print the details - if details == ALL: - print(''.join(str(x) for x in self.full_log)) - elif details == NONE: - pass - elif details == ERROR: - print(''.join(str(x) for x in self.full_log if x.type == INFO and - x.info_type == ERROR_TYPE)) - elif details == ERROR_DEBUG: - print(''.join(str(x) for x in self.full_log if x.type == INFO and - (x.info_type == ERROR_TYPE or x.info_type == DEBUG_TYPE))) - else: - print(''.join(str(x) for x in self.full_log if x.type == details)) - - # Print the results - if results == ALL: - print(''.join(str(x) for x in self.full_log if x.type == RESULT)) - elif results == NONE: - pass - elif results == FAILED: - print(''.join(str(x) for x in self.full_log if x.type == RESULT and - x.result_type == FAILED_TYPE)) - elif results == ABORTED: - print(''.join(str(x) for x in self.full_log if x.type == RESULT and - x.result_type == ABORTED_TYPE)) - else: - print(''.join(str(x) for x in self.full_log if x.type == RESULT and - x.result_type == SUCCESSFUL_TYPE)) - - def export_log(self, filepath): - prepared_log = [] - for item in self.full_log: - prepared_log.append(item.__dict__()) - with open(filepath, 'w') as json_file: - json.dump(prepared_log, json_file) - - def _next_line(self): - self.iter = self.iter + 1 - return self.lines[self.iter-1] - - def check_log_exists(self): - return os.path.exists(self.filepath) - - def read_spread_log(self): - with open(self.filepath) as filepath: - self.lines = filepath.readlines() - - # Find the start of the log, the log file could include - # initial lines which are not part of the spread log itself - self.iter = 0 - if self.store_setup: - while self.iter < len(self.lines): - line = self._next_line() - if self._match_start(line): - break - else: - setup = self._get_setup(line) - self.full_log.append(setup) - - if self.iter >= len(self.lines): - print("log-parser: log start not found, the log is either empty, corrupted or cut") - sys.exit(1) - - # Then iterate line by line analyzing the log - while self.iter < len(self.lines): - line = self._next_line() - - # The line is a task execution; preparing, executing, restoring - if self._match_task(line): - action = self._get_action(line) - if action: - self.full_log.append(action) - continue - - # The line shows info: error, debug, warning - if self._match_info(line): - info = self._get_info(line) - if info: - self.full_log.append(info) - continue - - # The line is another opertion: Rebooting, Discarding, Allocating - # Waiting, Allocated, Connecting, Connected, Sending' - if self._match_operation(line): - operation = self._get_operation(line) - if operation: - self.full_log.append(operation) - continue - - # The line is a result: Successful, Aborted, Failed - if self._match_result(line): - result = self._get_result(line) - if result: - self.full_log.append(result) - continue - - - def _match_date(self, date): - return re.findall(r'\d{4}-\d{2}-\d{2}', date) - - def _match_time(self, time): - return re.findall(r'\d{2}:\d{2}:\d{2}', time) - - def _match_info(self, line): - parts = line.strip().split(' ') - return len(parts) > 3 and \ - parts[2] in INFO_TYPES and \ - self._match_date(parts[0]) and \ - self._match_time(parts[1]) - - def _match_task(self, line): - parts = line.strip().split(' ') - return len(parts) > 2 and \ - parts[2] in EXEC_VERBS and \ - self._match_date(parts[0]) and \ - self._match_time(parts[1]) - - def _match_start(self, line): - parts = line.strip().split(' ') - return len(parts) > 2 and \ - parts[2] == START and \ - self._match_date(parts[0]) and \ - self._match_time(parts[1]) and \ - SPREAD_FILE in parts[3] - - def _match_operation(self, line): - parts = line.strip().split(' ') - return len(parts) > 2 and \ - parts[2] in OPERATIONS and \ - self._match_date(parts[0]) and \ - self._match_time(parts[1]) - - def _match_result(self, line): - parts = line.strip().split(' ') - return len(parts) > 2 and \ - parts[2] in RESULTS and \ - self._match_date(parts[0]) and \ - self._match_time(parts[1]) - - def _get_detail(self, other_limit=None): - """ - This function is used to get the piece of log which is after the - info lines (error, debug, warning). The detail could also include - a limit of lines to tail the log and show the last lines. - It returns a Detail object included all the lines. - """ - initial_iter = self.iter - while self.iter < len(self.lines): - line = self._next_line() - if self._match_task(line) or self._match_info(line) or \ - self._match_operation(line) or self._match_result(line): - break - if not self.iter == len(self.lines): - self.iter = self.iter - 1 - if not other_limit: - other_limit = self.lines_limit - - return Detail(other_limit, self.lines[initial_iter:self.iter]) - - def _get_info(self, line): - """ - Get the Info object for the error, debug and warning lines including - the details for this - """ - parts = line.strip().split(' ') - if len(parts) < 3: - return None - date = parts[0] - time = parts[1] - info_type = parts[2] - verb = None - task = None - if info_type == WARN_TYPE: - info_type = info_type.split(':')[0] - verb = None - task = None - extra = ' '.join(parts[3:]) - elif info_type == ERROR_TYPE: - verb = parts[3] - task = parts[4] - extra = None - elif info_type == DEBUG_TYPE: - verb = parts[3] - task = parts[5] - extra = None - else: - print('log-parser: detail type not recognized: {}'.format(info_type)) - - detail = self._get_detail() - return Info(info_type, verb, task, extra, date, time, detail, line) - - def _get_result(self, line): - """ Get the Result object including the details for the result - Example of lines: - 2021-11-04 10:51:41 Successful tasks: 10041 - 2021-11-04 10:51:41 Aborted tasks: 2 - 2021-11-04 10:51:41 Failed tasks: 4 - - google:debian-11-64:tests/main/snap-user-service-socket-activation - - google:opensuse-15.2-64:tests/main/disk-space-awareness - - google:ubuntu-core-18-64:tests/main/services-disabled-kept-happy - - google:ubuntu-core-18-64:tests/main/snap-connections - """ - parts = line.strip().split(' ') - if len(parts) < 3: - print(parts) - return None - date = parts[0] - time = parts[1] - result_type = parts[2] - level = parts[3].split(':')[0] - number = parts[-1] - - if result_type == FAILED_TYPE: - detail = self._get_detail(other_limit=-1) - else: - detail = None - - return Result(result_type, level, number.strip(), date, time, detail, - line) - - def _get_action(self, line): - """ - Get the Action object for lines preparing, executing and restoring - Example of lines: - 2021-11-04 10:46:07 Preparing google:ubuntu-20.04-64:tests/completion/snippets:funkyfunc (nov040945-011538)... - 2021-11-04 10:46:09 Executing google:ubuntu-18.04-32:tests/main/document-portal-activation (nov040945-011663) (10019/10047)... - 2021-11-04 10:47:01 Restoring google:ubuntu-20.04-64 (nov040945-011544)... - """ - parts = line.strip().split(' ') - if len(parts) < 3: - return None - date = parts[0] - time = parts[1] - verb = parts[2] - task = parts[3] - return Action(verb, task.split('...')[0], date, time, line) - - def _get_operation(self, line): - """ Get the Operation object for lines rebooting, allocating, etc - Example of lines: - 2021-11-04 09:48:32 Rebooting on nov040945-011632 (google:arch-linux-64) as requested... - 2021-11-04 09:47:47 Allocated google:debian-11-64 (nov040945-011728). - 2021-11-04 09:45:41 Allocating google:arch-linux-64... - 2021-11-04 10:51:32 Discarding google:ubuntu-18.04-32 (nov040945-011692)... - 2021-11-04 09:46:32 Waiting for google:debian-10-64 (nov040945-011516) to boot at 34.138.21.231... - 2021-11-04 09:46:34 Sending project content to google:centos-8-64 (nov040945-011292)... - """ - parts = line.strip().split(' ') - if len(parts) < 3: - return None - date = parts[0] - time = parts[1] - verb = parts[2] - task = None - extra = ' '.join(parts[3:]) - return Operation(verb, task, extra, date, time, line) - - def _get_setup(self, line): - """ Get the setup object for lines initial lines of the log """ - return Setup(BEFORE_TYPE, line) - - -def _make_parser(): - # type: () -> argparse.ArgumentParser - parser = argparse.ArgumentParser( - description=""" -Parse the spread log and generates a file with a standarized output. It also -allows to filter the output by type and define the number of lines to show -for the error/debug/warning output. -""" - ) - parser.add_argument( - "-c", - "--cut", - type=int, - default=1000, - help="maximun number of lines for logs on errors and debug sections", - ) - parser.add_argument( - "-f", - "--format", - type=str, - default="json", - choices=['json'], - help="format for the output", - ) - parser.add_argument( - "-pd", - "--print-details", - type=str, - default=NONE, - choices=[ALL, ERROR, ERROR_DEBUG, OPERATION, ACTION, INFO, NONE], - help="Filter which info to print", - ) - parser.add_argument( - "-pr", - "--print-results", - type=str, - default=NONE, - choices=[ALL, FAILED, ABORTED, SUCCESSFUL, NONE], - help="Filter which results to print", - ) - parser.add_argument( - "-o", - "--output", - default="spread-results.json", - type=str, - help="output file to save the result", - ) - parser.add_argument( - "--store-setup", - action="store_true", - help="will save all the text before the spread run is started", - ) - parser.add_argument( - "logpath", metavar="PATH", help="path to the log to be analyzed" - ) - return parser - - -def main(): - # type: () -> None - parser = _make_parser() - args = parser.parse_args() - - if len(args.logpath) == 0: - parser.print_usage() - parser.exit(0) - - reader = LogReader(args.logpath, args.format, args.cut, args.store_setup) - if not reader.check_log_exists(): - print("log-parser: log not found") - sys.exit(1) - - reader.read_spread_log() - - if args.output: - reader.export_log(args.output) - - reader.print_log(args.print_details, args.print_results) - - -if __name__ == "__main__": - main() diff --git a/tests/lib/tools/suite/log-parser/all-aborted.log.spread b/tests/lib/tools/suite/log-parser/all-aborted.log.spread deleted file mode 100644 index bb64b51cd01..00000000000 --- a/tests/lib/tools/suite/log-parser/all-aborted.log.spread +++ /dev/null @@ -1,46 +0,0 @@ -2021-01-20 12:29:36 Project content is packed for delivery (265.87KB). -2021-01-20 12:29:36 Sequence of jobs produced with -seed=1611145776 -2021-01-20 12:29:36 If killed, discard servers with: spread -reuse-pid=30187 -discard -2021-01-20 12:29:36 Allocating google:ubuntu-21.04-64... -2021-01-20 12:29:37 Allocating google:ubuntu-21.04-64... -2021-01-20 12:29:37 Allocating google:ubuntu-21.04-64... -2021-01-20 12:29:37 Allocating google:ubuntu-21.04-64... -2021-01-20 12:29:37 Allocating google:ubuntu-21.04-64... -2021-01-20 12:29:37 Allocating google:ubuntu-21.04-64... -2021-01-20 12:29:37 Allocating google:ubuntu-21.04-64... -2021-01-20 12:29:37 Allocating google:ubuntu-21.04-64... -2021-01-20 12:29:50 Waiting for google:ubuntu-21.04-64 (jan201229-232006) to boot at 35.196.53.112... -2021-01-20 12:29:51 Waiting for google:ubuntu-21.04-64 (jan201229-232290) to boot at 35.237.111.213... -2021-01-20 12:29:52 Waiting for google:ubuntu-21.04-64 (jan201229-232308) to boot at 104.196.172.222... -2021-01-20 12:29:52 Waiting for google:ubuntu-21.04-64 (jan201229-232314) to boot at 34.75.124.6... -2021-01-20 12:29:52 Waiting for google:ubuntu-21.04-64 (jan201229-232320) to boot at 35.185.0.186... -2021-01-20 12:29:56 Waiting for google:ubuntu-21.04-64 (jan201229-232297) to boot at 34.74.223.99... -2021-01-20 12:29:56 Waiting for google:ubuntu-21.04-64 (jan201229-232303) to boot at 35.231.44.102... -2021-01-20 12:30:00 Waiting for google:ubuntu-21.04-64 (jan201229-232278) to boot at 35.185.82.132... -2021-01-20 12:30:50 Server google:ubuntu-21.04-64 (jan201229-232006) is taking a while to boot... -2021-01-20 12:30:51 Server google:ubuntu-21.04-64 (jan201229-232290) is taking a while to boot... -2021-01-20 12:30:52 Server google:ubuntu-21.04-64 (jan201229-232308) is taking a while to boot... -2021-01-20 12:30:52 Server google:ubuntu-21.04-64 (jan201229-232314) is taking a while to boot... -2021-01-20 12:30:52 Server google:ubuntu-21.04-64 (jan201229-232320) is taking a while to boot... -2021-01-20 12:30:56 Server google:ubuntu-21.04-64 (jan201229-232297) is taking a while to boot... -2021-01-20 12:30:56 Server google:ubuntu-21.04-64 (jan201229-232303) is taking a while to boot... -2021-01-20 12:31:00 Server google:ubuntu-21.04-64 (jan201229-232278) is taking a while to boot... -2021-01-20 12:31:50 Server google:ubuntu-21.04-64 (jan201229-232006) is taking a while to boot... -2021-01-20 12:31:51 Server google:ubuntu-21.04-64 (jan201229-232290) is taking a while to boot... -2021-01-20 12:31:52 Server google:ubuntu-21.04-64 (jan201229-232308) is taking a while to boot... -2021-01-20 12:31:52 Server google:ubuntu-21.04-64 (jan201229-232320) is taking a while to boot... -2021-01-20 12:31:53 Server google:ubuntu-21.04-64 (jan201229-232314) is taking a while to boot... -2021-01-20 12:31:56 Server google:ubuntu-21.04-64 (jan201229-232297) is taking a while to boot... -2021-01-20 12:31:56 Server google:ubuntu-21.04-64 (jan201229-232303) is taking a while to boot... -2021-01-20 12:32:00 Server google:ubuntu-21.04-64 (jan201229-232278) is taking a while to boot... -2021-01-20 12:32:51 Cannot allocate google:ubuntu-21.04-64: cannot allocate new Google server google:ubuntu-21.04-64 (jan201229-232006): cannot find ready marker in console output for google:ubuntu-21.04-64 (jan201229-232006) -2021-01-20 12:32:51 Cannot allocate google:ubuntu-21.04-64: cannot allocate new Google server google:ubuntu-21.04-64 (jan201229-232290): cannot find ready marker in console output for google:ubuntu-21.04-64 (jan201229-232290) -2021-01-20 12:32:52 Cannot allocate google:ubuntu-21.04-64: cannot allocate new Google server google:ubuntu-21.04-64 (jan201229-232308): cannot find ready marker in console output for google:ubuntu-21.04-64 (jan201229-232308) -2021-01-20 12:32:52 Cannot allocate google:ubuntu-21.04-64: cannot allocate new Google server google:ubuntu-21.04-64 (jan201229-232314): cannot find ready marker in console output for google:ubuntu-21.04-64 (jan201229-232314) -2021-01-20 12:32:53 Cannot allocate google:ubuntu-21.04-64: cannot allocate new Google server google:ubuntu-21.04-64 (jan201229-232320): cannot find ready marker in console output for google:ubuntu-21.04-64 (jan201229-232320) -2021-01-20 12:32:56 Cannot allocate google:ubuntu-21.04-64: cannot allocate new Google server google:ubuntu-21.04-64 (jan201229-232297): cannot find ready marker in console output for google:ubuntu-21.04-64 (jan201229-232297) -2021-01-20 12:32:57 Cannot allocate google:ubuntu-21.04-64: cannot allocate new Google server google:ubuntu-21.04-64 (jan201229-232303): cannot find ready marker in console output for google:ubuntu-21.04-64 (jan201229-232303) -error: unsuccessful run -2021-01-20 12:33:01 Cannot allocate google:ubuntu-21.04-64: cannot allocate new Google server google:ubuntu-21.04-64 (jan201229-232278): cannot find ready marker in console output for google:ubuntu-21.04-64 (jan201229-232278) -2021-01-20 12:33:01 Successful tasks: 0 -2021-01-20 12:33:01 Aborted tasks: 505 \ No newline at end of file diff --git a/tests/lib/tools/suite/log-parser/all-successful.log.spread b/tests/lib/tools/suite/log-parser/all-successful.log.spread deleted file mode 100644 index c736ff62d90..00000000000 --- a/tests/lib/tools/suite/log-parser/all-successful.log.spread +++ /dev/null @@ -1,112 +0,0 @@ -2021-01-20 12:28:57 Project content is packed for delivery (266.41KB). -2021-01-20 12:28:57 Sequence of jobs produced with -seed=1611145737 -2021-01-20 12:28:57 If killed, discard servers with: spread -reuse-pid=24265 -discard -2021-01-20 12:28:57 Allocating google:centos-8-64... -2021-01-20 12:29:10 Waiting for google:centos-8-64 (jan201228-089626) to boot at 35.229.96.196... -2021-01-20 12:29:33 Sending project content to google:centos-8-64 (jan201228-089626)... -2021-01-20 12:29:33 Connected to google:centos-8-64 (jan201228-089359) at 34.73.106.247. -2021-01-20 12:29:33 Sending project content to google:centos-8-64 (jan201228-089359)... -2021-01-20 12:29:33 Connected to google:centos-8-64 (jan201228-089636) at 35.227.44.209. -2021-01-20 12:29:33 Sending project content to google:centos-8-64 (jan201228-089636)... -2021-01-20 12:29:35 Preparing google:centos-8-64 (jan201228-089626)... -2021-01-20 12:29:35 Preparing google:centos-8-64 (jan201228-089596)... -2021-01-20 12:29:35 Preparing google:centos-8-64 (jan201228-089359)... -2021-01-20 12:29:35 Preparing google:centos-8-64 (jan201228-089636)... -2021-01-20 12:34:36 WARNING: jan201228-089636 (google:centos-8-64) running late. Current output: ------ -(... 376 lines above ...) -pkgconfig(libseccomp) -pkgconfig(libselinux) -pkgconfig(libudev) -pkgconfig(systemd) -pkgconfig(udev) -selinux-policy -selinux-policy-devel -systemd -valgrind -xfsprogs-devel ------ -. -2021-01-20 12:42:47 Restoring google:centos-8-64:tests/completion/snippets:hosts (jan201228-089636)... -2021-01-20 12:42:48 Preparing google:centos-8-64:tests/completion/indirect:func (jan201228-089636)... -2021-01-20 12:42:50 Preparing google:centos-8-64:tests/regression/lp-1844496 (jan201228-089359)... -2021-01-20 12:42:54 Executing google:centos-8-64:tests/completion/indirect:func (jan201228-089636) (2/435)... -2021-01-20 12:42:55 Preparing google:centos-8-64:tests/main/degraded (jan201228-089626)... -2021-01-20 12:43:01 Executing google:centos-8-64:tests/main/degraded (jan201228-089626) (3/435)... -2021-01-20 12:43:01 Restoring google:centos-8-64:tests/main/degraded (jan201228-089626)... -2021-01-20 12:43:02 Preparing google:centos-8-64:tests/main/base-snaps (jan201228-089626)... -2021-01-20 12:43:03 Executing google:centos-8-64:tests/regression/lp-1844496 (jan201228-089359) (4/435)... -2021-01-20 12:43:06 Executing google:centos-8-64:tests/main/base-snaps (jan201228-089626) (5/435)... -2021-01-20 12:43:07 Restoring google:centos-8-64:tests/regression/lp-1844496 (jan201228-089359)... -2021-01-20 12:43:09 Preparing google:centos-8-64:tests/regression/lp-1812973 (jan201228-089359)... -2021-01-20 12:43:15 Executing google:centos-8-64:tests/regression/lp-1812973 (jan201228-089359) (6/435)... -2021-01-20 12:43:16 Restoring google:centos-8-64:tests/regression/lp-1812973 (jan201228-089359)... -2021-01-20 12:43:16 Restoring google:centos-8-64:tests/main/base-snaps (jan201228-089626)... -2021-01-20 12:43:17 Preparing google:centos-8-64:tests/main/snap-validate-basic (jan201228-089626)... -2021-01-20 12:43:18 Preparing google:centos-8-64:tests/regression/lp-1665004 (jan201228-089359)... -2021-01-20 12:43:22 Executing google:centos-8-64:tests/main/snap-validate-basic (jan201228-089626) (7/435)... -2021-01-20 12:43:22 Restoring google:centos-8-64:tests/main/snap-validate-basic (jan201228-089626)... -2021-01-20 12:43:23 Preparing google:centos-8-64:tests/main/interfaces-broadcom-asic-control (jan201228-089596)... -2021-01-20 12:43:23 Preparing google:centos-8-64:tests/main/media-sharing (jan201228-089626)... -2021-01-20 12:43:24 Executing google:centos-8-64:tests/regression/lp-1665004 (jan201228-089359) (8/435)... -2021-01-20 12:43:24 Restoring google:centos-8-64:tests/regression/lp-1665004 (jan201228-089359)... -2021-01-20 12:43:25 Preparing google:centos-8-64:tests/regression/lp-1797556 (jan201228-089359)... -2021-01-20 12:43:30 Executing google:centos-8-64:tests/main/interfaces-broadcom-asic-control (jan201228-089596) (9/435)... -2021-01-20 12:43:32 Executing google:centos-8-64:tests/regression/lp-1797556 (jan201228-089359) (10/435)... -2021-01-20 12:43:32 Restoring google:centos-8-64:tests/regression/lp-1797556 (jan201228-089359)... -2021-01-20 12:43:32 Restoring google:centos-8-64:tests/main/interfaces-broadcom-asic-control (jan201228-089596)... -2021-01-20 12:48:55 Restoring google:centos-8-64:tests/lib/tools/suite/mountinfo.query (jan201228-089359)... -2021-01-20 12:48:56 Preparing google:centos-8-64:tests/lib/tools/suite/tests.pkgs (jan201228-089359)... -2021-01-20 12:48:57 Executing google:centos-8-64:tests/lib/tools/suite/tests.pkgs (jan201228-089359) (90/435)... -2021-01-20 12:48:58 Executing google:centos-8-64:tests/main/security-devpts (jan201228-089596) (91/435)... -2021-01-20 12:49:00 Restoring google:centos-8-64:tests/main/security-devpts (jan201228-089596)... -2021-01-20 12:49:01 Preparing google:centos-8-64:tests/main/interfaces-content-circular (jan201228-089596)... -2021-01-20 12:49:06 Executing google:centos-8-64:tests/main/interfaces-content-circular (jan201228-089596) (92/435)... -2021-01-20 12:49:11 Restoring google:centos-8-64:tests/completion/indirect:funcarg (jan201228-089636)... -2021-01-20 12:49:13 Preparing google:centos-8-64:tests/completion/simple:hosts (jan201228-089636)... -2021-01-20 12:49:17 Restoring google:centos-8-64:tests/main/services-snapctl (jan201228-089626)... -2021-01-20 12:49:17 Executing google:centos-8-64:tests/completion/simple:hosts (jan201228-089636) (93/435)... -2021-01-20 12:49:17 Preparing google:centos-8-64:tests/main/services-refresh-mode (jan201228-089626)... -2021-01-20 12:49:22 Discarding google:centos-8-64 (jan201228-089359)... -2021-01-20 12:49:24 Restoring google:centos-8-64:tests/completion/simple:hosts (jan201228-089636)... -2021-01-20 12:49:24 Preparing google:centos-8-64:tests/completion/indirect:hosts_n_dirs (jan201228-089636)... -2021-01-20 12:49:30 Executing google:centos-8-64:tests/completion/indirect:hosts_n_dirs (jan201228-089636) (94/435)... -2021-01-20 12:49:36 Executing google:centos-8-64:tests/main/services-refresh-mode (jan201228-089626) (95/435)... -2021-01-20 12:49:42 Restoring google:centos-8-64:tests/main/interfaces-content-circular (jan201228-089596)... -2021-01-20 12:49:43 Preparing google:centos-8-64:tests/main/refresh:strict_remote (jan201228-089596)... -2021-01-20 12:53:24 Preparing google:centos-8-64:tests/main/base-snaps-refresh (jan201228-089626)... -2021-01-20 12:53:29 Executing google:centos-8-64:tests/main/base-snaps-refresh (jan201228-089626) (124/435)... -2021-01-20 12:53:38 Restoring google:centos-8-64:tests/main/base-snaps-refresh (jan201228-089626)... -2021-01-20 12:53:38 Restoring google:centos-8-64:tests/main/snapd-snap-removal (jan201228-089596)... -2021-01-20 12:53:39 Preparing google:centos-8-64:tests/main/interfaces-daemon-notify (jan201228-089626)... -2021-01-20 12:53:39 Preparing google:centos-8-64:tests/main/interfaces-content-mkdir-writable:data (jan201228-089596)... -2021-01-20 12:53:45 Executing google:centos-8-64:tests/main/interfaces-daemon-notify (jan201228-089626) (125/435)... -2021-01-20 12:53:46 Executing google:centos-8-64:tests/main/interfaces-content-mkdir-writable:data (jan201228-089596) (126/435)... -2021-01-20 12:53:48 Restoring google:centos-8-64:tests/main/interfaces-content-mkdir-writable:data (jan201228-089596)... -2021-01-20 12:53:49 Preparing google:centos-8-64:tests/main/refresh:parallel_strict_remote (jan201228-089596)... -2021-01-20 12:53:56 Restoring google:centos-8-64:tests/completion/indirect:plain_plusdirs (jan201228-089636)... -2021-01-20 12:53:57 Preparing google:centos-8-64:tests/completion/simple:hosts_n_dirs (jan201228-089636)... -2021-01-20 12:53:57 Restoring google:centos-8-64:tests/main/interfaces-daemon-notify (jan201228-089626)... -2021-01-20 12:53:58 Preparing google:centos-8-64:tests/main/core18-configure-hook (jan201228-089626)... -2021-01-20 12:54:01 Executing google:centos-8-64:tests/main/refresh:parallel_strict_remote (jan201228-089596) (127/435)... -2021-01-20 12:54:02 Executing google:centos-8-64:tests/completion/simple:hosts_n_dirs (jan201228-089636) (128/435)... -2021-01-20 12:59:22 Preparing google:centos-8-64:tests/main/interfaces-fuse-support:regular (jan201228-089596)... -2021-01-20 13:29:28 Restoring google:centos-8-64:tests/main/core18-with-hooks (jan201228-089626)... -2021-01-20 13:29:31 Preparing google:centos-8-64:tests/main/proxy (jan201228-089626)... -2021-01-20 13:29:32 Executing google:centos-8-64:tests/main/services-watchdog (jan201228-089596) (434/435)... -2021-01-20 13:29:36 Executing google:centos-8-64:tests/main/proxy (jan201228-089626) (435/435)... -2021-01-20 13:29:38 Restoring google:centos-8-64:tests/main/proxy (jan201228-089626)... -2021-01-20 13:29:39 Restoring google:centos-8-64:tests/main/services-watchdog (jan201228-089596)... -2021-01-20 13:29:39 Restoring google:centos-8-64:tests/main/ (jan201228-089626)... -2021-01-20 13:29:40 Restoring google:centos-8-64:tests/main/ (jan201228-089596)... -2021-01-20 13:29:46 Restoring google:centos-8-64 (jan201228-089626)... -2021-01-20 13:29:47 Restoring google:centos-8-64 (jan201228-089596)... -2021-01-20 13:29:48 Discarding google:centos-8-64 (jan201228-089626)... -2021-01-20 13:29:49 Discarding google:centos-8-64 (jan201228-089596)... -2021-01-20 13:30:03 Restoring google:centos-8-64:tests/main/auto-refresh-retry (jan201228-089636)... -2021-01-20 13:30:04 Restoring google:centos-8-64:tests/main/ (jan201228-089636)... -2021-01-20 13:30:11 Restoring google:centos-8-64 (jan201228-089636)... -2021-01-20 13:30:12 Discarding google:centos-8-64 (jan201228-089636)... -error: unsuccessful run -2021-01-20 13:30:13 Successful tasks: 434 -2021-01-20 13:30:13 Aborted tasks: 0 \ No newline at end of file diff --git a/tests/lib/tools/suite/log-parser/task.yaml b/tests/lib/tools/suite/log-parser/task.yaml deleted file mode 100644 index 6a2c6358227..00000000000 --- a/tests/lib/tools/suite/log-parser/task.yaml +++ /dev/null @@ -1,65 +0,0 @@ -summary: test for the log analyzer tool - -# Github actions agents are just running in bionic and focal -systems: [ubuntu-18.04-64, ubuntu-20.04-64] - -execute: | - "$TESTSTOOLS"/log-parser --help | grep -qE 'usage: log-parser \[-h\] \[-c CUT\]' - "$TESTSTOOLS"/log-parser -h | grep -qE 'usage: log-parser \[-h\] \[-c CUT\]' - - # Check results when the log just contains successful tests - "$TESTSTOOLS"/log-parser all-successful.log.spread - TESTS_SUCCESSFUL=$(jq -r '.[] | select( .type == "result") | select( .result_type == "Successful") | .number' spread-results.json) - test "$TESTS_SUCCESSFUL" = "434" - - # Check results when the log contains failed tests - "$TESTSTOOLS"/log-parser with-failed.log.spread - TESTS_SUCCESSFUL=$(jq -r '.[] | select( .type == "result") | select( .result_type == "Successful") | .number' spread-results.json) - TESTS_FAILED=$(jq -r '.[] | select( .type == "result") | select( .result_type == "Failed") | .number' spread-results.json) - test "$TESTS_SUCCESSFUL" = "434" - test "$TESTS_FAILED" = "1" - - # Check results when the log contains failed tests - "$TESTSTOOLS"/log-parser all-aborted.log.spread - TESTS_SUCCESSFUL=$(jq -r '.[] | select( .type == "result") | select( .result_type == "Successful") | .number' spread-results.json) - TESTS_FAILED=$(jq -r '.[] | select( .type == "result") | select( .result_type == "Failed") | .number' spread-results.json) - TESTS_ABORTED=$(jq -r '.[] | select( .type == "result") | select( .result_type == "Aborted") | .number' spread-results.json) - test "$TESTS_SUCCESSFUL" = "0" - test -z "$TESTS_FAILED" - test "$TESTS_ABORTED" = "505" - - # Check results when the log contains aborted, failed and successful TESTS - "$TESTSTOOLS"/log-parser with-failed-and-aborted.log.spread - TESTS_SUCCESSFUL=$(jq -r '.[] | select( .type == "result") | select( .result_type == "Successful") | .number' spread-results.json) - TESTS_FAILED_TASKS=$(jq -r '.[] | select( .type == "result") | select( .result_type == "Failed") | select(.level == "tasks") | .number' spread-results.json) - TESTS_FAILED_TASK=$(jq -r '.[] | select( .type == "result") | select( .result_type == "Failed") | select(.level == "task") | .number' spread-results.json) - TESTS_FAILED_PROJECT=$(jq -r '.[] | select( .type == "result") | select( .result_type == "Failed") | select(.level == "project") | .number' spread-results.json) - TESTS_ABORTED=$(jq -r '.[] | select( .type == "result") | select( .result_type == "Aborted") | .number' spread-results.json) - test "$TESTS_SUCCESSFUL" = "400" - test "$TESTS_FAILED_TASKS" = "1" - test "$TESTS_FAILED_TASK" = "1" - test "$TESTS_FAILED_PROJECT" = "4" - test "$TESTS_ABORTED" = "24" - - # Check the filter - test "$("$TESTSTOOLS"/log-parser with-failed-and-aborted.log.spread -pd error | grep -c "Error preparing")" -eq 5 - test "$("$TESTSTOOLS"/log-parser with-failed-and-aborted.log.spread -pd error | grep -c "command -v restorecon")" -eq 4 - - # Check the filter cuting the logs - test "$("$TESTSTOOLS"/log-parser with-failed-and-aborted.log.spread -pd error | wc -l)" -eq 184 - test "$("$TESTSTOOLS"/log-parser with-failed-and-aborted.log.spread -pd error -c 0 | wc -l)" -eq 14 - test "$("$TESTSTOOLS"/log-parser with-failed-and-aborted.log.spread -pd error -c 0 | grep -c "Error preparing")" -eq 5 - test "$("$TESTSTOOLS"/log-parser with-failed-and-aborted.log.spread -pd error -c 0 | grep -c "")" -eq 0 - test "$("$TESTSTOOLS"/log-parser with-failed-and-aborted.log.spread -pd error -c 2 | wc -l)" -eq 26 - test "$("$TESTSTOOLS"/log-parser with-failed-and-aborted.log.spread -pd error -c 2 | grep -c "Error preparing")" -eq 5 - test "$("$TESTSTOOLS"/log-parser with-failed-and-aborted.log.spread -pd error -c 2 | grep -c "")" -eq 5 - test "$("$TESTSTOOLS"/log-parser with-failed-and-aborted.log.spread -pd error -c 3 | wc -l)" -eq 32 - test "$("$TESTSTOOLS"/log-parser with-failed-and-aborted.log.spread -pd error -c 3 | grep -c "Error preparing")" -eq 5 - test "$("$TESTSTOOLS"/log-parser with-failed-and-aborted.log.spread -pd error -c 3 | grep -c "")" -eq 5 - - # Check the results can be filtered - "$TESTSTOOLS"/log-parser with-failed-and-aborted.log.spread -pr failed | grep -q "Failed tasks: 1" - "$TESTSTOOLS"/log-parser with-failed-and-aborted.log.spread -pr failed | grep -c "Failed project prepare: 4" - "$TESTSTOOLS"/log-parser with-failed-and-aborted.log.spread -pr aborted | grep -c "Aborted tasks: 24" - "$TESTSTOOLS"/log-parser all-successful.log.spread -pr successful | grep -q "Successful tasks: 434" - "$TESTSTOOLS"/log-parser all-successful.log.spread -pr failed | grep -v "Aborted tasks" diff --git a/tests/lib/tools/suite/log-parser/with-failed-and-aborted.log.spread b/tests/lib/tools/suite/log-parser/with-failed-and-aborted.log.spread deleted file mode 100644 index a5e0aeb8093..00000000000 --- a/tests/lib/tools/suite/log-parser/with-failed-and-aborted.log.spread +++ /dev/null @@ -1,265 +0,0 @@ -2020-11-27 19:30:40 Project content is packed for delivery (169.92KB). -2020-11-27 19:30:40 Sequence of jobs produced with -seed=1606505440 -2020-11-27 19:30:40 If killed, discard servers with: spread -reuse-pid=313960 -discard -2020-11-27 19:30:40 Allocating google:opensuse-tumbleweed-64... -2020-11-27 19:30:40 Allocating google:opensuse-tumbleweed-64... -2020-11-27 19:30:40 Allocating google:opensuse-tumbleweed-64... -2020-11-27 19:30:40 Allocating google:opensuse-tumbleweed-64... -2020-11-27 19:30:40 Allocating google:opensuse-tumbleweed-64... -2020-11-27 19:30:40 Allocating google:opensuse-tumbleweed-64... -2020-11-27 19:30:49 Waiting for google:opensuse-tumbleweed-64 (nov271930-268545) to boot at 35.229.111.181... -2020-11-27 19:30:52 Waiting for google:opensuse-tumbleweed-64 (nov271930-268322) to boot at 35.243.146.54... -2020-11-27 19:30:53 Waiting for google:opensuse-tumbleweed-64 (nov271930-268530) to boot at 35.243.170.137... -2020-11-27 19:30:54 Waiting for google:opensuse-tumbleweed-64 (nov271930-268552) to boot at 34.73.120.227... -2020-11-27 19:30:54 Waiting for google:opensuse-tumbleweed-64 (nov271930-268558) to boot at 35.237.32.105... -2020-11-27 19:30:54 Waiting for google:opensuse-tumbleweed-64 (nov271930-268563) to boot at 34.74.49.214... -2020-11-27 19:31:29 Allocated google:opensuse-tumbleweed-64 (nov271930-268530). -2020-11-27 19:31:29 Connecting to google:opensuse-tumbleweed-64 (nov271930-268530)... -2020-11-27 19:31:29 Connected to google:opensuse-tumbleweed-64 (nov271930-268530) at 35.243.170.137. -2020-11-27 19:31:29 Sending project content to google:opensuse-tumbleweed-64 (nov271930-268530)... -2020-11-27 19:31:30 Allocated google:opensuse-tumbleweed-64 (nov271930-268552). -2020-11-27 19:31:30 Connecting to google:opensuse-tumbleweed-64 (nov271930-268552)... -2020-11-27 19:31:30 Connected to google:opensuse-tumbleweed-64 (nov271930-268552) at 34.73.120.227. -2020-11-27 19:31:30 Sending project content to google:opensuse-tumbleweed-64 (nov271930-268552)... -2020-11-27 19:31:30 Allocated google:opensuse-tumbleweed-64 (nov271930-268558). -2020-11-27 19:31:30 Connecting to google:opensuse-tumbleweed-64 (nov271930-268558)... -2020-11-27 19:31:30 Preparing google:opensuse-tumbleweed-64 (nov271930-268530)... -2020-11-27 20:01:27 Preparing google:opensuse-tumbleweed-64:tests/main/user-data-handling (nov271930-268530)... -2020-11-27 20:01:30 Error preparing google:opensuse-tumbleweed-64 (nov271930-268552) : ------ -+ cat -+ mv gai.conf /etc/gai.conf -+ command -v restorecon -+ [[ opensuse-tumbleweed-64 == fedora-* ]] -+ [[ opensuse-tumbleweed-64 == opensuse-* ]] -+ zypper ref -Retrieving repository 'Cloud:Tools (openSUSE_Tumbleweed)' metadata [.done] -Building repository 'Cloud:Tools (openSUSE_Tumbleweed)' cache [....done] -Retrieving repository 'kernel-repo' metadata [..done] -Building repository 'kernel-repo' cache [....done] -Retrieving repository 'repo-debug' metadata [............done] -Building repository 'repo-debug' cache [....done] -Retrieving repository 'repo-non-oss' metadata [..done] -Building repository 'repo-non-oss' cache [....done] -Retrieving repository 'repo-oss' metadata [......done] -Building repository 'repo-oss' cache [....done] -Repository 'repo-update' is up to date. -All repositories have been refreshed. -+ cat -+ [[ opensuse-tumbleweed-64 == arch-* ]] -+ [[ opensuse-tumbleweed-64 == debian-* ]] -+ [[ opensuse-tumbleweed-64 == centos-* ]] -+ [[ opensuse-tumbleweed-64 == ubuntu-* ]] -+ '[' -f current.delta ']' -++ mktemp -+ tf=/tmp/tmp.xq251br0RX -+ case "$SPREAD_SYSTEM" in -+ zypper -q --gpg-auto-import-keys refresh -+ zypper -q install -y xdelta3 curl -+ quiet govendor sync - - ------ -. -2020-11-27 20:01:30 Discarding google:opensuse-tumbleweed-64 (nov271930-268552)... -2020-11-27 20:01:30 Error preparing google:opensuse-tumbleweed-64 (nov271930-268558) : ------ -+ cat -+ mv gai.conf /etc/gai.conf -+ command -v restorecon -+ [[ opensuse-tumbleweed-64 == fedora-* ]] -+ [[ opensuse-tumbleweed-64 == opensuse-* ]] -+ zypper ref -+ go get -u github.com/kardianos/govendor -++ seq 10 -+ for _ in $(seq 10) -+ quiet govendor sync - - ------ -. -2020-11-27 20:01:30 Discarding google:opensuse-tumbleweed-64 (nov271930-268558)... -2020-11-27 20:01:30 Error preparing google:opensuse-tumbleweed-64 (nov271930-268563) : ------ -+ cat -+ mv gai.conf /etc/gai.conf -+ command -v restorecon -+ [[ opensuse-tumbleweed-64 == fedora-* ]] -+ [[ opensuse-tumbleweed-64 == opensuse-* ]] -+ zypper ref -Retrieving repository 'Cloud:Tools (openSUSE_Tumbleweed)' metadata [...done] -Building repository 'Cloud:Tools (openSUSE_Tumbleweed)' cache [....done] -Retrieving repository 'kernel-repo' metadata [..done] -Building repository 'kernel-repo' cache [....done] -+ loginctl enable-linger test -+ loginctl disable-linger test -+ '[' '' = yes ']' -+ case "$SPREAD_SYSTEM" in -++ command -v govendor -+ '[' -z '' ']' -+ rm -rf /home/gopath/src/github.com/kardianos/govendor -+ go get -u github.com/kardianos/govendor -++ seq 10 -+ for _ in $(seq 10) -+ quiet govendor sync - - ------ -. -2020-11-27 20:01:30 Discarding google:opensuse-tumbleweed-64 (nov271930-268563)... -2020-11-27 20:01:30 Error preparing google:opensuse-tumbleweed-64 (nov271930-268545) : ------ -+ cat -+ mv gai.conf /etc/gai.conf -+ command -v restorecon -+ [[ opensuse-tumbleweed-64 == fedora-* ]] -++ command -v govendor -+ '[' -z '' ']' -+ rm -rf /home/gopath/src/github.com/kardianos/govendor -+ go get -u github.com/kardianos/govendor -++ seq 10 -+ for _ in $(seq 10) -+ quiet govendor sync - - ------ -. -2020-11-27 20:01:30 Discarding google:opensuse-tumbleweed-64 (nov271930-268545)... -2020-11-27 20:51:19 Preparing google:opensuse-tumbleweed-64:tests/main/interfaces-kvm (nov271930-268530)... -2020-11-27 20:51:30 Executing google:opensuse-tumbleweed-64:tests/main/interfaces-kvm (nov271930-268530) (338/425)... -2020-11-27 20:51:30 Restoring google:opensuse-tumbleweed-64:tests/main/interfaces-kvm (nov271930-268530)... -2020-11-27 20:51:31 Preparing google:opensuse-tumbleweed-64:tests/main/snap-disconnect (nov271930-268530)... -2020-11-27 20:51:45 Executing google:opensuse-tumbleweed-64:tests/main/snap-disconnect (nov271930-268530) (339/425)... -2020-11-27 20:51:59 Restoring google:opensuse-tumbleweed-64:tests/main/snap-disconnect (nov271930-268530)... -2020-11-27 20:52:00 Preparing google:opensuse-tumbleweed-64:tests/main/services-disable-install-hook (nov271930-268530)... -2020-11-27 20:52:02 Error executing google:opensuse-tumbleweed-64:tests/main/interfaces-x11-unix-socket (nov271930-268322) : ------ -+ echo 'Install test snaps' -Install test snaps -+ /home/gopath/src/github.com/snapcore/snapd/tests/lib/tools/snaps-state install-local x11-client -x11-client 1.0 installed -+ /home/gopath/src/github.com/snapcore/snapd/tests/lib/tools/snaps-state install-local x11-server -x11-server 1.0 installed -+ echo 'Ensure x11 plug is not connected to implicit slot' -Ensure x11 plug is not connected to implicit slot -+ snap disconnect x11-client:x11 -+ echo 'Connect x11-client to x11-server' -Connect x11-client to x11-server -+ snap connect x11-client:x11 x11-server:x11 -+ echo 'The snaps can communicate via the unix domain socket in /tmp' -The snaps can communicate via the unix domain socket in /tmp -+ retry -n 4 --wait 0.5 test -e /tmp/snap.x11-server/tmp/.X11-unix/X0 -+ x11-server -retry: command test -e /tmp/snap.x11-server/tmp/.X11-unix/X0 failed with code 1 -retry: next attempt in 0.5 second(s) (attempt 1 of 4) -+ MATCH 'Hello from xserver' -+ x11-client -nc: create unix socket failed -grep error: pattern not found, got: - - - ------ -. -2020-11-27 20:52:02 Debug output for google:opensuse-tumbleweed-64:tests/main/interfaces-x11-unix-socket (nov271930-268322) : ------ -+ '[' 1 = 1 ']' -+ . /home/gopath/src/github.com/snapcore/snapd/tests/lib/state.sh -++ SNAPD_STATE_PATH=/home/gopath/src/github.com/snapcore/snapd/tests/snapd-state -++ SNAPD_STATE_FILE=/home/gopath/src/github.com/snapcore/snapd/tests/snapd-state/snapd-state.tar -++ RUNTIME_STATE_PATH=/home/gopath/src/github.com/snapcore/snapd/tests/runtime-state -++ SNAPD_ACTIVE_UNITS=/home/gopath/src/github.com/snapcore/snapd/tests/runtime-state/snapd-active-units -++ . /home/gopath/src/github.com/snapcore/snapd/tests/lib/dirs.sh -+++ export SNAP_MOUNT_DIR=/snap -+++ SNAP_MOUNT_DIR=/snap -+++ export LIBEXECDIR=/usr/lib -+++ LIBEXECDIR=/usr/lib -+++ export MEDIA_DIR=/media ------ -. -2020-11-27 20:52:03 Discarding google:opensuse-tumbleweed-64 (nov271930-268322)... -2020-11-27 20:52:06 Executing google:opensuse-tumbleweed-64:tests/main/services-disable-install-hook (nov271930-268530) (340/425)... -2020-11-27 20:52:12 Restoring google:opensuse-tumbleweed-64:tests/main/services-disable-install-hook (nov271930-268530)... -2020-11-27 20:52:13 Preparing google:opensuse-tumbleweed-64:tests/main/snap-debug-state (nov271930-268530)... -2020-11-27 20:52:24 Executing google:opensuse-tumbleweed-64:tests/main/snap-debug-state (nov271930-268530) (341/425)... -2020-11-27 20:52:24 Restoring google:opensuse-tumbleweed-64:tests/main/snap-debug-state (nov271930-268530)... -2020-11-27 20:52:26 Preparing google:opensuse-tumbleweed-64:tests/main/refresh-all (nov271930-268530)... -2020-11-27 20:52:45 Executing google:opensuse-tumbleweed-64:tests/main/refresh-all (nov271930-268530) (342/425)... -2020-11-27 20:53:06 Restoring google:opensuse-tumbleweed-64:tests/main/refresh-all (nov271930-268530)... -2020-11-27 20:53:08 Preparing google:opensuse-tumbleweed-64:tests/main/snap-service (nov271930-268530)... -2020-11-27 20:53:15 Executing google:opensuse-tumbleweed-64:tests/main/snap-service (nov271930-268530) (343/425)... -2020-11-27 20:53:47 Restoring google:opensuse-tumbleweed-64:tests/main/snap-service (nov271930-268530)... -2020-11-27 20:53:48 Preparing google:opensuse-tumbleweed-64:tests/main/snapctl-is-connected (nov271930-268530)... -2020-11-27 20:54:03 Executing google:opensuse-tumbleweed-64:tests/main/snapctl-is-connected (nov271930-268530) (344/425)... -2020-11-27 21:15:00 Preparing google:opensuse-tumbleweed-64:tests/main/install-sideload:reexec0 (nov271930-268530)... -2020-11-27 21:15:04 Error preparing google:opensuse-tumbleweed-64:tests/main/install-sideload:reexec0 (nov271930-268530) : ------ -+ /home/gopath/src/github.com/snapcore/snapd/tests/lib/prepare-restore.sh --prepare-project-each -+ set -e -+ . /home/gopath/src/github.com/snapcore/snapd/tests/lib/quiet.sh -+ . /home/gopath/src/github.com/snapcore/snapd/tests/lib/dirs.sh -++ export SNAP_MOUNT_DIR=/snap -++ SNAP_MOUNT_DIR=/snap -++ export LIBEXECDIR=/usr/lib -++ LIBEXECDIR=/usr/lib -++ export MEDIA_DIR=/media -++ MEDIA_DIR=/media -++ case "$SPREAD_SYSTEM" in -++ export SNAP_MOUNT_DIR=/snap -++ SNAP_MOUNT_DIR=/snap -++ export MEDIA_DIR=/run/media -++ MEDIA_DIR=/run/media -+++ . /etc/os-release -++++ NAME='openSUSE Tumbleweed' -++++ ID=opensuse-tumbleweed -++++ ID_LIKE='opensuse suse' -++++ VERSION_ID=20201107 -++++ PRETTY_NAME='openSUSE Tumbleweed' -++++ ANSI_COLOR='0;32' -++++ CPE_NAME=cpe:/o:opensuse:tumbleweed:20201107 -++++ BUG_REPORT_URL=https://bugs.opensuse.org -++++ HOME_URL=https://www.opensuse.org/ -++++ DOCUMENTATION_URL=https://en.opensuse.org/Portal:Tumbleweed -++++ LOGO=distributor-logo -+++ echo opensuse-tumbleweed -++ '[' opensuse-tumbleweed = opensuse-tumbleweed ']' -++ export LIBEXECDIR=/usr/libexec -++ LIBEXECDIR=/usr/libexec -+ . /home/gopath/src/github.com/snapcore/snapd/tests/lib/pkgdb.sh -++ . /home/gopath/src/github.com/snapcore/snapd/tests/lib/quiet.sh -Stopping snap-core-10475.mount -Stopping snap-core-10475.mount -Removing snap core -Removing snap-core-10475.mount -Stopping snap-core16-46.mount -Stopping snap-core16-46.mount -Removing snap core16 -Removing snap-core16-46.mount -Stopping snap-test\x2dsnapd\x2dsh\x2dcore16-x1.mount -Stopping snap-test\x2dsnapd\x2dsh\x2dcore16-x1.mount -Removing snap test-snapd-sh-core16 -Removing snap-test\x2dsnapd\x2dsh\x2dcore16-x1.mount -Discarding preserved snap namespaces -Removing downloaded snaps -Removing features exported from snapd to helper tools -Final directory cleanup -Removing leftover snap shared state data -Removing snapd catalog cache -Removing extra snap-confine apparmor rules -active ------ -. -2020-11-27 21:15:04 Error debugging google:opensuse-tumbleweed-64:tests/main/install-sideload:reexec0 (nov271930-268530) : EOF -2020-11-27 21:15:04 Discarding google:opensuse-tumbleweed-64 (nov271930-268530)... -error: unsuccessful run -2020-11-27 21:15:04 Successful tasks: 400 -2020-11-27 21:15:04 Aborted tasks: 24 -2020-11-27 21:15:04 Failed tasks: 1 - - google:opensuse-tumbleweed-64:tests/main/interfaces-x11-unix-socket -2020-11-27 21:15:04 Failed task prepare: 1 - - google:opensuse-tumbleweed-64:tests/main/install-sideload:reexec0 -2020-11-27 21:15:04 Failed project prepare: 4 - - google:opensuse-tumbleweed-64:project - - google:opensuse-tumbleweed-64:project - - google:opensuse-tumbleweed-64:project - - google:opensuse-tumbleweed-64:project \ No newline at end of file diff --git a/tests/lib/tools/suite/log-parser/with-failed.log.spread b/tests/lib/tools/suite/log-parser/with-failed.log.spread deleted file mode 100644 index a98e1f589fb..00000000000 --- a/tests/lib/tools/suite/log-parser/with-failed.log.spread +++ /dev/null @@ -1,216 +0,0 @@ -2021-01-20 12:28:57 Project content is packed for delivery (266.41KB). -2021-01-20 12:28:57 Sequence of jobs produced with -seed=1611145737 -2021-01-20 12:28:57 If killed, discard servers with: spread -reuse-pid=24265 -discard -2021-01-20 12:28:57 Allocating google:centos-8-64... -2021-01-20 12:29:10 Waiting for google:centos-8-64 (jan201228-089626) to boot at 35.229.96.196... -2021-01-20 12:29:33 Sending project content to google:centos-8-64 (jan201228-089626)... -2021-01-20 12:29:33 Connected to google:centos-8-64 (jan201228-089359) at 34.73.106.247. -2021-01-20 12:29:33 Sending project content to google:centos-8-64 (jan201228-089359)... -2021-01-20 12:29:33 Connected to google:centos-8-64 (jan201228-089636) at 35.227.44.209. -2021-01-20 12:29:33 Sending project content to google:centos-8-64 (jan201228-089636)... -2021-01-20 12:29:35 Preparing google:centos-8-64 (jan201228-089626)... -2021-01-20 12:29:35 Preparing google:centos-8-64 (jan201228-089596)... -2021-01-20 12:29:35 Preparing google:centos-8-64 (jan201228-089359)... -2021-01-20 12:29:35 Preparing google:centos-8-64 (jan201228-089636)... -2021-01-20 12:34:36 WARNING: jan201228-089636 (google:centos-8-64) running late. Current output: ------ -(... 376 lines above ...) -pkgconfig(libseccomp) -pkgconfig(libselinux) -pkgconfig(libudev) -pkgconfig(systemd) -pkgconfig(udev) -selinux-policy -selinux-policy-devel -systemd -valgrind -xfsprogs-devel ------ -. -2021-01-20 12:42:47 Restoring google:centos-8-64:tests/completion/snippets:hosts (jan201228-089636)... -2021-01-20 12:42:48 Preparing google:centos-8-64:tests/completion/indirect:func (jan201228-089636)... -2021-01-20 12:42:50 Preparing google:centos-8-64:tests/regression/lp-1844496 (jan201228-089359)... -2021-01-20 12:42:54 Executing google:centos-8-64:tests/completion/indirect:func (jan201228-089636) (2/435)... -2021-01-20 12:42:55 Preparing google:centos-8-64:tests/main/degraded (jan201228-089626)... -2021-01-20 12:43:01 Executing google:centos-8-64:tests/main/degraded (jan201228-089626) (3/435)... -2021-01-20 12:43:01 Restoring google:centos-8-64:tests/main/degraded (jan201228-089626)... -2021-01-20 12:43:02 Preparing google:centos-8-64:tests/main/base-snaps (jan201228-089626)... -2021-01-20 12:43:03 Executing google:centos-8-64:tests/regression/lp-1844496 (jan201228-089359) (4/435)... -2021-01-20 12:43:06 Executing google:centos-8-64:tests/main/base-snaps (jan201228-089626) (5/435)... -2021-01-20 12:43:07 Restoring google:centos-8-64:tests/regression/lp-1844496 (jan201228-089359)... -2021-01-20 12:43:09 Preparing google:centos-8-64:tests/regression/lp-1812973 (jan201228-089359)... -2021-01-20 12:43:15 Executing google:centos-8-64:tests/regression/lp-1812973 (jan201228-089359) (6/435)... -2021-01-20 12:43:16 Restoring google:centos-8-64:tests/regression/lp-1812973 (jan201228-089359)... -2021-01-20 12:43:16 Restoring google:centos-8-64:tests/main/base-snaps (jan201228-089626)... -2021-01-20 12:43:17 Preparing google:centos-8-64:tests/main/snap-validate-basic (jan201228-089626)... -2021-01-20 12:43:18 Preparing google:centos-8-64:tests/regression/lp-1665004 (jan201228-089359)... -2021-01-20 12:43:22 Executing google:centos-8-64:tests/main/snap-validate-basic (jan201228-089626) (7/435)... -2021-01-20 12:43:22 Restoring google:centos-8-64:tests/main/snap-validate-basic (jan201228-089626)... -2021-01-20 12:43:23 Preparing google:centos-8-64:tests/main/interfaces-broadcom-asic-control (jan201228-089596)... -2021-01-20 12:43:23 Preparing google:centos-8-64:tests/main/media-sharing (jan201228-089626)... -2021-01-20 12:43:24 Executing google:centos-8-64:tests/regression/lp-1665004 (jan201228-089359) (8/435)... -2021-01-20 12:43:24 Restoring google:centos-8-64:tests/regression/lp-1665004 (jan201228-089359)... -2021-01-20 12:43:25 Preparing google:centos-8-64:tests/regression/lp-1797556 (jan201228-089359)... -2021-01-20 12:43:30 Executing google:centos-8-64:tests/main/interfaces-broadcom-asic-control (jan201228-089596) (9/435)... -2021-01-20 12:43:32 Executing google:centos-8-64:tests/regression/lp-1797556 (jan201228-089359) (10/435)... -2021-01-20 12:43:32 Restoring google:centos-8-64:tests/regression/lp-1797556 (jan201228-089359)... -2021-01-20 12:43:32 Restoring google:centos-8-64:tests/main/interfaces-broadcom-asic-control (jan201228-089596)... -2021-01-20 12:48:55 Restoring google:centos-8-64:tests/lib/tools/suite/mountinfo.query (jan201228-089359)... -2021-01-20 12:48:56 Preparing google:centos-8-64:tests/lib/tools/suite/tests.pkgs (jan201228-089359)... -2021-01-20 12:48:57 Executing google:centos-8-64:tests/lib/tools/suite/tests.pkgs (jan201228-089359) (90/435)... -2021-01-20 12:48:58 Executing google:centos-8-64:tests/main/security-devpts (jan201228-089596) (91/435)... -2021-01-20 12:49:00 Restoring google:centos-8-64:tests/main/security-devpts (jan201228-089596)... -2021-01-20 12:49:01 Preparing google:centos-8-64:tests/main/interfaces-content-circular (jan201228-089596)... -2021-01-20 12:49:06 Executing google:centos-8-64:tests/main/interfaces-content-circular (jan201228-089596) (92/435)... -2021-01-20 12:49:11 Restoring google:centos-8-64:tests/completion/indirect:funcarg (jan201228-089636)... -2021-01-20 12:49:13 Preparing google:centos-8-64:tests/completion/simple:hosts (jan201228-089636)... -2021-01-20 12:49:17 Restoring google:centos-8-64:tests/main/services-snapctl (jan201228-089626)... -2021-01-20 12:49:17 Executing google:centos-8-64:tests/completion/simple:hosts (jan201228-089636) (93/435)... -2021-01-20 12:49:17 Preparing google:centos-8-64:tests/main/services-refresh-mode (jan201228-089626)... -2021-01-20 12:49:21 Error executing google:centos-8-64:tests/lib/tools/suite/tests.pkgs (jan201228-089359) : ------ -+ os.query is-core -+ MATCH 'usage: tests.pkgs {install,remove} \[PACKAGE...\]' -+ tests.pkgs -+ tests.pkgs -h -+ MATCH 'usage: tests.pkgs {install,remove} \[PACKAGE...\]' -+ tests.pkgs --help -+ MATCH 'usage: tests.pkgs {install,remove} \[PACKAGE...\]' -+ not tests.pkgs is-installed test-snapd-pkg-1 -+ rpm -qi robotfindskitten -+ tests.pkgs install test-snapd-pkg-1 -++ command -v dnf -+ '[' /usr/bin/dnf '!=' '' ']' -+ dnf install -y robotfindskitten -CentOS-8 - AppStream 3.6 MB/s | 6.3 MB 00:01 -CentOS-8 - Base 5.3 MB/s | 2.3 MB 00:00 -CentOS-8 - Extras 3.5 kB/s | 8.6 kB 00:02 -CentOS-8 - PowerTools 1.3 MB/s | 2.0 MB 00:01 -Extra Packages for Enterprise Linux Modular 8 - 708 kB/s | 537 kB 00:00 -Extra Packages for Enterprise Linux 8 - x86_64 14 MB/s | 8.8 MB 00:00 -Google Compute Engine 8.9 kB/s | 7.4 kB 00:00 -Google Cloud SDK 18 MB/s | 24 MB 00:01 -No match for argument: robotfindskitten -Error: Unable to find a match: robotfindskitten ------ -. -2021-01-20 12:49:22 Debug output for google:centos-8-64:tests/lib/tools/suite/tests.pkgs (jan201228-089359) : ------ -+ '[' 1 = 1 ']' -+ . /home/gopath/src/github.com/snapcore/snapd/tests/lib/state.sh -++ SNAPD_STATE_PATH=/home/gopath/src/github.com/snapcore/snapd/tests/snapd-state -++ SNAPD_STATE_FILE=/home/gopath/src/github.com/snapcore/snapd/tests/snapd-state/snapd-state.tar -++ RUNTIME_STATE_PATH=/home/gopath/src/github.com/snapcore/snapd/tests/runtime-state -++ SNAPD_ACTIVE_UNITS=/home/gopath/src/github.com/snapcore/snapd/tests/runtime-state/snapd-active-units -++ . /home/gopath/src/github.com/snapcore/snapd/tests/lib/dirs.sh -+++ export SNAP_MOUNT_DIR=/snap -+++ SNAP_MOUNT_DIR=/snap -+++ export LIBEXECDIR=/usr/lib -+++ LIBEXECDIR=/usr/lib -+++ export MEDIA_DIR=/media -+++ MEDIA_DIR=/media -+++ case "$SPREAD_SYSTEM" in -+++ export SNAP_MOUNT_DIR=/var/lib/snapd/snap -+++ SNAP_MOUNT_DIR=/var/lib/snapd/snap -+++ export LIBEXECDIR=/usr/libexec -+++ LIBEXECDIR=/usr/libexec -+++ export MEDIA_DIR=/run/media -+++ MEDIA_DIR=/run/media -++ . /home/gopath/src/github.com/snapcore/snapd/tests/lib/systemd.sh -+ . /home/gopath/src/github.com/snapcore/snapd/tests/lib/nested.sh -++ . /home/gopath/src/github.com/snapcore/snapd/tests/lib/systemd.sh -++ . /home/gopath/src/github.com/snapcore/snapd/tests/lib/store.sh -+++ STORE_CONFIG=/etc/systemd/system/snapd.service.d/store.conf -+++ . /home/gopath/src/github.com/snapcore/snapd/tests/lib/systemd.sh -++ NESTED_WORK_DIR=/tmp/work-dir -++ NESTED_IMAGES_DIR=/tmp/work-dir/images -++ NESTED_RUNTIME_DIR=/tmp/work-dir/runtime -++ NESTED_ASSETS_DIR=/tmp/work-dir/assets -++ NESTED_LOGS_DIR=/tmp/work-dir/logs -++ NESTED_VM=nested-vm -++ NESTED_SSH_PORT=8022 -++ NESTED_MON_PORT=8888 -++ NESTED_CUSTOM_MODEL= -++ NESTED_CUSTOM_AUTO_IMPORT_ASSERTION= -++ NESTED_FAKESTORE_BLOB_DIR=/tmp/work-dir/fakestore/blobs -++ NESTED_SIGN_SNAPS_FAKESTORE=false -++ NESTED_UBUNTU_IMAGE_SNAPPY_FORCE_SAS_URL= -+ echo '# System information' -# System information -+ cat /etc/os-release -NAME="CentOS Linux" -VERSION="8 (Core)" -ID="centos" -ID_LIKE="rhel fedora" -VERSION_ID="8" -PLATFORM_ID="platform:el8" -PRETTY_NAME="CentOS Linux 8 (Core)" -ANSI_COLOR="0;31" -CPE_NAME="cpe:/o:centos:centos:8" -HOME_URL="https://www.centos.org/" -BUG_REPORT_URL="https://bugs.centos.org/" - -CENTOS_MANTISBT_PROJECT="CentOS-8" -CENTOS_MANTISBT_PROJECT_VERSION="8" -REDHAT_SUPPORT_PRODUCT="centos" -REDHAT_SUPPORT_PRODUCT_VERSION="8" - -# snap connections --all -+ snap connections --all -/bin/bash: line 129: snap: command not found -+ true -+ echo '# tasks executed on system' -# tasks executed on system -+ cat /home/gopath/src/github.com/snapcore/snapd/tests/runtime-state/runs -google:centos-8-64:tests/regression/lp-1844496 google:centos-8-64:tests/regression/lp-1812973 google:centos-8-64:tests/regression/lp-1665004 google:centos-8-64:tests/regression/lp-1797556 google:centos-8-64:tests/regression/lp-1803542:private google:centos-8-64:tests/regression/lp-1848567 google:centos-8-64:tests/regression/lp-1803535 google:centos-8-64:tests/regression/lp-1630479 google:centos-8-64:tests/regression/lp-1891371 google:centos-8-64:tests/regression/lp-1898038 google:centos-8-64:tests/regression/lp-1825883 google:centos-8-64:tests/regression/lp-1615113 google:centos-8-64:tests/regression/lp-1862637 google:centos-8-64:tests/regression/lp-1852361 google:centos-8-64:tests/regression/rhbz-1708991 google:centos-8-64:tests/regression/lp-1808821 google:centos-8-64:tests/regression/lp-1801955 google:centos-8-64:tests/regression/lp-1732555 google:centos-8-64:tests/regression/lp-1803542:shared google:centos-8-64:tests/regression/lp-1831010 google:centos-8-64:tests/regression/lp-1597839 google:centos-8-64:tests/regression/lp-1606277 google:centos-8-64:tests/regression/lp-1805838 google:centos-8-64:tests/regression/lp-1800004 google:centos-8-64:tests/regression/lp-1607796 google:centos-8-64:tests/regression/lp-1597842 google:centos-8-64:tests/regression/lp-1815722 google:centos-8-64:tests/regression/lp-1886786 google:centos-8-64:tests/regression/lp-1693042 google:centos-8-64:tests/regression/lp-1764977 google:centos-8-64:tests/regression/lp-1618683 google:centos-8-64:tests/regression/lp-1803542:absent google:centos-8-64:tests/regression/lp-1803542:present google:centos-8-64:tests/regression/lp-1849845 google:centos-8-64:tests/lib/tools/suite/mountinfo.query google:centos-8-64:tests/lib/tools/suite/tests.pkgs + echo '# free space' -# /var/lib/snapd -+ find /var/lib/snapd/ -not -path '/var/lib/snapd/snap/*' -ls -find: ‘/var/lib/snapd/’: No such file or directory -+ true ------ -. -2021-01-20 12:49:22 Discarding google:centos-8-64 (jan201228-089359)... -2021-01-20 12:49:24 Restoring google:centos-8-64:tests/completion/simple:hosts (jan201228-089636)... -2021-01-20 12:49:24 Preparing google:centos-8-64:tests/completion/indirect:hosts_n_dirs (jan201228-089636)... -2021-01-20 12:49:30 Executing google:centos-8-64:tests/completion/indirect:hosts_n_dirs (jan201228-089636) (94/435)... -2021-01-20 12:49:36 Executing google:centos-8-64:tests/main/services-refresh-mode (jan201228-089626) (95/435)... -2021-01-20 12:49:42 Restoring google:centos-8-64:tests/main/interfaces-content-circular (jan201228-089596)... -2021-01-20 12:49:43 Preparing google:centos-8-64:tests/main/refresh:strict_remote (jan201228-089596)... -2021-01-20 12:53:24 Preparing google:centos-8-64:tests/main/base-snaps-refresh (jan201228-089626)... -2021-01-20 12:53:29 Executing google:centos-8-64:tests/main/base-snaps-refresh (jan201228-089626) (124/435)... -2021-01-20 12:53:38 Restoring google:centos-8-64:tests/main/base-snaps-refresh (jan201228-089626)... -2021-01-20 12:53:38 Restoring google:centos-8-64:tests/main/snapd-snap-removal (jan201228-089596)... -2021-01-20 12:53:39 Preparing google:centos-8-64:tests/main/interfaces-daemon-notify (jan201228-089626)... -2021-01-20 12:53:39 Preparing google:centos-8-64:tests/main/interfaces-content-mkdir-writable:data (jan201228-089596)... -2021-01-20 12:53:45 Executing google:centos-8-64:tests/main/interfaces-daemon-notify (jan201228-089626) (125/435)... -2021-01-20 12:53:46 Executing google:centos-8-64:tests/main/interfaces-content-mkdir-writable:data (jan201228-089596) (126/435)... -2021-01-20 12:53:48 Restoring google:centos-8-64:tests/main/interfaces-content-mkdir-writable:data (jan201228-089596)... -2021-01-20 12:53:49 Preparing google:centos-8-64:tests/main/refresh:parallel_strict_remote (jan201228-089596)... -2021-01-20 12:53:56 Restoring google:centos-8-64:tests/completion/indirect:plain_plusdirs (jan201228-089636)... -2021-01-20 12:53:57 Preparing google:centos-8-64:tests/completion/simple:hosts_n_dirs (jan201228-089636)... -2021-01-20 12:53:57 Restoring google:centos-8-64:tests/main/interfaces-daemon-notify (jan201228-089626)... -2021-01-20 12:53:58 Preparing google:centos-8-64:tests/main/core18-configure-hook (jan201228-089626)... -2021-01-20 12:54:01 Executing google:centos-8-64:tests/main/refresh:parallel_strict_remote (jan201228-089596) (127/435)... -2021-01-20 12:54:02 Executing google:centos-8-64:tests/completion/simple:hosts_n_dirs (jan201228-089636) (128/435)... -2021-01-20 12:59:22 Preparing google:centos-8-64:tests/main/interfaces-fuse-support:regular (jan201228-089596)... -2021-01-20 13:29:28 Restoring google:centos-8-64:tests/main/core18-with-hooks (jan201228-089626)... -2021-01-20 13:29:31 Preparing google:centos-8-64:tests/main/proxy (jan201228-089626)... -2021-01-20 13:29:32 Executing google:centos-8-64:tests/main/services-watchdog (jan201228-089596) (434/435)... -2021-01-20 13:29:36 Executing google:centos-8-64:tests/main/proxy (jan201228-089626) (435/435)... -2021-01-20 13:29:38 Restoring google:centos-8-64:tests/main/proxy (jan201228-089626)... -2021-01-20 13:29:39 Restoring google:centos-8-64:tests/main/services-watchdog (jan201228-089596)... -2021-01-20 13:29:39 Restoring google:centos-8-64:tests/main/ (jan201228-089626)... -2021-01-20 13:29:40 Restoring google:centos-8-64:tests/main/ (jan201228-089596)... -2021-01-20 13:29:46 Restoring google:centos-8-64 (jan201228-089626)... -2021-01-20 13:29:47 Restoring google:centos-8-64 (jan201228-089596)... -2021-01-20 13:29:48 Discarding google:centos-8-64 (jan201228-089626)... -2021-01-20 13:29:49 Discarding google:centos-8-64 (jan201228-089596)... -2021-01-20 13:30:03 Restoring google:centos-8-64:tests/main/auto-refresh-retry (jan201228-089636)... -2021-01-20 13:30:04 Restoring google:centos-8-64:tests/main/ (jan201228-089636)... -2021-01-20 13:30:11 Restoring google:centos-8-64 (jan201228-089636)... -2021-01-20 13:30:12 Discarding google:centos-8-64 (jan201228-089636)... -error: unsuccessful run -2021-01-20 13:30:13 Successful tasks: 434 -2021-01-20 13:30:13 Aborted tasks: 0 -2021-01-20 13:30:13 Failed tasks: 1 - - google:centos-8-64:tests/lib/tools/suite/tests.pkgs \ No newline at end of file