Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MicroOS SSH enrollment #20039

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions schedule/microos/supportserver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: microos_supportserver
description: >
Create a support server for multimachine tests
conditional_schedule:
ssh_enroll:
SSH_ENROLL_PAIR:
'1':
- jeos/ssh_enroll
schedule:
- support_server/login
- support_server/setup
- '{{ssh_enroll}}'
- support_server/wait_children
19 changes: 17 additions & 2 deletions tests/jeos/firstrun.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use base "opensusebasetest";
use strict;
use warnings;
use lockapi qw(mutex_create mutex_wait);
use testapi;
use version_utils qw(is_jeos is_sle is_tumbleweed is_leap is_opensuse is_microos is_sle_micro is_vmware is_bootloader_sdboot is_community_jeos);
use Utils::Architectures;
Expand Down Expand Up @@ -273,10 +274,24 @@ sub run {
assert_screen 're-encrypt-finished', 600;
}

# Skip ssh key enrollment (for now)
unless (is_sle || is_sle_micro('<=6.0') || is_leap) {
assert_screen 'jeos-ssh-enroll-or-not', 120;
send_key 'n';
mloviska marked this conversation as resolved.
Show resolved Hide resolved

if (get_var('SSH_ENROLL_PAIR')) {
mutex_wait 'dhcp';
sleep 30; # make sure we have an IP
mutex_create 'SSH_ENROLL_PAIR';
send_key 'y';
assert_screen 'jeos-ssh-enroll-pairing', 600;
assert_screen 'jeos-ssh-enroll-paired', 120;
send_key 'y';
assert_screen 'jeos-ssh-enroll-import', 120;
send_key 'y';
assert_screen 'jeos-ssh-enroll-imported', 120;
send_key 'ret';
} else {
send_key 'n';
}
}

if (is_tumbleweed || is_sle_micro('>6.0') || is_microos) {
Expand Down
27 changes: 27 additions & 0 deletions tests/jeos/ssh_enroll.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# SUSE's openQA tests
#
# Copyright 2024 SUSE LLC
# SPDX-License-Identifier: FSFAP

# Summary: Run a ssh client to test firstboot wizard ssh enrollment feature
# Maintainer: QE-C team <[email protected]>

use base "consoletest";
use strict;
use warnings;
use testapi;
use lockapi qw(mutex_wait);
use mmapi;

sub run {
select_console 'root-console';
script_run("ssh-keygen -t rsa -b 2048 -f id_rsa -N ''");

my $children = get_children();
my $child_id = (keys %$children)[0];
mutex_wait('SSH_ENROLL_PAIR', $child_id);

script_run("ssh -i id_rsa -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root\@10.0.2.15");
}

1;
Loading