Commit 80598445 authored by Harald Sitter's avatar Harald Sitter

properly port all use of internal api to public api

see previous (incomplete) commit
parent c421578a
...@@ -88,9 +88,9 @@ sub script_sudo($$) { ...@@ -88,9 +88,9 @@ sub script_sudo($$) {
# !tty never are cached. e.g. on x11 you could have multiple konsoles but # !tty never are cached. e.g. on x11 you could have multiple konsoles but
# since the sudo cache is per-shell we don't know if there is a cache. # since the sudo cache is per-shell we don't know if there is a cache.
use Scalar::Util 'blessed'; use Scalar::Util 'blessed';
my $class = blessed($self->{consoles}{$testapi::selected_console}); my $class = blessed($self->{consoles}{$testapi::current_console});
my $is_tty = ($class =~ m/ttyConsole/); my $is_tty = ($class =~ m/ttyConsole/);
my $last_auth = $self->{console_sudo_cache}{$testapi::selected_console}; my $last_auth = $self->{console_sudo_cache}{$testapi::current_console};
my $need_auth = (!$is_tty || !$last_auth || (time() - $last_auth >= 4 * 60)); my $need_auth = (!$is_tty || !$last_auth || (time() - $last_auth >= 4 * 60));
# Debug for now. Can be removed when someone stumbles upon this again. # Debug for now. Can be removed when someone stumbles upon this again.
print "sudo cache [tty: $is_tty, last_auth: $last_auth, need auth: $need_auth]:\n"; print "sudo cache [tty: $is_tty, last_auth: $last_auth, need auth: $need_auth]:\n";
...@@ -108,7 +108,7 @@ sub script_sudo($$) { ...@@ -108,7 +108,7 @@ sub script_sudo($$) {
testapi::type_password; testapi::type_password;
testapi::send_key "ret"; testapi::send_key "ret";
$self->{console_sudo_cache}{$testapi::selected_console} = time(); $self->{console_sudo_cache}{$testapi::current_console} = time();
} }
} }
if ($str) { if ($str) {
......
...@@ -97,7 +97,7 @@ sub online { ...@@ -97,7 +97,7 @@ sub online {
return; return;
} }
my $previous_console = $testapi::selected_console; my $previous_console = current_console;
select_console 'log-console'; select_console 'log-console';
assert_script_sudo 'nmcli networking on'; assert_script_sudo 'nmcli networking on';
select_console $previous_console; select_console $previous_console;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment