forked from os-autoinst/os-autoinst-distri-opensuse
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New test for checking systemd in WSL
WSL now supports systemd, so there's need to check that we can enable and test it
- Loading branch information
Pablo Herranz Ramírez
committed
Nov 21, 2023
1 parent
7363643
commit 2b31338
Showing
2 changed files
with
41 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
--- | ||
name: wsl_main.yaml | ||
name: wsl_main.yaml | ||
description: > | ||
WSL smoke test on Windows 10 image | ||
conditional_schedule: | ||
enable_systemd: | ||
WSL_SYSTEMD: | ||
'1': | ||
- wsl/enable_systemd | ||
|
||
schedule: | ||
- wsl/boot_windows | ||
- wsl/prepare_wsl | ||
- wsl/install_wsl | ||
- wsl/firstrun | ||
- '{{enable_systemd}}' | ||
- wsl/wsl_cmd_check |
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,33 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright 2012-2023 SUSE LLC | ||
# SPDX-License-Identifier: FSFAP | ||
|
||
# Summary: Configure WSL users | ||
# Maintainer: qa-c <qa-c@suse.de> | ||
|
||
use Mojo::Base qw(windowsbasetest); | ||
use testapi; | ||
use utils qw(enter_cmd_slow); | ||
use version_utils qw(is_opensuse); | ||
use wsl qw(is_fake_scc_url_needed); | ||
|
||
sub run { | ||
my $self = shift; | ||
|
||
assert_screen(['windows_desktop', 'powershell-as-admin-window']); | ||
$self->open_powershell_as_admin if match_has_tag('windows_desktop'); | ||
$self->run_in_powershell(cmd => q(wsl)); | ||
is_fake_scc_url_needed || become_root; | ||
$self->run_in_powershell(cmd => q(ps 1 | grep '/init')); | ||
$self->run_in_powershell(cmd => q(stat /init | grep 'init')); | ||
$self->run_in_powershell(cmd => q(echo -e '[boot]\nsystemd=true' > /etc/wsl.conf)); | ||
$self->run_in_powershell(cmd => q(exit; exit)); | ||
$self->run_in_powershell(cmd => q(wsl --shutdown)); | ||
$self->run_in_powershell(cmd => q(wsl /bin/bash -c "ps 1 | grep '/sbin/init'")); | ||
$self->run_in_powershell(cmd => q(wsl /bin/bash -c "stat /sbin/init | grep 'systemd'")); | ||
$self->run_in_powershell(cmd => q(wsl /bin/bash -c "systemctl list-unit-files --type=service | head -n 20")); | ||
$self->run_in_powershell(cmd => q(wsl /bin/bash -c "exit")); | ||
} | ||
|
||
1; |