From 52df9ea0096cc8beff70312dde81213ca082a839 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 25 Mar 2020 20:45:27 +0200 Subject: Change: add new work servers, home access from the outside --- ssh-config.md | 31 +++++++++++++++++++++++++++---- ssh-config.py | 6 ++++++ ssh-config.yaml | 5 ++++- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/ssh-config.md b/ssh-config.md index 7de2def..0cdb0d8 100644 --- a/ssh-config.md +++ b/ssh-config.md @@ -71,6 +71,18 @@ when I run ssh contint2001.wikimedia.org hostname then the output matches /^contint2001$/ ~~~ +## Beta access for scap releasing + +This scenario ensures I can test scap on the beta cluster while +releasing Scap. + +~~~scenario +when I run ssh deployment-deploy01.deployment-prep.eqiad.wmflabs hostname +then the output matches /^deployment-deploy01/ +when I run ssh deployment-cumin02.deployment-prep.eqiad.wmflabs hostname +then the output matches /^deployment-cumin02/ +~~~ + ## Gerrit access For Gerrit, we need more than just a simple ssh command. We need git. @@ -117,12 +129,23 @@ then the directory subplot exists ## Backup server access -I have two backup servers. Check access to both. +I have two remote backup servers. ~~~scenario -when I run ssh holywood2 hostname -then the output matches /^holywood2$/ +when I run ssh nalanda.liw.fi hostname +then the output matches /^nalanda$/ -when I run ssh pergamum hostname +when I run ssh pergamum.geah.org hostname then the output matches /^pergamum$/ ~~~ + +## Accessing my home systems from the outside + +I have a home router that's always on and can act as a jump host for +machines on my home network. This scenario checks I can access them. +This should be run while not on my home network. + +~~~scenario +when I run ssh ext-valkama hostname +then the output matches /^valkama$/ +~~~ diff --git a/ssh-config.py b/ssh-config.py index 66f260d..53dc719 100644 --- a/ssh-config.py +++ b/ssh-config.py @@ -8,6 +8,12 @@ def run_ssh(ctx, host=None, cmd=None): print('context:', ctx.as_dict()) assert_eq(ctx.get('exit'), 0) +def run_ssh_with_jumphost(ctx, jumphost=None, host=None, cmd=None): + _runcmd(ctx, ['ssh', '-J', jumphost, host, cmd]) + if ctx.get('exit') != 0: + print('context:', ctx.as_dict()) + assert_eq(ctx.get('exit'), 0) + def run_git_clone(ctx, repo=None): _runcmd(ctx, ['git', 'clone', repo]) if ctx.get('exit') != 0: diff --git a/ssh-config.yaml b/ssh-config.yaml index 9863c86..606d625 100644 --- a/ssh-config.yaml +++ b/ssh-config.yaml @@ -1,6 +1,9 @@ -- when: I run ssh (?P\S+) (?P.+) +- when: I run ssh (?P\S+) (?P\S+) function: run_ssh +- when: I run ssh -J (?P\S+) (?P\S+) (?P\S+) + function: run_ssh_with_jumphost + - when: I run git clone (?P\S+) function: run_git_clone -- cgit v1.2.1