-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: re-organize the perf test suite (#13672)
* tests:new perf test to install many snaps with --no-wait and check changes Install different snaps many times based on arch availability. In this scenario all the snaps are installed in parallel and the test checks the system can handel all the installs and remains active. * performance tests reorganization To avoid executing perf tests when the nested tests are executed, the tests have been moved under tests/perf tests/perf/main -> suite with the tests executed in the target device tests/perf/nested -> suite with the tests executed in a nested environment * Update tests/perf/nested/install-many-snaps-no-wait/task.yaml Co-authored-by: Miguel Pires <[email protected]> * Update tests/perf/nested/install-many-snaps-no-wait/task.yaml Co-authored-by: Miguel Pires <[email protected]> * Update tests/perf/main/install-many-snaps-no-wait/task.yaml Co-authored-by: Miguel Pires <[email protected]> * improve logs check and fixes based on review comments * addressing review comments --------- Co-authored-by: Miguel Pires <[email protected]>
- Loading branch information
1 parent
22113fd
commit 9134ef8
Showing
15 changed files
with
159 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
summary: Ensure the system properly handles installing many snaps with the --no-wait flag | ||
|
||
details: | | ||
Install different snaps many times based on arch availability. In this | ||
scenario all the snaps are installed in parallel and the test checks | ||
the system can handel all the installs and ramains running. | ||
kill-timeout: 30m | ||
|
||
execute: | | ||
if [ -z "$NUM_SNAPS" ]; then | ||
NUM_SNAPS=20 | ||
fi | ||
LETTERS="$(echo {a..z})" | ||
INCLUDED=0 | ||
CHANNEL="stable" | ||
SNAP_LIST="" | ||
# shellcheck disable=SC2086 | ||
for letter in $LETTERS; do | ||
if [ "$INCLUDED" = "$NUM_SNAPS" ]; then | ||
echo "already $NUM_SNAPS ready to install, now check other features" | ||
break | ||
fi | ||
snaps="$(snap find --narrow "$letter")" | ||
SNAP_NAMES="$(echo "$snaps" | awk '{if($4~/-/){print $1}}' | tail -n+2)" | ||
for SNAP in $SNAP_NAMES; do | ||
# Get the info from latest/$CHANNEL | ||
# shellcheck disable=SC2153 | ||
if ! CHANNEL_INFO="$(snap info --unicode=never "$SNAP" | grep " latest/$CHANNEL: ")"; then | ||
echo "Snap $SNAP not found" | ||
continue | ||
fi | ||
if echo "$CHANNEL_INFO" | MATCH "$CHANNEL:.*-$"; then | ||
SNAP_LIST="$SNAP_LIST $SNAP" | ||
INCLUDED=$(( INCLUDED + 1 )) | ||
fi | ||
if [ "$INCLUDED" = "$NUM_SNAPS" ]; then | ||
echo "already $NUM_SNAPS included in the list" | ||
break | ||
fi | ||
done | ||
done | ||
echo "Installing snaps: $SNAP_LIST" | ||
# shellcheck disable=SC2086 | ||
for SNAP in $SNAP_LIST; do | ||
snap install --no-wait "--$CHANNEL" "$SNAP" | ||
done | ||
while snap changes | MATCH " (Do |Doing ).*Install \".*\" snap"; do | ||
sleep 1 | ||
done | ||
test "$(snap changes | grep -cE ' Done.*Install \".*\" snap')" -ge "$NUM_SNAPS" | ||
systemctl is-active snapd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
summary: Ensure the system handles properly a installing many snaps with --no-wait parameter | ||
|
||
details: | | ||
Install different snaps many times based on arch availability. In this | ||
scenario all the snaps are installed in parallel and the test checks | ||
the system can handle all the installs and remains running. | ||
systems: [ubuntu-18*, ubuntu-2*] | ||
|
||
environment: | ||
TEST: install-many-snaps-no-wait | ||
NUM_SNAPS: 35 | ||
|
||
execute: | | ||
# Get the nested system to use | ||
NESTED_SPREAD_SYSTEM="$(tests.nested nested-system)" | ||
# Get spread | ||
SPREAD="$(tests.nested download spread)" | ||
# Run spread test | ||
export SPREAD_EXTERNAL_ADDRESS=localhost:8022 | ||
export PERF_NUM_SNAPS="$NUM_SNAPS" | ||
"$SPREAD" external:"$NESTED_SPREAD_SYSTEM":tests/perf/main/"$TEST" |& tee spread.log | ||
#shellcheck source=tests/lib/nested.sh | ||
. "$TESTSLIB/nested.sh" | ||
nested_check_spread_results spread.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
summary: Ensure that commands run when their core provided interfaces are connected | ||
|
||
details: | | ||
Install a test snap that plugs as many core provided interfaces as is | ||
possible and verify the command can run (ie, don't test the interface | ||
functionality itself). This will help catch things like AppArmor | ||
policy syntax errors, seccomp policy parsing, udev querying bugs, etc. | ||
systems: [ubuntu-18*, ubuntu-2*] | ||
|
||
environment: | ||
TEST: install-many-snaps | ||
NUM_SNAPS: 100 | ||
|
||
execute: | | ||
# Get the nested system to use | ||
NESTED_SPREAD_SYSTEM="$(tests.nested nested-system)" | ||
# Get spread | ||
SPREAD="$(tests.nested download spread)" | ||
# Run spread test | ||
export SPREAD_EXTERNAL_ADDRESS=localhost:8022 | ||
export PERF_NUM_SNAPS="$NUM_SNAPS" | ||
"$SPREAD" external:"$NESTED_SPREAD_SYSTEM":tests/perf/main/"$TEST" |& tee spread.log | ||
#shellcheck source=tests/lib/nested.sh | ||
. "$TESTSLIB/nested.sh" | ||
nested_check_spread_results spread.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters