From 62eedcff9e524ee2bdbd1ca63151e2e94796cd67 Mon Sep 17 00:00:00 2001 From: Maxbey Date: Fri, 18 Nov 2016 18:48:21 +0600 Subject: [PATCH] Rename project to termius. --- .coveragerc | 2 +- .prospector.yaml | 8 +- Dockerfile | 4 +- README.md | 26 ++-- bin/serverauditor | 2 +- bootstrap.sh | 4 +- .../bash/{serverauditor => termius} | 132 +++++++++--------- .../zsh/{_serverauditor => _termius} | 128 ++++++++--------- pavement.py | 2 +- setup.py | 68 ++++----- .../__init__.py | 0 .../account/__init__.py | 0 .../account/commands.py | 10 +- .../account/managers.py | 0 {serverauditor_sshconfig => termius}/app.py | 10 +- .../cloud/__init__.py | 0 .../cloud/client/__init__.py | 0 .../cloud/client/controllers.py | 0 .../cloud/client/cryptor.py | 0 .../cloud/client/transformers/__init__.py | 0 .../cloud/client/transformers/base.py | 0 .../cloud/client/transformers/many.py | 0 .../cloud/client/transformers/mixins.py | 0 .../cloud/client/transformers/single.py | 0 .../cloud/client/transformers/utils.py | 0 .../cloud/commands.py | 12 +- .../core/__init__.py | 0 .../core/api.py | 6 +- .../core/commands/__init__.py | 0 .../core/commands/base.py | 0 .../core/commands/many.py | 0 .../core/commands/mixins.py | 2 +- .../core/commands/single.py | 2 +- .../core/commands/utils.py | 0 .../core/exceptions.py | 0 .../core/models/__init__.py | 0 .../core/models/base.py | 0 .../core/models/terminal.py | 0 .../core/models/utils.py | 0 .../core/settings.py | 0 .../core/signals.py | 0 .../core/storage/__init__.py | 0 .../core/storage/driver.py | 0 .../core/storage/idgenerators.py | 0 .../core/storage/operators.py | 0 .../core/storage/query.py | 0 .../core/storage/strategies.py | 0 .../core/subscribers.py | 0 .../core/utils.py | 0 .../formatters/__init__.py | 0 .../formatters/mixins.py | 0 .../formatters/ssh.py | 0 .../handlers/__init__.py | 0 .../handlers/connect.py | 0 .../handlers/group.py | 0 .../handlers/host.py | 0 .../handlers/identity.py | 0 .../handlers/info.py | 2 +- .../handlers/pf_rule.py | 0 .../handlers/snippet.py | 0 .../handlers/ssh_config.py | 0 .../handlers/ssh_key.py | 0 .../handlers/tag.py | 0 .../handlers/taghost.py | 0 {serverauditor_sshconfig => termius}/main.py | 4 +- .../sync/__init__.py | 0 .../sync/commands.py | 2 +- .../sync/providers/__init__.py | 0 .../sync/providers/base.py | 0 .../sync/providers/ssh.py | 0 tests/cloud/client/cryptor_test.py | 2 +- tests/cloud/client/tranformers/many_test.py | 12 +- tests/core/models_test.py | 8 +- tests/core/storage/query_test.py | 2 +- tests/core/storage/storage_test.py | 10 +- tests/integration/complete.bats | 4 +- .../completion/bash/completion_test.py | 18 +-- tests/integration/connect.bats | 4 +- tests/integration/fullclean.bats | 18 +-- tests/integration/group.bats | 62 ++++---- tests/integration/groups.bats | 22 +-- tests/integration/help.bats | 2 +- tests/integration/host.bats | 78 +++++------ tests/integration/hosts.bats | 26 ++-- tests/integration/identities.bats | 10 +- tests/integration/identity.bats | 30 ++-- tests/integration/info.bats | 88 ++++++------ tests/integration/key.bats | 86 ++++++------ tests/integration/keys.bats | 8 +- tests/integration/login.bats | 18 +-- tests/integration/logout.bats | 12 +- tests/integration/pfrule.bats | 78 +++++------ tests/integration/pfrules.bats | 10 +- tests/integration/pull.bats | 16 +-- tests/integration/push.bats | 18 +-- tests/integration/settings.bats | 8 +- tests/integration/snippet.bats | 36 ++--- tests/integration/snippets.bats | 8 +- tests/integration/sync.bats | 6 +- tests/integration/tags.bats | 18 +-- tests/integration/test_helper.bash | 20 +-- tests/sync/providers/ssh_test.py | 12 +- 102 files changed, 588 insertions(+), 588 deletions(-) rename contrib/completion/bash/{serverauditor => termius} (72%) rename contrib/completion/zsh/{_serverauditor => _termius} (80%) rename {serverauditor_sshconfig => termius}/__init__.py (100%) rename {serverauditor_sshconfig => termius}/account/__init__.py (100%) rename {serverauditor_sshconfig => termius}/account/commands.py (92%) rename {serverauditor_sshconfig => termius}/account/managers.py (100%) rename {serverauditor_sshconfig => termius}/app.py (85%) rename {serverauditor_sshconfig => termius}/cloud/__init__.py (100%) rename {serverauditor_sshconfig => termius}/cloud/client/__init__.py (100%) rename {serverauditor_sshconfig => termius}/cloud/client/controllers.py (100%) rename {serverauditor_sshconfig => termius}/cloud/client/cryptor.py (100%) rename {serverauditor_sshconfig => termius}/cloud/client/transformers/__init__.py (100%) rename {serverauditor_sshconfig => termius}/cloud/client/transformers/base.py (100%) rename {serverauditor_sshconfig => termius}/cloud/client/transformers/many.py (100%) rename {serverauditor_sshconfig => termius}/cloud/client/transformers/mixins.py (100%) rename {serverauditor_sshconfig => termius}/cloud/client/transformers/single.py (100%) rename {serverauditor_sshconfig => termius}/cloud/client/transformers/utils.py (100%) rename {serverauditor_sshconfig => termius}/cloud/commands.py (92%) rename {serverauditor_sshconfig => termius}/core/__init__.py (100%) rename {serverauditor_sshconfig => termius}/core/api.py (95%) rename {serverauditor_sshconfig => termius}/core/commands/__init__.py (100%) rename {serverauditor_sshconfig => termius}/core/commands/base.py (100%) rename {serverauditor_sshconfig => termius}/core/commands/many.py (100%) rename {serverauditor_sshconfig => termius}/core/commands/mixins.py (99%) rename {serverauditor_sshconfig => termius}/core/commands/single.py (98%) rename {serverauditor_sshconfig => termius}/core/commands/utils.py (100%) rename {serverauditor_sshconfig => termius}/core/exceptions.py (100%) rename {serverauditor_sshconfig => termius}/core/models/__init__.py (100%) rename {serverauditor_sshconfig => termius}/core/models/base.py (100%) rename {serverauditor_sshconfig => termius}/core/models/terminal.py (100%) rename {serverauditor_sshconfig => termius}/core/models/utils.py (100%) rename {serverauditor_sshconfig => termius}/core/settings.py (100%) rename {serverauditor_sshconfig => termius}/core/signals.py (100%) rename {serverauditor_sshconfig => termius}/core/storage/__init__.py (100%) rename {serverauditor_sshconfig => termius}/core/storage/driver.py (100%) rename {serverauditor_sshconfig => termius}/core/storage/idgenerators.py (100%) rename {serverauditor_sshconfig => termius}/core/storage/operators.py (100%) rename {serverauditor_sshconfig => termius}/core/storage/query.py (100%) rename {serverauditor_sshconfig => termius}/core/storage/strategies.py (100%) rename {serverauditor_sshconfig => termius}/core/subscribers.py (100%) rename {serverauditor_sshconfig => termius}/core/utils.py (100%) rename {serverauditor_sshconfig => termius}/formatters/__init__.py (100%) rename {serverauditor_sshconfig => termius}/formatters/mixins.py (100%) rename {serverauditor_sshconfig => termius}/formatters/ssh.py (100%) rename {serverauditor_sshconfig => termius}/handlers/__init__.py (100%) rename {serverauditor_sshconfig => termius}/handlers/connect.py (100%) rename {serverauditor_sshconfig => termius}/handlers/group.py (100%) rename {serverauditor_sshconfig => termius}/handlers/host.py (100%) rename {serverauditor_sshconfig => termius}/handlers/identity.py (100%) rename {serverauditor_sshconfig => termius}/handlers/info.py (98%) rename {serverauditor_sshconfig => termius}/handlers/pf_rule.py (100%) rename {serverauditor_sshconfig => termius}/handlers/snippet.py (100%) rename {serverauditor_sshconfig => termius}/handlers/ssh_config.py (100%) rename {serverauditor_sshconfig => termius}/handlers/ssh_key.py (100%) rename {serverauditor_sshconfig => termius}/handlers/tag.py (100%) rename {serverauditor_sshconfig => termius}/handlers/taghost.py (100%) rename {serverauditor_sshconfig => termius}/main.py (83%) rename {serverauditor_sshconfig => termius}/sync/__init__.py (100%) rename {serverauditor_sshconfig => termius}/sync/commands.py (97%) rename {serverauditor_sshconfig => termius}/sync/providers/__init__.py (100%) rename {serverauditor_sshconfig => termius}/sync/providers/base.py (100%) rename {serverauditor_sshconfig => termius}/sync/providers/ssh.py (100%) diff --git a/.coveragerc b/.coveragerc index 718b277..5cf6825 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,6 @@ [run] branch = True -include = serverauditor_sshconfig/**.py +include = termius/**.py [report] precision = 2 diff --git a/.prospector.yaml b/.prospector.yaml index f2f5ff2..eca0072 100644 --- a/.prospector.yaml +++ b/.prospector.yaml @@ -8,12 +8,12 @@ ignore-paths: - setup.py - build - tests - - serverauditor_sshconfig/core/ssh_config.py # it's too complex - - serverauditor_sshconfig/core/cryptor.py # it's too complex - - serverauditor_sshconfig/core/utils.py # it's too complex + - termius/core/ssh_config.py # it's too complex + - termius/core/cryptor.py # it's too complex + - termius/core/utils.py # it's too complex ignore-patterns: - - (^|/)(?!serverauditor_sshconfig)?(/|$) + - (^|/)(?!termius)?(/|$) pep257: disable: diff --git a/Dockerfile b/Dockerfile index 716a10d..9ae7503 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,8 +12,8 @@ RUN apt-get update \ git \ && git clone https://github.com/sstephenson/bats.git && cd bats && ./install.sh /usr/local/ && cd - -ADD . /serverauditor +ADD . /termius -WORKDIR /serverauditor +WORKDIR /termius CMD tox diff --git a/README.md b/README.md index 9d41677..0e65403 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Serverauditor ssh config utility +# Termius CLI utility [![Build status](https://travis-ci.org/Crystalnix/serverauditor-sshconfig.svg?branch=master)](https://travis-ci.org/Crystalnix/serverauditor-sshconfig) [![Code Climate](https://codeclimate.com/github/Crystalnix/serverauditor-sshconfig/badges/gpa.svg)](https://codeclimate.com/github/Crystalnix/serverauditor-sshconfig) @@ -10,50 +10,50 @@ ## Installation -Serverauditor ssh config utility can be installed via [pip](http://www.pip-installer.org/en/latest/index.html): +Termius CLI utility can be installed via [pip](http://www.pip-installer.org/en/latest/index.html): ```bash -pip install -U serverauditor-sshconfig +pip install -U termius ``` or [easy_install](http://pythonhosted.org/distribute/): ```bash -easy_install -U serverauditor-sshconfig +easy_install -U termius ``` ## Usage -Login to serverauditor.com +Login to termius.com ```bash -serverauditor login +termius login ``` -Pull data from serverauditor.com +Pull data from termius.com ```bash -serverauditor pull +termius pull ``` Create host ```bash -serverauditor host --address localhost --label myhost +termius host --address localhost --label myhost ``` Connect to host ``` -serverauditor connect myhost +termius connect myhost ``` -Push data to serverauditor.com +Push data to termius.com ```bash -serverauditor push +termius push ``` Create hosts from ssh config ```bash -serverauditor sync ssh +termius sync ssh ``` ## License diff --git a/bin/serverauditor b/bin/serverauditor index 444c35a..cd76f4e 100644 --- a/bin/serverauditor +++ b/bin/serverauditor @@ -1,3 +1,3 @@ #!/usr/bin/env python -from serverauditor_sshconfig.main import main +from termius.main import main main() diff --git a/bootstrap.sh b/bootstrap.sh index db51434..aee7376 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -103,10 +103,10 @@ do_install() { fi easy_install -U $tar_url - if command_exists serverauditor; then + if command_exists termius; then ( set -x - serverauditor --version + termius --version ) || true fi exit 0 diff --git a/contrib/completion/bash/serverauditor b/contrib/completion/bash/termius similarity index 72% rename from contrib/completion/bash/serverauditor rename to contrib/completion/bash/termius index c8b3270..6f49f9b 100644 --- a/contrib/completion/bash/serverauditor +++ b/contrib/completion/bash/termius @@ -1,197 +1,197 @@ -__serverauditor_entity_labels() { - serverauditor $1 -f value -c label +__termius_entity_labels() { + termius $1 -f value -c label } -__serverauditor_get_labels_ids() { +__termius_get_labels_ids() { case $1 in host|group|key|pfrule|snippet) - __serverauditor_entity_labels "$1"s + __termius_entity_labels "$1"s ;; identity) - __serverauditor_entity_labels identities + __termius_entity_labels identities ;; *) return 0 ;; esac } -__serverauditor_subcommand_instance() { +__termius_subcommand_instance() { case $1 in host|group|identity|key|pfrule|snippet) - __serverauditor_get_labels_ids $1 + __termius_get_labels_ids $1 ;; connect) - __serverauditor_complete_connect + __termius_complete_connect ;; info) - __serverauditor_complete_info + __termius_complete_info ;; *) return 0 ;; esac } -__serverauditor_complete_option_value() { +__termius_complete_option_value() { local completion - completion="__serverauditor_complete_options_$1" + completion="__termius_complete_options_$1" if ! type $completion >/dev/null 2>&1; then - __serverauditor_complete_common_options $2 + __termius_complete_common_options $2 else $completion $2 fi } -__serverauditor_complete_connect() { +__termius_complete_connect() { if [[ " ${words[@]} " =~ " -R " ]] || [[ " ${words[@]} " =~ " --pfrule " ]]; then - __serverauditor_get_labels_ids pfrule + __termius_get_labels_ids pfrule else - __serverauditor_get_labels_ids host + __termius_get_labels_ids host fi } -__serverauditor_complete_info() { +__termius_complete_info() { if [[ " ${words[@]} " =~ " -g " ]] || [[ " ${words[@]} " =~ " --group " ]]; then - __serverauditor_get_labels_ids group + __termius_get_labels_ids group else - __serverauditor_get_labels_ids host + __termius_get_labels_ids host fi } -__serverauditor_complete_options_complete() { +__termius_complete_options_complete() { case $1 in --shell) echo bash ;; --name) - echo serverauditor + echo termius ;; *) return 0 ;; esac } -__serverauditor_complete_options_connect() { +__termius_complete_options_connect() { return 0 } -__serverauditor_complete_options_fullclean() { - __serverauditor_complete_common_options $1 +__termius_complete_options_fullclean() { + __termius_complete_common_options $1 } -__serverauditor_complete_options_group() { +__termius_complete_options_group() { case $1 in -g|--parent-group) - __serverauditor_get_labels_ids group + __termius_get_labels_ids group ;; -s|--snippet) - __serverauditor_get_labels_ids snippet + __termius_get_labels_ids snippet ;; --identity) - __serverauditor_get_labels_ids identity + __termius_get_labels_ids identity ;; *) - __serverauditor_complete_common_options $1 + __termius_complete_common_options $1 ;; esac } -__serverauditor_complete_options_groups() { - __serverauditor_complete_common_list_options $1 +__termius_complete_options_groups() { + __termius_complete_common_list_options $1 } -__serverauditor_complete_options_help() { +__termius_complete_options_help() { return 0 } -__serverauditor_complete_options_host() { +__termius_complete_options_host() { case $1 in -g|--group) - __serverauditor_get_labels_ids group + __termius_get_labels_ids group ;; -t|--tag) - __serverauditor_get_labels_ids tag + __termius_get_labels_ids tag ;; -s|--snippet) - __serverauditor_get_labels_ids snippet + __termius_get_labels_ids snippet ;; --identity) - __serverauditor_get_labels_ids identity + __termius_get_labels_ids identity ;; *) - __serverauditor_complete_common_options $1 + __termius_complete_common_options $1 ;; esac } -__serverauditor_complete_options_hosts() { +__termius_complete_options_hosts() { case $1 in -g|--group) - __serverauditor_get_labels_ids group + __termius_get_labels_ids group ;; -t|--tag) - __serverauditor_get_labels_ids tag + __termius_get_labels_ids tag ;; *) - __serverauditor_complete_common_list_options $1 + __termius_complete_common_list_options $1 ;; esac } -__serverauditor_complete_options_identities() { - __serverauditor_complete_common_list_options $1 +__termius_complete_options_identities() { + __termius_complete_common_list_options $1 } -__serverauditor_complete_options_identity() { +__termius_complete_options_identity() { case $1 in -k|--ssh-key) - __serverauditor_get_labels_ids key + __termius_get_labels_ids key ;; *) - __serverauditor_complete_common_options $1 + __termius_complete_common_options $1 ;; esac } -__serverauditor_complete_options_info() { +__termius_complete_options_info() { case $1 in -f|--format) echo json shell ssh table value yaml ;; *) - __serverauditor_complete_common_options $1 + __termius_complete_common_options $1 ;; esac } -__serverauditor_complete_options_keys() { - __serverauditor_complete_common_list_options $1 +__termius_complete_options_keys() { + __termius_complete_common_list_options $1 } -__serverauditor_complete_options_pfrule() { +__termius_complete_options_pfrule() { case $1 in -H|--host) - __serverauditor_get_labels_ids host + __termius_get_labels_ids host ;; *) - __serverauditor_complete_common_options $1 + __termius_complete_common_options $1 ;; esac } -__serverauditor_complete_options_pfrules() { - __serverauditor_complete_common_list_options $1 +__termius_complete_options_pfrules() { + __termius_complete_common_list_options $1 } -__serverauditor_complete_options_snippets() { - __serverauditor_complete_common_list_options $1 +__termius_complete_options_snippets() { + __termius_complete_common_list_options $1 } -__serverauditor_complete_options_tags() { - __serverauditor_complete_common_list_options $1 +__termius_complete_options_tags() { + __termius_complete_common_list_options $1 } -__serverauditor_complete_common_list_options() { +__termius_complete_common_list_options() { case $1 in -f|--format) echo csv json table value yaml ;; *) - __serverauditor_complete_common_options $1 + __termius_complete_common_options $1 ;; esac } -__serverauditor_complete_common_options() { +__termius_complete_common_options() { return 0 } -_serverauditor() +_termius() { local cur prev words COMPREPLY=() @@ -311,10 +311,10 @@ _serverauditor() then COMPREPLY=( $(compgen -f -- ${cur}) ) else - COMPREPLY=( $(compgen -W "$(__serverauditor_complete_option_value $subcommand $prev)" -- ${cur}) ) + COMPREPLY=( $(compgen -W "$(__termius_complete_option_value $subcommand $prev)" -- ${cur}) ) fi else - COMPREPLY=( $(compgen -W "$(__serverauditor_subcommand_instance $subcommand)" -- ${cur}) ) + COMPREPLY=( $(compgen -W "$(__termius_subcommand_instance $subcommand)" -- ${cur}) ) fi else COMPREPLY=( $( compgen -W "" -- "$cur" ) ) @@ -324,5 +324,5 @@ _serverauditor() fi return 0 } -complete -F _serverauditor serverauditor +complete -F _termius termius # vim: ft=sh sw=2 ts=2 et diff --git a/contrib/completion/zsh/_serverauditor b/contrib/completion/zsh/_termius similarity index 80% rename from contrib/completion/zsh/_serverauditor rename to contrib/completion/zsh/_termius index e81b6d3..f980ddc 100644 --- a/contrib/completion/zsh/_serverauditor +++ b/contrib/completion/zsh/_termius @@ -1,18 +1,18 @@ -#compdef serverauditor +#compdef termius -# Serverauditor ZSH completion function +# termius ZSH completion function # Drop this somewhere in your $fpath (like /usr/share/zsh/site-functions) -# and rename it _serverauditor +# and rename it _termius -_serverauditor() { +_termius() { if (( CURRENT > 2 )); then # shift words so _arguments doesn't have to be concerned with second command (( CURRENT-- )) shift words # use _call_function here in case it doesn't exist - _call_function 1 _serverauditor_${words[1]} + _call_function 1 _termius_${words[1]} else - _values "serverauditor command" \ + _values "termius command" \ "complete[Generate shell completion script.]" \ "connect[Connect to host or start port forwarding rule.]" \ "fullclean[Clean local storage and push it.]" \ @@ -26,28 +26,28 @@ _serverauditor() { "info[Display host or group connection arguments.]" \ "key[Ssh key operations.]" \ "keys[List ssh keys.]" \ - "login[Authenticate on serverauditor.com.]" \ - "logout[Remove serverauditor.com credentials.]" \ + "login[Authenticate on termius.com.]" \ + "logout[Remove termius.com credentials.]" \ "pfrule[Port forwarding rule operations.]" \ "pfrules[List port forwarding rules.]" \ - "pull[Retrieve data from serverauditor.com.]" \ + "pull[Retrieve data from termius.com.]" \ "push[Send local changes to serveraudtor.com.]" \ "snippet[Snippet operations.]" \ "snippets[List snippets.]" \ - "sync[Sync IaaS or PaaS service hosts with serverauditor.]" \ + "sync[Sync IaaS or PaaS service hosts with termius.]" \ "tags[List tags.]" \ "settings[Configure application settings.]" fi } -_serverauditor_complete() { +_termius_complete() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ '--name[Name]' \ '--shell[Shell type]:type:(bash)' } -_serverauditor_connect() { +_termius_connect() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -58,10 +58,10 @@ _serverauditor_connect() { '--host[Connect to host]:label:->host' if [[ $state != '' ]]; then - __serverauditor_instances $state + __termius_instances $state fi } -_serverauditor_fullclean() { +_termius_fullclean() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -69,7 +69,7 @@ _serverauditor_fullclean() { '-p[Password]:isnotsecure:()' \ '--password[Password]:isnotsecure:()' } -_serverauditor_settings() { +_termius_settings() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -77,7 +77,7 @@ _serverauditor_settings() { '--agent-forwarding[Enable agent forwarding]:agent_forwarding:(yes no)' \ '--synchronize-key[Enable syncing ssh keys]:synchronize_key:(yes no)' } -_serverauditor_group() { +_termius_group() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -101,14 +101,14 @@ _serverauditor_group() { '--timeout[Set keep alive packages interval]:time (ms)' \ '-p[Set SSH Server port]:port:()' \ '--port[Set SSH Server port]:port:()' \ - "-g[Set parent Group]:group_label:($(__serverauditor_entity 'groups'))" \ - "--parent-group[Set parent Group]:group_label:($(__serverauditor_entity 'groups'))" - "-s[Set startup snippet]:snippet_label:($(__serverauditor_entity 'snippets'))" \ - "--snippet[Set startup snippet]:snippet_label:($(__serverauditor_entity 'snippets'))" \ - "--identity[Set identity]:identity_label:($(__serverauditor_entity 'identities'))" + "-g[Set parent Group]:group_label:($(__termius_entity 'groups'))" \ + "--parent-group[Set parent Group]:group_label:($(__termius_entity 'groups'))" + "-s[Set startup snippet]:snippet_label:($(__termius_entity 'snippets'))" \ + "--snippet[Set startup snippet]:snippet_label:($(__termius_entity 'snippets'))" \ + "--identity[Set identity]:identity_label:($(__termius_entity 'identities'))" } -_serverauditor_groups() { +_termius_groups() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -123,13 +123,13 @@ _serverauditor_groups() { '-r[Display subgroups recursvely]' \ '--recursive[Display subgroups recursvely]' \ } -_serverauditor_help() { +_termius_help() { _arguments \ '1:command:(complete connect fullclean group groups help host hosts identities identity info key keys login logout pfrule pfrules pull push snippet snippets sync tags)' \ '-h[Display help]' \ '--help[Display help]' } -_serverauditor_host() { +_termius_host() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -155,16 +155,16 @@ _serverauditor_host() { '--port[Set SSH Server port]:port:()' \ '-a[Set SSH server address]:hostname:_hosts' \ '--address[Set SSH server address]:hostname:_hosts' \ - "-t[Set Tag]:tag_label:($(__serverauditor_entity 'tags'))" \ - "--tag[Set Tag]:tag_label:($(__serverauditor_entity 'tags'))" \ - "-g[Set Group]:group_label:($(__serverauditor_entity 'groups'))" \ - "--group[Set Group]:group_label:($(__serverauditor_entity 'groups'))" \ - "-s[Set startup snippet]:snippet_label:($(__serverauditor_entity 'snippets'))" \ - "--snippet[Set startup snippet]:snippet_label:($(__serverauditor_entity 'snippets'))" \ - "--identity[Set identity]:identity_label:($(__serverauditor_entity 'identities'))" + "-t[Set Tag]:tag_label:($(__termius_entity 'tags'))" \ + "--tag[Set Tag]:tag_label:($(__termius_entity 'tags'))" \ + "-g[Set Group]:group_label:($(__termius_entity 'groups'))" \ + "--group[Set Group]:group_label:($(__termius_entity 'groups'))" \ + "-s[Set startup snippet]:snippet_label:($(__termius_entity 'snippets'))" \ + "--snippet[Set startup snippet]:snippet_label:($(__termius_entity 'snippets'))" \ + "--identity[Set identity]:identity_label:($(__termius_entity 'identities'))" } -_serverauditor_hosts() { +_termius_hosts() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -176,12 +176,12 @@ _serverauditor_hosts() { '-c[The column(s) to include]:columns:()' \ '--column[The column(s) to include]:columns:()' \ '--quote[When to include quotes]:quote:(all minimal none nonnumeric)' \ - "-t[Filter by tags]:tag_label:($(__serverauditor_entity 'tags'))" \ - "--tag[Filter by tags]:tag_label:($(__serverauditor_entity 'tags'))" \ - "-g[Filter in group]:group_label:($(__serverauditor_entity 'groups'))" \ - "--group[Filter in group]:group_label:($(__serverauditor_entity 'groups'))" + "-t[Filter by tags]:tag_label:($(__termius_entity 'tags'))" \ + "--tag[Filter by tags]:tag_label:($(__termius_entity 'tags'))" \ + "-g[Filter in group]:group_label:($(__termius_entity 'groups'))" \ + "--group[Filter in group]:group_label:($(__termius_entity 'groups'))" } -_serverauditor_identities() { +_termius_identities() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -194,7 +194,7 @@ _serverauditor_identities() { '--column[The column(s) to include]:columns:()' \ '--quote[When to include quotes]:quote:(all minimal none nonnumeric)' } -_serverauditor_identity() { +_termius_identity() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -209,11 +209,11 @@ _serverauditor_identity() { '--password[Host User password]:insecure:()' \ '-i[Identity file - ssh private key file]:filename:_files' \ '--identity-file[Identity file - ssh private key file]:filename:_files' \ - "-k[Set key]:key_label:($(__serverauditor_entity 'keys'))" \ - "--ssh-keySet key]:key_label:($(__serverauditor_entity 'keys'))" + "-k[Set key]:key_label:($(__termius_entity 'keys'))" \ + "--ssh-keySet key]:key_label:($(__termius_entity 'keys'))" } -_serverauditor_info() { +_termius_info() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -231,7 +231,7 @@ _serverauditor_info() { '-f[Output format]:formats:(json shell ssh table value yaml)' \ '--format[Output format]:formats:(json shell ssh table value yaml)' } -_serverauditor_key() { +_termius_key() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -244,7 +244,7 @@ _serverauditor_key() { '--identity-file[Identity file - ssh private key file]:filename:_files' } -_serverauditor_keys() { +_termius_keys() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -257,7 +257,7 @@ _serverauditor_keys() { '--column[The column(s) to include]:columns:()' \ '--quote[When to include quotes]:quote:(all minimal none nonnumeric)' } -_serverauditor_login() { +_termius_login() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -267,13 +267,13 @@ _serverauditor_login() { '-p[Password]:isnotsecure:()' \ '--password[Password]:isnotsecure:()' } -_serverauditor_logout() { +_termius_logout() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ '--log-file[Log to this file]:filename:_files' } -_serverauditor_pfrule() { +_termius_pfrule() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -286,12 +286,12 @@ _serverauditor_pfrule() { '--delete[Delete instances]' \ '-L[Instance label]:label:()' \ '--label[Instance label]:label:()' \ - "-H[Set Host]:host_label:($(__serverauditor_entity 'hosts'))" \ - "--host[Set Host]:host_label:($(__serverauditor_entity 'hosts'))" + "-H[Set Host]:host_label:($(__termius_entity 'hosts'))" \ + "--host[Set Host]:host_label:($(__termius_entity 'hosts'))" } -_serverauditor_pfrules() { +_termius_pfrules() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -304,7 +304,7 @@ _serverauditor_pfrules() { '--column[The column(s) to include]:columns:()' \ '--quote[When to include quotes]:quote:(all minimal none nonnumeric)' } -_serverauditor_pull() { +_termius_pull() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -312,7 +312,7 @@ _serverauditor_pull() { '-p[Password]:isnotsecure:()' \ '--password[Password]:isnotsecure:()' } -_serverauditor_push() { +_termius_push() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -320,7 +320,7 @@ _serverauditor_push() { '-p[Password]:isnotsecure:()' \ '--password[Password]:isnotsecure:()' } -_serverauditor_snippet() { +_termius_snippet() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -333,7 +333,7 @@ _serverauditor_snippet() { '--delete[Delete instances]' } -_serverauditor_snippets() { +_termius_snippets() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -346,7 +346,7 @@ _serverauditor_snippets() { '--column[The column(s) to include]:columns:()' \ '--quote[When to include quotes]:quote:(all minimal none nonnumeric)' } -_serverauditor_sync() { +_termius_sync() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -354,7 +354,7 @@ _serverauditor_sync() { '-c[Credential file]:filename:_files' \ '--credentials[Credential file]:filename:_files' } -_serverauditor_tags() { +_termius_tags() { _arguments \ '-h[Display help]' \ '--help[Display help]' \ @@ -371,29 +371,29 @@ _serverauditor_tags() { } -__serverauditor_entity_labels() { - serverauditor $1 -f csv --quote none -c label -c id | awk 'FS="," {if (NR>1) print $2":[id="$1"]" }' +__termius_entity_labels() { + termius $1 -f csv --quote none -c label -c id | awk 'FS="," {if (NR>1) print $2":[id="$1"]" }' } -__serverauditor_entity() { - serverauditor $1 -f value --quote none -c label +__termius_entity() { + termius $1 -f value --quote none -c label } -__serverauditor_get_labels_ids() { +__termius_get_labels_ids() { case $1 in host|group|key|pfrule|snippet) - __serverauditor_entity_labels "$1"s + __termius_entity_labels "$1"s ;; identity) - __serverauditor_entity_labels identities + __termius_entity_labels identities ;; *) return 0 ;; esac } -__serverauditor_instances() { - instances=($(__serverauditor_get_labels_ids $1)) +__termius_instances() { + instances=($(__termius_get_labels_ids $1)) if [[ "X$instances" != "X" ]]; then _describe -o "instances_$1" instances diff --git a/pavement.py b/pavement.py index 6e09d49..798c23a 100644 --- a/pavement.py +++ b/pavement.py @@ -3,7 +3,7 @@ from paver.easy import task, sh, path # noqa # pylint: disable=invalid-name -cli_command_name = 'serverauditor' +cli_command_name = 'termius' @task diff --git a/setup.py b/setup.py index 43a9735..d767717 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- from setuptools import setup, find_packages -from serverauditor_sshconfig import get_version +from termius import get_version # pylint: disable=invalid-name -cli_command_name = 'serverauditor' +cli_command_name = 'termius' # pylint: disable=invalid-name requires = [ @@ -24,29 +24,29 @@ # pylint: disable=invalid-name handlers = [ - 'sync = serverauditor_sshconfig.sync.commands:SyncCommand', - 'login = serverauditor_sshconfig.account.commands:LoginCommand', - 'logout = serverauditor_sshconfig.account.commands:LogoutCommand', - 'settings = serverauditor_sshconfig.account.commands:SettingsCommand', - 'push = serverauditor_sshconfig.cloud.commands:PushCommand', - 'pull = serverauditor_sshconfig.cloud.commands:PullCommand', - 'fullclean = serverauditor_sshconfig.cloud.commands:FullCleanCommand', - 'snippet = serverauditor_sshconfig.handlers:SnippetCommand', - 'snippets = serverauditor_sshconfig.handlers:SnippetsCommand', - 'host = serverauditor_sshconfig.handlers:HostCommand', - 'hosts = serverauditor_sshconfig.handlers:HostsCommand', - 'identity = serverauditor_sshconfig.handlers:IdentityCommand', - 'identities = serverauditor_sshconfig.handlers:IdentitiesCommand', - 'key = serverauditor_sshconfig.handlers:SshKeyCommand', - 'keys = serverauditor_sshconfig.handlers:SshKeysCommand', - 'group = serverauditor_sshconfig.handlers:GroupCommand', - 'groups = serverauditor_sshconfig.handlers:GroupsCommand', - 'pfrule = serverauditor_sshconfig.handlers:PFRuleCommand', - 'pfrules = serverauditor_sshconfig.handlers:PFRulesCommand', - 'tags = serverauditor_sshconfig.handlers:TagsCommand', - 'info = serverauditor_sshconfig.handlers:InfoCommand', - 'connect = serverauditor_sshconfig.handlers:ConnectCommand', - 'crypto = serverauditor_sshconfig.cloud.commands:CryptoCommand', + 'sync = termius.sync.commands:SyncCommand', + 'login = termius.account.commands:LoginCommand', + 'logout = termius.account.commands:LogoutCommand', + 'settings = termius.account.commands:SettingsCommand', + 'push = termius.cloud.commands:PushCommand', + 'pull = termius.cloud.commands:PullCommand', + 'fullclean = termius.cloud.commands:FullCleanCommand', + 'snippet = termius.handlers:SnippetCommand', + 'snippets = termius.handlers:SnippetsCommand', + 'host = termius.handlers:HostCommand', + 'hosts = termius.handlers:HostsCommand', + 'identity = termius.handlers:IdentityCommand', + 'identities = termius.handlers:IdentitiesCommand', + 'key = termius.handlers:SshKeyCommand', + 'keys = termius.handlers:SshKeysCommand', + 'group = termius.handlers:GroupCommand', + 'groups = termius.handlers:GroupsCommand', + 'pfrule = termius.handlers:PFRuleCommand', + 'pfrules = termius.handlers:PFRulesCommand', + 'tags = termius.handlers:TagsCommand', + 'info = termius.handlers:InfoCommand', + 'connect = termius.handlers:ConnectCommand', + 'crypto = termius.cloud.commands:CryptoCommand', ] @@ -56,15 +56,15 @@ def get_long_description(): setup( - name='serverauditor-sshconfig', + name='termius', version=get_version(), license='BSD', author='Crystalnix', author_email='contacts@crystalnix.com', url='https://github.com/Crystalnix/serverauditor-sshconfig', - description='Serverauditor ssh-config utility.', + description='Termius ssh-config utility.', long_description=get_long_description(), - keywords=['serverauditor', 'crystalnix'], + keywords=['termius', 'crystalnix'], packages=find_packages(exclude=['tests']), install_requires=requires, test_suite='nose.collector', @@ -83,19 +83,19 @@ def get_long_description(): ], entry_points={ 'console_scripts': [ - '{} = serverauditor_sshconfig.main:main'.format(cli_command_name) + '{} = termius.main:main'.format(cli_command_name) ], - 'serverauditor.handlers': handlers, - 'serverauditor.info.formatters': [ - 'ssh = serverauditor_sshconfig.formatters.ssh:SshFormatter', + 'termius.handlers': handlers, + 'termius.info.formatters': [ + 'ssh = termius.formatters.ssh:SshFormatter', 'table = cliff.formatters.table:TableFormatter', 'shell = cliff.formatters.shell:ShellFormatter', 'value = cliff.formatters.value:ValueFormatter', 'yaml = cliff.formatters.yaml_format:YAMLFormatter', 'json = cliff.formatters.json_format:JSONFormatter', ], - 'serverauditor.sync.providers': [ - 'ssh = serverauditor_sshconfig.sync.providers.ssh:SSHService', + 'termius.sync.providers': [ + 'ssh = termius.sync.providers.ssh:SSHService', ], }, ) diff --git a/serverauditor_sshconfig/__init__.py b/termius/__init__.py similarity index 100% rename from serverauditor_sshconfig/__init__.py rename to termius/__init__.py diff --git a/serverauditor_sshconfig/account/__init__.py b/termius/account/__init__.py similarity index 100% rename from serverauditor_sshconfig/account/__init__.py rename to termius/account/__init__.py diff --git a/serverauditor_sshconfig/account/commands.py b/termius/account/commands.py similarity index 92% rename from serverauditor_sshconfig/account/commands.py rename to termius/account/commands.py index 4d7ec32..67d07d1 100644 --- a/serverauditor_sshconfig/account/commands.py +++ b/termius/account/commands.py @@ -39,12 +39,12 @@ def __init__(self, app, app_args, cmd_name=None): class LoginCommand(BaseAccountCommand): - """Sign into serverauditor cloud.""" + """Sign into Termius cloud.""" # pylint: disable=no-self-use def prompt_username(self): """Ask username prompt.""" - return six.moves.input("Serverauditor's username: ") + return six.moves.input("Termius's username: ") def extend_parser(self, parser): """Add more arguments to parser.""" @@ -58,17 +58,17 @@ def take_action(self, parsed_args): password = parsed_args.password or self.prompt_password() with on_clean_when_logout(self, self.manager): self.manager.login(username, password) - self.log.info('Sign into serverauditor cloud.') + self.log.info('Sign into Termius cloud.') class LogoutCommand(BaseAccountCommand): - """Sign out serverauditor cloud.""" + """Sign out Termius cloud.""" def take_action(self, _): """Process CLI call.""" with on_clean_when_logout(self, self.manager): self.manager.logout() - self.log.info('Sign out serverauditor cloud.') + self.log.info('Sign out Termius cloud.') class SettingsCommand(BaseAccountCommand): diff --git a/serverauditor_sshconfig/account/managers.py b/termius/account/managers.py similarity index 100% rename from serverauditor_sshconfig/account/managers.py rename to termius/account/managers.py diff --git a/serverauditor_sshconfig/app.py b/termius/app.py similarity index 85% rename from serverauditor_sshconfig/app.py rename to termius/app.py index 878d5ea..fa6d634 100644 --- a/serverauditor_sshconfig/app.py +++ b/termius/app.py @@ -23,15 +23,15 @@ # pylint: disable=too-few-public-methods -class ServerauditorApp(App): +class TermiusApp(App): """Class for CLI application.""" def __init__(self): """Construct new CLI application.""" - super(ServerauditorApp, self).__init__( - description='Serverauditor app', + super(TermiusApp, self).__init__( + description='Termius app', version=get_version(), - command_manager=CommandManager('serverauditor.handlers'), + command_manager=CommandManager('termius.handlers'), ) self.configure_signals() self.directory_path = Path(expanduser('~/.{}/'.format(self.NAME))) @@ -40,7 +40,7 @@ def __init__(self): def configure_logging(self): """Change logging level for request package.""" - super(ServerauditorApp, self).configure_logging() + super(TermiusApp, self).configure_logging() logging.getLogger('requests').setLevel(logging.WARNING) return diff --git a/serverauditor_sshconfig/cloud/__init__.py b/termius/cloud/__init__.py similarity index 100% rename from serverauditor_sshconfig/cloud/__init__.py rename to termius/cloud/__init__.py diff --git a/serverauditor_sshconfig/cloud/client/__init__.py b/termius/cloud/client/__init__.py similarity index 100% rename from serverauditor_sshconfig/cloud/client/__init__.py rename to termius/cloud/client/__init__.py diff --git a/serverauditor_sshconfig/cloud/client/controllers.py b/termius/cloud/client/controllers.py similarity index 100% rename from serverauditor_sshconfig/cloud/client/controllers.py rename to termius/cloud/client/controllers.py diff --git a/serverauditor_sshconfig/cloud/client/cryptor.py b/termius/cloud/client/cryptor.py similarity index 100% rename from serverauditor_sshconfig/cloud/client/cryptor.py rename to termius/cloud/client/cryptor.py diff --git a/serverauditor_sshconfig/cloud/client/transformers/__init__.py b/termius/cloud/client/transformers/__init__.py similarity index 100% rename from serverauditor_sshconfig/cloud/client/transformers/__init__.py rename to termius/cloud/client/transformers/__init__.py diff --git a/serverauditor_sshconfig/cloud/client/transformers/base.py b/termius/cloud/client/transformers/base.py similarity index 100% rename from serverauditor_sshconfig/cloud/client/transformers/base.py rename to termius/cloud/client/transformers/base.py diff --git a/serverauditor_sshconfig/cloud/client/transformers/many.py b/termius/cloud/client/transformers/many.py similarity index 100% rename from serverauditor_sshconfig/cloud/client/transformers/many.py rename to termius/cloud/client/transformers/many.py diff --git a/serverauditor_sshconfig/cloud/client/transformers/mixins.py b/termius/cloud/client/transformers/mixins.py similarity index 100% rename from serverauditor_sshconfig/cloud/client/transformers/mixins.py rename to termius/cloud/client/transformers/mixins.py diff --git a/serverauditor_sshconfig/cloud/client/transformers/single.py b/termius/cloud/client/transformers/single.py similarity index 100% rename from serverauditor_sshconfig/cloud/client/transformers/single.py rename to termius/cloud/client/transformers/single.py diff --git a/serverauditor_sshconfig/cloud/client/transformers/utils.py b/termius/cloud/client/transformers/utils.py similarity index 100% rename from serverauditor_sshconfig/cloud/client/transformers/utils.py rename to termius/cloud/client/transformers/utils.py diff --git a/serverauditor_sshconfig/cloud/commands.py b/termius/cloud/commands.py similarity index 92% rename from serverauditor_sshconfig/cloud/commands.py rename to termius/cloud/commands.py index da1cbd6..3544c0b 100644 --- a/serverauditor_sshconfig/cloud/commands.py +++ b/termius/cloud/commands.py @@ -48,7 +48,7 @@ def validate_password(self, password): class PushCommand(CloudSynchronizationCommand): - """Push data to Serverauditor cloud.""" + """Push data to Termius cloud.""" get_strategy = RelatedGetStrategy save_strategy = SyncSaveStrategy @@ -57,11 +57,11 @@ def process_sync(self, api_controller): """Push outdated local instances.""" api_controller.put_setting() api_controller.post_bulk() - self.log.info('Push data to Serverauditor cloud.') + self.log.info('Push data to Termius cloud.') class PullCommand(CloudSynchronizationCommand): - """Pull data from Serverauditor cloud.""" + """Pull data from Termius cloud.""" save_strategy = SyncSaveStrategy @@ -69,11 +69,11 @@ def process_sync(self, api_controller): """Pull updated remote instances.""" api_controller.get_settings() api_controller.get_bulk() - self.log.info('Pull data from Serverauditor cloud.') + self.log.info('Pull data from Termius cloud.') class FullCleanCommand(CloudSynchronizationCommand): - """Pull, delete all data and push to Serverauditor cloud.""" + """Pull, delete all data and push to Termius cloud.""" get_strategy = RelatedGetStrategy save_strategy = SyncSaveStrategy @@ -86,7 +86,7 @@ def process_sync(self, api_controller): with self.storage: self.full_clean() api_controller.post_bulk() - self.log.info('Full clean data from Serverauditor cloud.') + self.log.info('Full clean data from Termius cloud.') def full_clean(self): """Remove all local and remote instances.""" diff --git a/serverauditor_sshconfig/core/__init__.py b/termius/core/__init__.py similarity index 100% rename from serverauditor_sshconfig/core/__init__.py rename to termius/core/__init__.py diff --git a/serverauditor_sshconfig/core/api.py b/termius/core/api.py similarity index 95% rename from serverauditor_sshconfig/core/api.py rename to termius/core/api.py index 92f40f4..bf95fe4 100644 --- a/serverauditor_sshconfig/core/api.py +++ b/termius/core/api.py @@ -8,7 +8,7 @@ # pylint: disable=too-few-public-methods -class ServerauditorAuth(AuthBase): +class TermiusAuth(AuthBase): """Authentication method to sync-cloud.""" header_name = 'Authorization' @@ -47,13 +47,13 @@ class API(object): def __init__(self, username=None, apikey=None): """Construct new API instance.""" if username and apikey: - self.auth = ServerauditorAuth(username, apikey) + self.auth = TermiusAuth(username, apikey) else: self.auth = None def set_auth(self, username, apikey): """Provide credentials.""" - self.auth = ServerauditorAuth(username, apikey) + self.auth = TermiusAuth(username, apikey) def request_url(self, endpoint): """Create full url to endpoint.""" diff --git a/serverauditor_sshconfig/core/commands/__init__.py b/termius/core/commands/__init__.py similarity index 100% rename from serverauditor_sshconfig/core/commands/__init__.py rename to termius/core/commands/__init__.py diff --git a/serverauditor_sshconfig/core/commands/base.py b/termius/core/commands/base.py similarity index 100% rename from serverauditor_sshconfig/core/commands/base.py rename to termius/core/commands/base.py diff --git a/serverauditor_sshconfig/core/commands/many.py b/termius/core/commands/many.py similarity index 100% rename from serverauditor_sshconfig/core/commands/many.py rename to termius/core/commands/many.py diff --git a/serverauditor_sshconfig/core/commands/mixins.py b/termius/core/commands/mixins.py similarity index 99% rename from serverauditor_sshconfig/core/commands/mixins.py rename to termius/core/commands/mixins.py index 8d7c05e..f1b8de8 100644 --- a/serverauditor_sshconfig/core/commands/mixins.py +++ b/termius/core/commands/mixins.py @@ -20,7 +20,7 @@ class PasswordPromptMixin(object): # pylint: disable=no-self-use def prompt_password(self): """Ask user to enter password in secure way.""" - return getpass.getpass("Serverauditor's password:") + return getpass.getpass('Termius password:') class GetRelationMixin(object): diff --git a/serverauditor_sshconfig/core/commands/single.py b/termius/core/commands/single.py similarity index 98% rename from serverauditor_sshconfig/core/commands/single.py rename to termius/core/commands/single.py index 478efdc..da78e44 100644 --- a/serverauditor_sshconfig/core/commands/single.py +++ b/termius/core/commands/single.py @@ -63,7 +63,7 @@ def get_parser(self, prog_name): ) parser.add_argument( '-L', '--label', metavar='NAME', - help="Entry's label in Serverauditor" + help="Entry's label in Termius" ) parser.add_argument( 'entry', nargs='*', metavar='ID or NAME', diff --git a/serverauditor_sshconfig/core/commands/utils.py b/termius/core/commands/utils.py similarity index 100% rename from serverauditor_sshconfig/core/commands/utils.py rename to termius/core/commands/utils.py diff --git a/serverauditor_sshconfig/core/exceptions.py b/termius/core/exceptions.py similarity index 100% rename from serverauditor_sshconfig/core/exceptions.py rename to termius/core/exceptions.py diff --git a/serverauditor_sshconfig/core/models/__init__.py b/termius/core/models/__init__.py similarity index 100% rename from serverauditor_sshconfig/core/models/__init__.py rename to termius/core/models/__init__.py diff --git a/serverauditor_sshconfig/core/models/base.py b/termius/core/models/base.py similarity index 100% rename from serverauditor_sshconfig/core/models/base.py rename to termius/core/models/base.py diff --git a/serverauditor_sshconfig/core/models/terminal.py b/termius/core/models/terminal.py similarity index 100% rename from serverauditor_sshconfig/core/models/terminal.py rename to termius/core/models/terminal.py diff --git a/serverauditor_sshconfig/core/models/utils.py b/termius/core/models/utils.py similarity index 100% rename from serverauditor_sshconfig/core/models/utils.py rename to termius/core/models/utils.py diff --git a/serverauditor_sshconfig/core/settings.py b/termius/core/settings.py similarity index 100% rename from serverauditor_sshconfig/core/settings.py rename to termius/core/settings.py diff --git a/serverauditor_sshconfig/core/signals.py b/termius/core/signals.py similarity index 100% rename from serverauditor_sshconfig/core/signals.py rename to termius/core/signals.py diff --git a/serverauditor_sshconfig/core/storage/__init__.py b/termius/core/storage/__init__.py similarity index 100% rename from serverauditor_sshconfig/core/storage/__init__.py rename to termius/core/storage/__init__.py diff --git a/serverauditor_sshconfig/core/storage/driver.py b/termius/core/storage/driver.py similarity index 100% rename from serverauditor_sshconfig/core/storage/driver.py rename to termius/core/storage/driver.py diff --git a/serverauditor_sshconfig/core/storage/idgenerators.py b/termius/core/storage/idgenerators.py similarity index 100% rename from serverauditor_sshconfig/core/storage/idgenerators.py rename to termius/core/storage/idgenerators.py diff --git a/serverauditor_sshconfig/core/storage/operators.py b/termius/core/storage/operators.py similarity index 100% rename from serverauditor_sshconfig/core/storage/operators.py rename to termius/core/storage/operators.py diff --git a/serverauditor_sshconfig/core/storage/query.py b/termius/core/storage/query.py similarity index 100% rename from serverauditor_sshconfig/core/storage/query.py rename to termius/core/storage/query.py diff --git a/serverauditor_sshconfig/core/storage/strategies.py b/termius/core/storage/strategies.py similarity index 100% rename from serverauditor_sshconfig/core/storage/strategies.py rename to termius/core/storage/strategies.py diff --git a/serverauditor_sshconfig/core/subscribers.py b/termius/core/subscribers.py similarity index 100% rename from serverauditor_sshconfig/core/subscribers.py rename to termius/core/subscribers.py diff --git a/serverauditor_sshconfig/core/utils.py b/termius/core/utils.py similarity index 100% rename from serverauditor_sshconfig/core/utils.py rename to termius/core/utils.py diff --git a/serverauditor_sshconfig/formatters/__init__.py b/termius/formatters/__init__.py similarity index 100% rename from serverauditor_sshconfig/formatters/__init__.py rename to termius/formatters/__init__.py diff --git a/serverauditor_sshconfig/formatters/mixins.py b/termius/formatters/mixins.py similarity index 100% rename from serverauditor_sshconfig/formatters/mixins.py rename to termius/formatters/mixins.py diff --git a/serverauditor_sshconfig/formatters/ssh.py b/termius/formatters/ssh.py similarity index 100% rename from serverauditor_sshconfig/formatters/ssh.py rename to termius/formatters/ssh.py diff --git a/serverauditor_sshconfig/handlers/__init__.py b/termius/handlers/__init__.py similarity index 100% rename from serverauditor_sshconfig/handlers/__init__.py rename to termius/handlers/__init__.py diff --git a/serverauditor_sshconfig/handlers/connect.py b/termius/handlers/connect.py similarity index 100% rename from serverauditor_sshconfig/handlers/connect.py rename to termius/handlers/connect.py diff --git a/serverauditor_sshconfig/handlers/group.py b/termius/handlers/group.py similarity index 100% rename from serverauditor_sshconfig/handlers/group.py rename to termius/handlers/group.py diff --git a/serverauditor_sshconfig/handlers/host.py b/termius/handlers/host.py similarity index 100% rename from serverauditor_sshconfig/handlers/host.py rename to termius/handlers/host.py diff --git a/serverauditor_sshconfig/handlers/identity.py b/termius/handlers/identity.py similarity index 100% rename from serverauditor_sshconfig/handlers/identity.py rename to termius/handlers/identity.py diff --git a/serverauditor_sshconfig/handlers/info.py b/termius/handlers/info.py similarity index 98% rename from serverauditor_sshconfig/handlers/info.py rename to termius/handlers/info.py index f0a016e..c776fb9 100644 --- a/serverauditor_sshconfig/handlers/info.py +++ b/termius/handlers/info.py @@ -19,7 +19,7 @@ class InfoCommand(SshConfigMergerMixin, GetRelationMixin, @property def formatter_namespace(self): """Return entrypoint with cliff formatters.""" - return 'serverauditor.info.formatters' + return 'termius.info.formatters' def extend_parser(self, parser): """Add more arguments to parser.""" diff --git a/serverauditor_sshconfig/handlers/pf_rule.py b/termius/handlers/pf_rule.py similarity index 100% rename from serverauditor_sshconfig/handlers/pf_rule.py rename to termius/handlers/pf_rule.py diff --git a/serverauditor_sshconfig/handlers/snippet.py b/termius/handlers/snippet.py similarity index 100% rename from serverauditor_sshconfig/handlers/snippet.py rename to termius/handlers/snippet.py diff --git a/serverauditor_sshconfig/handlers/ssh_config.py b/termius/handlers/ssh_config.py similarity index 100% rename from serverauditor_sshconfig/handlers/ssh_config.py rename to termius/handlers/ssh_config.py diff --git a/serverauditor_sshconfig/handlers/ssh_key.py b/termius/handlers/ssh_key.py similarity index 100% rename from serverauditor_sshconfig/handlers/ssh_key.py rename to termius/handlers/ssh_key.py diff --git a/serverauditor_sshconfig/handlers/tag.py b/termius/handlers/tag.py similarity index 100% rename from serverauditor_sshconfig/handlers/tag.py rename to termius/handlers/tag.py diff --git a/serverauditor_sshconfig/handlers/taghost.py b/termius/handlers/taghost.py similarity index 100% rename from serverauditor_sshconfig/handlers/taghost.py rename to termius/handlers/taghost.py diff --git a/serverauditor_sshconfig/main.py b/termius/main.py similarity index 83% rename from serverauditor_sshconfig/main.py rename to termius/main.py index 63f67ad..99d7cc3 100644 --- a/serverauditor_sshconfig/main.py +++ b/termius/main.py @@ -2,12 +2,12 @@ # -*- coding: utf-8 -*- """Entrypoint for CLI tool.""" import sys -from serverauditor_sshconfig.app import ServerauditorApp +from termius.app import TermiusApp def main(argv=sys.argv[1:]): """Process call from terminal.""" - app = ServerauditorApp() + app = TermiusApp() if sys.version_info < (3,): decoded_argv = [] diff --git a/serverauditor_sshconfig/sync/__init__.py b/termius/sync/__init__.py similarity index 100% rename from serverauditor_sshconfig/sync/__init__.py rename to termius/sync/__init__.py diff --git a/serverauditor_sshconfig/sync/commands.py b/termius/sync/commands.py similarity index 97% rename from serverauditor_sshconfig/sync/commands.py rename to termius/sync/commands.py index 864dca8..fc9a03a 100644 --- a/serverauditor_sshconfig/sync/commands.py +++ b/termius/sync/commands.py @@ -11,7 +11,7 @@ class SyncCommand(AbstractCommand): """Sync with IaaS or PaaS.""" service_manager = ExtensionManager( - namespace='serverauditor.sync.providers' + namespace='termius.sync.providers' ) save_strategy = RelatedSaveStrategy get_strategy = RelatedGetStrategy diff --git a/serverauditor_sshconfig/sync/providers/__init__.py b/termius/sync/providers/__init__.py similarity index 100% rename from serverauditor_sshconfig/sync/providers/__init__.py rename to termius/sync/providers/__init__.py diff --git a/serverauditor_sshconfig/sync/providers/base.py b/termius/sync/providers/base.py similarity index 100% rename from serverauditor_sshconfig/sync/providers/base.py rename to termius/sync/providers/base.py diff --git a/serverauditor_sshconfig/sync/providers/ssh.py b/termius/sync/providers/ssh.py similarity index 100% rename from serverauditor_sshconfig/sync/providers/ssh.py rename to termius/sync/providers/ssh.py diff --git a/tests/cloud/client/cryptor_test.py b/tests/cloud/client/cryptor_test.py index 0380fa7..9c249bd 100644 --- a/tests/cloud/client/cryptor_test.py +++ b/tests/cloud/client/cryptor_test.py @@ -6,7 +6,7 @@ from itertools import product from unittest import TestCase -from serverauditor_sshconfig.cloud.client.cryptor import RNCryptor, CryptorException +from termius.cloud.client.cryptor import RNCryptor, CryptorException def test_dual_encrypt_and_decrypt(): diff --git a/tests/cloud/client/tranformers/many_test.py b/tests/cloud/client/tranformers/many_test.py index 5b3a6c1..ec02a57 100644 --- a/tests/cloud/client/tranformers/many_test.py +++ b/tests/cloud/client/tranformers/many_test.py @@ -5,16 +5,16 @@ from nose.tools import eq_ from ....core.storage.storage_test import StrategyCase from ..cryptor_test import generate_cryptor, config_factory -from serverauditor_sshconfig.cloud.client.transformers.many import ( +from termius.cloud.client.transformers.many import ( BulkTransformer ) -from serverauditor_sshconfig.core.storage.strategies import ( +from termius.core.storage.strategies import ( RelatedGetStrategy, SyncSaveStrategy ) -from serverauditor_sshconfig.cloud.client.controllers import CryptoController -from serverauditor_sshconfig.account.managers import AccountManager -from serverauditor_sshconfig.core.settings import Config -from serverauditor_sshconfig.core.models.terminal import ( +from termius.cloud.client.controllers import CryptoController +from termius.account.managers import AccountManager +from termius.core.settings import Config +from termius.core.models.terminal import ( Host, SshConfig, Identity, SshKey ) diff --git a/tests/core/models_test.py b/tests/core/models_test.py index 3730373..5043b6d 100644 --- a/tests/core/models_test.py +++ b/tests/core/models_test.py @@ -2,12 +2,12 @@ import six from mock import patch, Mock -from serverauditor_sshconfig.core.models.base import Model -from serverauditor_sshconfig.core.models.terminal import ( +from termius.core.models.base import Model +from termius.core.models.terminal import ( Tag, SshKey, Identity, SshConfig, Group, Host, PFRule ) -from serverauditor_sshconfig.core.storage import ApplicationStorage +from termius.core.storage import ApplicationStorage def test_generator(): @@ -28,7 +28,7 @@ def test_generator(): yield save, instance -@patch('serverauditor_sshconfig.core.storage.PersistentDict') +@patch('termius.core.storage.PersistentDict') def save(model, mocked): storage = ApplicationStorage(Mock(**{ diff --git a/tests/core/storage/query_test.py b/tests/core/storage/query_test.py index 606eaea..eaf20e6 100644 --- a/tests/core/storage/query_test.py +++ b/tests/core/storage/query_test.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from mock import patch, Mock from unittest import TestCase -from serverauditor_sshconfig.core.storage.query import Query +from termius.core.storage.query import Query class QueryCase(TestCase): diff --git a/tests/core/storage/storage_test.py b/tests/core/storage/storage_test.py index c021e47..efaf1ac 100644 --- a/tests/core/storage/storage_test.py +++ b/tests/core/storage/storage_test.py @@ -3,11 +3,11 @@ from six import integer_types from mock import patch, Mock from unittest import TestCase -from serverauditor_sshconfig.core.models.terminal import ( +from termius.core.models.terminal import ( Host, SshConfig, Identity, SshKey, Group ) -from serverauditor_sshconfig.core.exceptions import DoesNotExistException -from serverauditor_sshconfig.core.storage.strategies import ( +from termius.core.exceptions import DoesNotExistException +from termius.core.storage.strategies import ( GetStrategy, SaveStrategy, RelatedGetStrategy, RelatedSaveStrategy ) @@ -20,14 +20,14 @@ class StrategyCase(TestCase): def setUp(self): self.tempfile = tempfile.NamedTemporaryFile() self.storage_file_patch = patch( - 'serverauditor_sshconfig.core.storage.ApplicationStorage.path', + 'termius.core.storage.ApplicationStorage.path', self.tempfile.name ) self.assertIsNotNone(self.save_strategy_class) self.assertIsNotNone(self.get_strategy_class) - from serverauditor_sshconfig.core.storage import ApplicationStorage + from termius.core.storage import ApplicationStorage self.storage = ApplicationStorage( Mock(**{'app.directory_path.return_value': 'TestCase'}), diff --git a/tests/integration/complete.bats b/tests/integration/complete.bats index c9464c5..f7cf709 100644 --- a/tests/integration/complete.bats +++ b/tests/integration/complete.bats @@ -1,11 +1,11 @@ #!/usr/bin/env bats @test "bash complete output" { - run serverauditor complete + run termius complete [ "$status" -eq 0 ] } @test "bash complete" { - run source <(serverauditor complete) + run source <(termius complete) [ "$status" -eq 0 ] } diff --git a/tests/integration/completion/bash/completion_test.py b/tests/integration/completion/bash/completion_test.py index fa754ef..fa9c397 100644 --- a/tests/integration/completion/bash/completion_test.py +++ b/tests/integration/completion/bash/completion_test.py @@ -3,8 +3,8 @@ import unittest from pathlib2 import Path from mock import Mock -from serverauditor_sshconfig.core.storage import ApplicationStorage -from serverauditor_sshconfig.core.models.terminal import ( +from termius.core.storage import ApplicationStorage +from termius.core.models.terminal import ( Host, Group, PFRule, Identity ) @@ -79,10 +79,10 @@ def run_complete(self, completion_file, program, command, expected): self.assertEqual(stdout.decode('utf-8'), expected + '\n') -class ServerauditorTestCase(BashCompletionTest): +class TermiusTestCase(BashCompletionTest): - program = 'serverauditor' - completion_file = 'contrib/completion/bash/serverauditor' + program = 'termius' + completion_file = 'contrib/completion/bash/termius' def test_nothing(self): self.run_complete( @@ -184,21 +184,21 @@ def test_list_format_types(self): self.run_complete(subcommand + ' --format ', 'csv json table value yaml') def run_complete(self, command, expected): - super(ServerauditorTestCase, self).run_complete( + super(TermiusTestCase, self).run_complete( self.completion_file, self.program, command, expected ) def setUp(self): - self.client = ServerauditorClient() + self.client = TermiusClient() def tearDown(self): self.client.clean() -class ServerauditorClient(object): +class TermiusClient(object): def __init__(self): - self.app_directory = Path('~/.serverauditor/').expanduser() + self.app_directory = Path('~/.termius/').expanduser() self.command_mock = Mock(**{'app.directory_path': self.app_directory}) self.prepare() diff --git a/tests/integration/connect.bats b/tests/integration/connect.bats index 17f5073..de774c1 100644 --- a/tests/integration/connect.bats +++ b/tests/integration/connect.bats @@ -1,11 +1,11 @@ #!/usr/bin/env bats @test "connect help by arg" { - run serverauditor connect --help + run termius connect --help [ "$status" -eq 0 ] } @test "connect help command" { - run serverauditor help connect + run termius help connect [ "$status" -eq 0 ] } diff --git a/tests/integration/fullclean.bats b/tests/integration/fullclean.bats index ad84af9..fc42a75 100644 --- a/tests/integration/fullclean.bats +++ b/tests/integration/fullclean.bats @@ -2,34 +2,34 @@ load test_helper @test "fullclean help by arg" { - run serverauditor fullclean --help + run termius fullclean --help [ "$status" -eq 0 ] } @test "fullclean help command" { - run serverauditor help fullclean + run termius help fullclean [ "$status" -eq 0 ] } @test "fullclean logged in" { - login_serverauditor - serverauditor pull -p $SERVERAUDITOR_PASSWORD + login_termius + termius pull -p $SERVERAUDITOR_PASSWORD - run serverauditor fullclean -p $SERVERAUDITOR_PASSWORD + run termius fullclean -p $SERVERAUDITOR_PASSWORD [ "$status" -eq 0 ] assert_clear_storage } @test "fullclean logged in incorrect password" { - login_serverauditor + login_termius - run serverauditor fullclean -p "" + run termius fullclean -p "" [ "$status" -eq 1 ] } @test "fullclean not logged in" { - serverauditor logout - run serverauditor fullclean -p "" + termius logout + run termius fullclean -p "" [ "$status" -eq 1 ] } diff --git a/tests/integration/group.bats b/tests/integration/group.bats index 29f1c54..b40aee2 100644 --- a/tests/integration/group.bats +++ b/tests/integration/group.bats @@ -7,17 +7,17 @@ setup() { } @test "group help by arg" { - run serverauditor group --help + run termius group --help [ $status -eq 0 ] } @test "group help command" { - run serverauditor help group + run termius help group [ $status -eq 0 ] } @test "Add general group" { - run serverauditor group -L 'Group' --port 2202 --username 'use r name' --debug + run termius group -L 'Group' --port 2202 --username 'use r name' --debug [ $status -eq 0 ] [ $(get_models_set_length 'group_set') -eq 1 ] [ $(get_models_set_length 'sshconfig_set') -eq 1 ] @@ -33,8 +33,8 @@ setup() { } @test "Add group to main group" { - group=$(serverauditor group -L 'test group' --port 2 --username 'use r name') - run serverauditor group --port 22 --parent-group $group + group=$(termius group -L 'test group' --port 2 --username 'use r name') + run termius group --port 22 --parent-group $group [ "$status" -eq 0 ] [ $(get_models_set_length 'group_set') -eq 2 ] [ $(get_models_set_length 'sshconfig_set') -eq 2 ] @@ -44,9 +44,9 @@ setup() { } @test "Update group assign visible identity" { - identity=$(serverauditor identity -L local --username 'ROOT' --password 'pa') - group=$(serverauditor group -L 'test group' --port 2 --username 'use r name') - run serverauditor group --identity $identity $group + identity=$(termius identity -L local --username 'ROOT' --password 'pa') + group=$(termius group -L 'test group' --port 2 --username 'use r name') + run termius group --identity $identity $group [ "$status" -eq 0 ] [ $(get_models_set_length 'group_set') -eq 1 ] [ $(get_models_set_length 'sshconfig_set') -eq 1 ] @@ -60,9 +60,9 @@ setup() { } @test "Update group update visible identity" { - identity=$(serverauditor identity -L local --username 'ROOT' --password 'pa') - group=$(serverauditor group -L 'test group' --identity $identity) - run serverauditor group --username 'use r name' $group + identity=$(termius identity -L local --username 'ROOT' --password 'pa') + group=$(termius group -L 'test group' --identity $identity) + run termius group --username 'use r name' $group [ "$status" -eq 0 ] [ $(get_models_set_length 'group_set') -eq 1 ] [ $(get_models_set_length 'sshconfig_set') -eq 1 ] @@ -79,8 +79,8 @@ setup() { } @test "Update group" { - group=$(serverauditor group -L 'test group' --port 2 --username 'use r name') - run serverauditor group --username 'user' $group + group=$(termius group -L 'test group' --port 2 --username 'use r name') + run termius group --username 'user' $group [ "$status" -eq 0 ] [ $(get_models_set_length 'group_set') -eq 1 ] [ $(get_models_set_length 'sshconfig_set') -eq 1 ] @@ -95,25 +95,25 @@ setup() { } @test "Update group add in self" { - group=$(serverauditor group -L 'test group' --port 2 --username 'name') - run serverauditor group --parent-group $group $group + group=$(termius group -L 'test group' --port 2 --username 'name') + run termius group --parent-group $group $group [ "$status" -eq 1 ] [ $(get_models_set_length 'group_set') -eq 1 ] } @test "Update group add into infinite loop" { - grand_parent_group=$(serverauditor group -L 'test group' --port 2 --username 'name') - parent_group=$(serverauditor group -L 'test group' --port 2 --username 'name' --parent-group $grand_parent_group) - group=$(serverauditor group -L 'test group' --port 2 --username 'name' --parent-group $parent_group) - run serverauditor group -L 'test group' --port 2 --username 'user' --parent-group $group $grand_parent_group + grand_parent_group=$(termius group -L 'test group' --port 2 --username 'name') + parent_group=$(termius group -L 'test group' --port 2 --username 'name' --parent-group $grand_parent_group) + group=$(termius group -L 'test group' --port 2 --username 'name' --parent-group $parent_group) + run termius group -L 'test group' --port 2 --username 'user' --parent-group $group $grand_parent_group [ "$status" -eq 1 ] [ $(get_models_set_length 'group_set') -eq 3 ] } @test "Update group add in parent group" { - parent_group=$(serverauditor group -L 'test group' --port 2 --username 'use r name') - group=$(serverauditor group -L 'Group' --port 2 --username 'name') - run serverauditor group --parent-group $parent_group $group + parent_group=$(termius group -L 'test group' --port 2 --username 'use r name') + group=$(termius group -L 'Group' --port 2 --username 'name') + run termius group --parent-group $parent_group $group [ "$status" -eq 0 ] [ $(get_models_set_length 'group_set') -eq 2 ] [ $(get_models_set_length 'sshconfig_set') -eq 2 ] @@ -123,25 +123,25 @@ setup() { } @test "Update many groups" { - group1=$(serverauditor group -L 'test group' --port 2 --username 'use r name') - group2=$(serverauditor group -L 'test group' --port 2 --username 'use r name') - run serverauditor group -L 'test group' --port 2 --username 'user' $group1 $group2 + group1=$(termius group -L 'test group' --port 2 --username 'use r name') + group2=$(termius group -L 'test group' --port 2 --username 'use r name') + run termius group -L 'test group' --port 2 --username 'user' $group1 $group2 [ "$status" -eq 0 ] [ $(get_models_set_length 'group_set') -eq 2 ] } @test "Delete group" { - group1=$(serverauditor group -L 'test group' --port 2 --username 'use r name') - group2=$(serverauditor group -L 'test group' --port 2 --username 'use r name') - run serverauditor group --delete $group1 + group1=$(termius group -L 'test group' --port 2 --username 'use r name') + group2=$(termius group -L 'test group' --port 2 --username 'use r name') + run termius group --delete $group1 [ "$status" -eq 0 ] [ $(get_models_set_length 'group_set') -eq 1 ] } @test "Delete many groups" { - group1=$(serverauditor group -L 'test group' --port 2 --username 'use r name') - group2=$(serverauditor group -L 'test group' --port 2 --username 'use r name') - run serverauditor group --delete $group1 $group2 + group1=$(termius group -L 'test group' --port 2 --username 'use r name') + group2=$(termius group -L 'test group' --port 2 --username 'use r name') + run termius group --delete $group1 $group2 [ "$status" -eq 0 ] [ $(get_models_set_length 'group_set') -eq 0 ] } diff --git a/tests/integration/groups.bats b/tests/integration/groups.bats index 419f34d..a3cf5a4 100644 --- a/tests/integration/groups.bats +++ b/tests/integration/groups.bats @@ -7,35 +7,35 @@ setup() { @test "groups help by arg" { - run serverauditor groups --help + run termius groups --help [ "$status" -eq 0 ] } @test "groups help command" { - run serverauditor help groups + run termius help groups [ "$status" -eq 0 ] } @test "List groups in table format" { - serverauditor group -L 'test group' --port 2 --username 'use r name' - run serverauditor groups + termius group -L 'test group' --port 2 --username 'use r name' + run termius groups [ "$status" -eq 0 ] [ $(get_models_set_length 'group_set') -eq 1 ] } @test "List groups in subgroup in table format" { - parent=$(serverauditor group -L 'test group' --port 2 --username 'use r name') - serverauditor group -L 'test group' --parent-group $parent --port 2 --username 'use r name' - run serverauditor groups $parent + parent=$(termius group -L 'test group' --port 2 --username 'use r name') + termius group -L 'test group' --parent-group $parent --port 2 --username 'use r name' + run termius groups $parent [ "$status" -eq 0 ] [ $(get_models_set_length 'group_set') -eq 2 ] } @test "List groups recursivly in subgroup in table format" { - grandparent=$(serverauditor group -L 'test group' --port 2 --username 'use r name') - parent=$(serverauditor group -L 'test group' --parent-group $grandparent --port 2 --username 'use r name') - serverauditor group -L 'test group' --parent-group $parent --port 2 --username 'use r name' - run serverauditor groups $grandparent + grandparent=$(termius group -L 'test group' --port 2 --username 'use r name') + parent=$(termius group -L 'test group' --parent-group $grandparent --port 2 --username 'use r name') + termius group -L 'test group' --parent-group $parent --port 2 --username 'use r name' + run termius groups $grandparent [ "$status" -eq 0 ] [ $(get_models_set_length 'group_set') -eq 3 ] } diff --git a/tests/integration/help.bats b/tests/integration/help.bats index b743595..fd6d9fa 100644 --- a/tests/integration/help.bats +++ b/tests/integration/help.bats @@ -2,6 +2,6 @@ @test "help arg" { - run serverauditor --help + run termius --help [ "$status" -eq 0 ] } diff --git a/tests/integration/host.bats b/tests/integration/host.bats index e2b8af3..f3caa45 100644 --- a/tests/integration/host.bats +++ b/tests/integration/host.bats @@ -6,17 +6,17 @@ setup() { } @test "host help by arg" { - run serverauditor host --help + run termius host --help [ "$status" -eq 0 ] } @test "host help command" { - run serverauditor help host + run termius help host [ "$status" -eq 0 ] } @test "Add general host" { - run serverauditor host -L test --port 2022 --address localhost --username root --password password + run termius host -L test --port 2022 --address localhost --username root --password password [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] [ $(get_models_set_length 'sshconfig_set') -eq 1 ] @@ -33,8 +33,8 @@ setup() { } @test "Add host to group" { - group=$(serverauditor group --port 2022) - run serverauditor host -L test --group $group --address localhost --debug + group=$(termius group --port 2022) + run termius host -L test --group $group --address localhost --debug [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] [ $(get_models_set_length 'sshconfig_set') -eq 2 ] @@ -52,16 +52,16 @@ setup() { } @test "Add many hosts" { - run serverauditor host -L test_1 --port 2022 --address 127.0.0.1 --username root --password 'pa$$word' - run serverauditor host -L test_2 --port 2222 --address google.com --username root --password 'password' - run serverauditor host -L test_3 --port 22 --address google.com --username root --password 'psswrd' + run termius host -L test_1 --port 2022 --address 127.0.0.1 --username root --password 'pa$$word' + run termius host -L test_2 --port 2222 --address google.com --username root --password 'password' + run termius host -L test_3 --port 22 --address google.com --username root --password 'psswrd' [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 3 ] } @test "Update host" { - host=$(serverauditor host -L test_3 --port 22 --address google.com --username root --password 'psswrd') - run serverauditor host --address google --username ROOT --password '' $host + host=$(termius host -L test_3 --port 22 --address google.com --username root --password 'psswrd') + run termius host --address google --username ROOT --password '' $host [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] [ $(get_models_set_length 'sshconfig_set') -eq 1 ] @@ -79,9 +79,9 @@ setup() { } @test "Update host add to group" { - group=$(serverauditor group --port 2022) - host=$(serverauditor host --address localhost -L test) - run serverauditor host --group $group $host + group=$(termius group --port 2022) + host=$(termius host --address localhost -L test) + run termius host --group $group $host [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] [ $(get_models_set_length 'sshconfig_set') -eq 2 ] @@ -98,9 +98,9 @@ setup() { } @test "Update host assign visible identity" { - identity=$(serverauditor identity -L local --username 'ROOT' --password 'pa') - host=$(serverauditor host --address localhost -L 'test' --port 2 --username 'use r name') - run serverauditor host --identity $identity $host + identity=$(termius identity -L local --username 'ROOT' --password 'pa') + host=$(termius host --address localhost -L 'test' --port 2 --username 'use r name') + run termius host --identity $identity $host [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] [ $(get_models_set_length 'sshconfig_set') -eq 1 ] @@ -115,9 +115,9 @@ setup() { } @test "Update host update visible identity" { - identity=$(serverauditor identity -L local --username 'ROOT' --password 'pa') - host=$(serverauditor host -L 'test' --address local --identity $identity) - run serverauditor host --username 'use r name' $host + identity=$(termius identity -L local --username 'ROOT' --password 'pa') + host=$(termius host -L 'test' --address local --identity $identity) + run termius host --username 'use r name' $host [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] [ $(get_models_set_length 'sshconfig_set') -eq 1 ] @@ -135,39 +135,39 @@ setup() { } @test "Update many hosts" { - host1=$(serverauditor host -L test_2 --port 22 --address google.com --username root --password 'psswrd') - host2=$(serverauditor host -L test_3 --port 22 --address google.com --username root --password 'psswrd') - run serverauditor host -L test_3 --port 22 --address google --username root --password '' $host1 $hots2 + host1=$(termius host -L test_2 --port 22 --address google.com --username root --password 'psswrd') + host2=$(termius host -L test_3 --port 22 --address google.com --username root --password 'psswrd') + run termius host -L test_3 --port 22 --address google --username root --password '' $host1 $hots2 [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 2 ] } @test "Update hosts with same name" { - host1=$(serverauditor host -L test_3 --port 22 --address google.com --username root --password 'psswrd') - host2=$(serverauditor host -L test_3 --port 22 --address google.com --username root --password 'psswrd') - run serverauditor host -L test_3 --port 22 --address google --username root --password '' 'test_3' + host1=$(termius host -L test_3 --port 22 --address google.com --username root --password 'psswrd') + host2=$(termius host -L test_3 --port 22 --address google.com --username root --password 'psswrd') + run termius host -L test_3 --port 22 --address google --username root --password '' 'test_3' [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 2 ] } @test "Delete host" { - host1=$(serverauditor host -L test_3 --port 22 --address google.com --username root --password 'psswrd') - host2=$(serverauditor host -L test_3 --port 22 --address google.com --username root --password 'psswrd') - run serverauditor host --delete $host1 + host1=$(termius host -L test_3 --port 22 --address google.com --username root --password 'psswrd') + host2=$(termius host -L test_3 --port 22 --address google.com --username root --password 'psswrd') + run termius host --delete $host1 [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] } @test "Delete many hosts" { - host1=$(serverauditor host -L test_2 --port 22 --address google.com --username root --password 'psswrd') - host2=$(serverauditor host -L test_3 --port 22 --address google.com --username root --password 'psswrd') - run serverauditor host --delete $host1 $host2 + host1=$(termius host -L test_2 --port 22 --address google.com --username root --password 'psswrd') + host2=$(termius host -L test_3 --port 22 --address google.com --username root --password 'psswrd') + run termius host --delete $host1 $host2 [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 0 ] } @test "Create with tag" { - run serverauditor host -L test --port 2022 --address localhost --username root --password password -t A + run termius host -L test --port 2022 --address localhost --username root --password password -t A [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] [ $(get_models_set_length 'tag_set') -eq 1 ] @@ -177,7 +177,7 @@ setup() { } @test "Create with 3 tags" { - run serverauditor host -L test --port 2022 --address localhost --username root --password password -t A -t B -t C + run termius host -L test --port 2022 --address localhost --username root --password password -t A -t B -t C [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] [ $(get_models_set_length 'tag_set') -eq 3 ] @@ -190,9 +190,9 @@ setup() { } @test "Create 2 hosts with 3 tags" { - run serverauditor host -L test --port 2022 --address localhost --username root --password password -t A -t B -t C + run termius host -L test --port 2022 --address localhost --username root --password password -t A -t B -t C host1=${lines[1]} - run serverauditor host -L test --port 2022 --address localhost --username root --password password -t A -t B -t C + run termius host -L test --port 2022 --address localhost --username root --password password -t A -t B -t C [ "$status" -eq 0 ] host2=${lines[1]} ! [ $host1 -eq $host2 ] @@ -209,8 +209,8 @@ setup() { } @test "Update host with 3 same tags" { - host=$(serverauditor host -L test --port 2022 --address localhost --username root --password password -t A -t B -t C) - run serverauditor host -t A -t B -t C $host + host=$(termius host -L test --port 2022 --address localhost --username root --password password -t A -t B -t C) + run termius host -t A -t B -t C $host [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] [ $(get_models_set_length 'tag_set') -eq 3 ] @@ -222,8 +222,8 @@ setup() { } @test "Update host with 3 diff tags" { - host=$(serverauditor host -L test --port 2022 --address localhost --username root --password password -t A -t B -t C) - run serverauditor host -L test --port 2022 --address localhost --username root --password password -t D -t E -t F $host + host=$(termius host -L test --port 2022 --address localhost --username root --password password -t A -t B -t C) + run termius host -L test --port 2022 --address localhost --username root --password password -t D -t E -t F $host [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] [ $(get_models_set_length 'tag_set') -eq 6 ] diff --git a/tests/integration/hosts.bats b/tests/integration/hosts.bats index d7ec49e..ed85f18 100644 --- a/tests/integration/hosts.bats +++ b/tests/integration/hosts.bats @@ -6,45 +6,45 @@ setup() { } @test "hosts help by arg" { - run serverauditor hosts --help + run termius hosts --help [ "$status" -eq 0 ] } @test "hosts help command" { - run serverauditor help hosts + run termius help hosts [ "$status" -eq 0 ] } @test "List hosts in table format" { - serverauditor host -L test --port 2022 --address 123.2.3.2 --username root --password password - run serverauditor hosts + termius host -L test --port 2022 --address 123.2.3.2 --username root --password password + run termius hosts [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] } @test "List hosts filter by tag" { - serverauditor host -L test --port 2022 --address localhost --username root --password password - serverauditor host -L test --port 2022 --address localhost --username root --password password -t A + termius host -L test --port 2022 --address localhost --username root --password password + termius host -L test --port 2022 --address localhost --username root --password password -t A - run serverauditor hosts --tag A + run termius hosts --tag A [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 2 ] } @test "List hosts in group" { - group=$(serverauditor group --port 2022) - serverauditor host -L test --group $group --address localhost --username root --password password + group=$(termius group --port 2022) + termius host -L test --group $group --address localhost --username root --password password - run serverauditor hosts --group $group + run termius hosts --group $group [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] } @test "List hosts in group filter by tag" { - group=$(serverauditor group --port 2022) - serverauditor host -L test --group $group --address localhost --username root --password password -t A + group=$(termius group --port 2022) + termius host -L test --group $group --address localhost --username root --password password -t A - run serverauditor hosts --tag A --group $group + run termius hosts --tag A --group $group [ "$status" -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] } diff --git a/tests/integration/identities.bats b/tests/integration/identities.bats index 86cb4f4..97e9d99 100644 --- a/tests/integration/identities.bats +++ b/tests/integration/identities.bats @@ -6,19 +6,19 @@ setup() { } @test "Identities help by arg" { - run serverauditor identities --help + run termius identities --help [ "$status" -eq 0 ] } @test "Identities help command" { - run serverauditor help identities + run termius help identities [ "$status" -eq 0 ] } @test "List general identities in table format" { - rm ~/.serverauditor.storage || true - serverauditor identity -L local --username 'ROOT' --password 'pa' - run serverauditor identities + rm ~/.termius.storage || true + termius identity -L local --username 'ROOT' --password 'pa' + run termius identities [ "$status" -eq 0 ] [ $(get_models_set_length 'identity_set') -eq 1 ] } diff --git a/tests/integration/identity.bats b/tests/integration/identity.bats index 1ce8a1c..74b9658 100644 --- a/tests/integration/identity.bats +++ b/tests/integration/identity.bats @@ -20,17 +20,17 @@ teardown() { @test "Identity help by arg" { - run serverauditor identity --help + run termius identity --help [ "$status" -eq 0 ] } @test "Identity help command" { - run serverauditor help identity + run termius help identity [ "$status" -eq 0 ] } @test "Add general identity" { - run serverauditor identity -L local --username 'ROOT' --password 'pa' + run termius identity -L local --username 'ROOT' --password 'pa' [ "$status" -eq 0 ] [ $(get_models_set_length 'identity_set') -eq 1 ] identity=${lines[1]} @@ -41,7 +41,7 @@ teardown() { } @test "Add identity with key" { - run serverauditor identity -L local --identity-file $private_key_path --debug + run termius identity -L local --identity-file $private_key_path --debug [ "$status" -eq 0 ] [ $(get_models_set_length 'identity_set') -eq 1 ] [ $(get_models_set_length 'sshkeycrypt_set') -eq 1 ] @@ -55,8 +55,8 @@ teardown() { } @test "Update identity" { - identity=$(serverauditor identity -L local --username 'ROOT' --password 'pa') - run serverauditor identity --password 'ps' $identity + identity=$(termius identity -L local --username 'ROOT' --password 'pa') + run termius identity --password 'ps' $identity [ "$status" -eq 0 ] [ $(get_models_set_length 'identity_set') -eq 1 ] [ "$(get_model_field 'identity_set' $identity 'label')" = '"local"' ] @@ -67,25 +67,25 @@ teardown() { } @test "Update many identities" { - identity1=$(serverauditor identity -L local --username 'ROOT' --password 'pa') - identity2=$(serverauditor identity -L local --username 'ROOT' --password 'pa') - run serverauditor identity -L local --username 'ROOT' --password 'pa' $identity1 $identity2 + identity1=$(termius identity -L local --username 'ROOT' --password 'pa') + identity2=$(termius identity -L local --username 'ROOT' --password 'pa') + run termius identity -L local --username 'ROOT' --password 'pa' $identity1 $identity2 [ "$status" -eq 0 ] [ $(get_models_set_length 'identity_set') -eq 2 ] } @test "Delete identity" { - identity1=$(serverauditor identity -L local --username 'ROOT' --password 'pa') - identity2=$(serverauditor identity -L local --username 'ROOT' --password 'pa') - run serverauditor identity --delete $identity2 + identity1=$(termius identity -L local --username 'ROOT' --password 'pa') + identity2=$(termius identity -L local --username 'ROOT' --password 'pa') + run termius identity --delete $identity2 [ "$status" -eq 0 ] [ $(get_models_set_length 'identity_set') -eq 1 ] } @test "Delete many identities" { - identity1=$(serverauditor identity -L local --username 'ROOT' --password 'pa') - identity2=$(serverauditor identity -L local --username 'ROOT' --password 'pa') - run serverauditor identity --delete $identity1 $identity2 + identity1=$(termius identity -L local --username 'ROOT' --password 'pa') + identity2=$(termius identity -L local --username 'ROOT' --password 'pa') + run termius identity --delete $identity1 $identity2 [ "$status" -eq 0 ] [ $(get_models_set_length 'identity_set') -eq 0 ] } diff --git a/tests/integration/info.bats b/tests/integration/info.bats index 92005c5..9a6aed9 100644 --- a/tests/integration/info.bats +++ b/tests/integration/info.bats @@ -7,110 +7,110 @@ setup() { } @test "info help by arg" { - run serverauditor info --help + run termius info --help [ "$status" -eq 0 ] } @test "info help command" { - run serverauditor help info + run termius help info [ "$status" -eq 0 ] } @test "info host use default formatter" { - host=$(serverauditor host -L test --port 2022 --address localhost --username root --password password) - run serverauditor info $host + host=$(termius host -L test --port 2022 --address localhost --username root --password password) + run termius info $host [ "$status" -eq 0 ] } @test "info host use ssh formatter" { - host=$(serverauditor host -L test --port 2022 --address localhost --username root --password password) - run serverauditor info $host -f ssh + host=$(termius host -L test --port 2022 --address localhost --username root --password password) + run termius info $host -f ssh [ "$status" -eq 0 ] } @test "info host use ssh formatter with exta options" { - host=$(serverauditor host -L test --strict-host-key-check yes --keep-alive-packages 20 --timeout 100 --use-ssh-key no --port 2022 --address localhost --username root --password password) - serverauditor settings --agent-forwarding yes - run serverauditor info $host -f ssh + host=$(termius host -L test --strict-host-key-check yes --keep-alive-packages 20 --timeout 100 --use-ssh-key no --port 2022 --address localhost --username root --password password) + termius settings --agent-forwarding yes + run termius info $host -f ssh echo ${lines[*]} >&2 - cat ~/.serverauditor/storage | jq . >&2 + cat ~/.termius/storage | jq . >&2 [ "$status" -eq 0 ] [ "${lines[0]}" = "ssh -p 2022 -o StrictHostKeyChecking=yes -o IdentitiesOnly=no -o ServerAliveInterval=100 -o ServerAliveCountMax=20 -o ForwardAgent=yes localhost" ] } @test "info host use ssh formatter with exta options disable agent forwarding" { - host=$(serverauditor host -L test --strict-host-key-check yes --keep-alive-packages 20 --timeout 100 --use-ssh-key no --port 2022 --address localhost --username root --password password) - serverauditor settings --agent-forwarding no - run serverauditor info $host -f ssh + host=$(termius host -L test --strict-host-key-check yes --keep-alive-packages 20 --timeout 100 --use-ssh-key no --port 2022 --address localhost --username root --password password) + termius settings --agent-forwarding no + run termius info $host -f ssh echo ${lines[*]} >&2 - cat ~/.serverauditor/storage | jq . >&2 + cat ~/.termius/storage | jq . >&2 [ "$status" -eq 0 ] [ "${lines[0]}" = "ssh -p 2022 -o StrictHostKeyChecking=yes -o IdentitiesOnly=no -o ServerAliveInterval=100 -o ServerAliveCountMax=20 -o ForwardAgent=no localhost" ] } @test "info group use default formatter" { - group=$(serverauditor group -L test --port 2022) - run serverauditor info --group $group --debug + group=$(termius group -L test --port 2022) + run termius info --group $group --debug [ "$status" -eq 0 ] } @test "info group use ssh formatter" { - group=$(serverauditor group -L test --port 2022) - run serverauditor info --group $group -f ssh + group=$(termius group -L test --port 2022) + run termius info --group $group -f ssh [ "$status" -eq 0 ] } @test "info host in 2 groups" { - serverauditor settings --agent-forwarding yes - grandgroup=$(serverauditor group -L test --port 22) - group=$(serverauditor group --parent-group $grandgroup -L test --port 2022) - host=$(serverauditor host --group $group --address localhost -L test) - run serverauditor info $host -f ssh + termius settings --agent-forwarding yes + grandgroup=$(termius group -L test --port 22) + group=$(termius group --parent-group $grandgroup -L test --port 2022) + host=$(termius host --group $group --address localhost -L test) + run termius info $host -f ssh [ "$status" -eq 0 ] [ "${lines[0]}" = "ssh -p 2022 -o ForwardAgent=yes localhost" ] } @test "info host in 2 groups without agent forwarding" { - serverauditor settings --agent-forwarding no - grandgroup=$(serverauditor group -L test --port 22) - group=$(serverauditor group --parent-group $grandgroup -L test --port 2022) - host=$(serverauditor host --group $group --address localhost -L test) - run serverauditor info $host -f ssh + termius settings --agent-forwarding no + grandgroup=$(termius group -L test --port 22) + group=$(termius group --parent-group $grandgroup -L test --port 2022) + host=$(termius host --group $group --address localhost -L test) + run termius info $host -f ssh [ "$status" -eq 0 ] [ "${lines[0]}" = "ssh -p 2022 -o ForwardAgent=no localhost" ] } @test "info host in 2 groups with visible identity" { - serverauditor settings --agent-forwarding yes - identity=$(serverauditor identity --username user) - grandgroup=$(serverauditor group -L test --port 22 --identity $identity) - group=$(serverauditor group --parent-group $grandgroup -L test --port 2022 --username local) - host=$(serverauditor host --group $group --address localhost -L test --username root) - run serverauditor info $host -f ssh --debug + termius settings --agent-forwarding yes + identity=$(termius identity --username user) + grandgroup=$(termius group -L test --port 22 --identity $identity) + group=$(termius group --parent-group $grandgroup -L test --port 2022 --username local) + host=$(termius host --group $group --address localhost -L test --username root) + run termius info $host -f ssh --debug echo "${lines[*]}" >&2 [ "$status" -eq 0 ] [ "${lines[0]}" = "ssh -p 2022 -o ForwardAgent=yes user@localhost" ] } @test "info host in 2 groups with visible identity without agent forwarding" { - serverauditor settings --agent-forwarding no - identity=$(serverauditor identity --username user) - grandgroup=$(serverauditor group -L test --port 22 --identity $identity) - group=$(serverauditor group --parent-group $grandgroup -L test --port 2022 --username local) - host=$(serverauditor host --group $group --address localhost -L test --username root) - run serverauditor info $host -f ssh --debug + termius settings --agent-forwarding no + identity=$(termius identity --username user) + grandgroup=$(termius group -L test --port 22 --identity $identity) + group=$(termius group --parent-group $grandgroup -L test --port 2022 --username local) + host=$(termius host --group $group --address localhost -L test --username root) + run termius info $host -f ssh --debug echo "${lines[*]}" >&2 [ "$status" -eq 0 ] [ "${lines[0]}" = "ssh -p 2022 -o ForwardAgent=no user@localhost" ] } @test "info host not existed" { - group=$(serverauditor group -L test --port 2022) - run serverauditor info $group + group=$(termius group -L test --port 2022) + run termius info $group [ "$status" -eq 1 ] } @test "info group not existed" { - host=$(serverauditor host -L test --port 2022 --address localhost --username root --password password) - run serverauditor info --group $host + host=$(termius host -L test --port 2022 --address localhost --username root --password password) + run termius info --group $host [ "$status" -eq 1 ] } diff --git a/tests/integration/key.bats b/tests/integration/key.bats index 2b02471..d374920 100644 --- a/tests/integration/key.bats +++ b/tests/integration/key.bats @@ -18,21 +18,21 @@ teardown() { } @test "key help by arg" { - run serverauditor key --help + run termius key --help [ "$status" -eq 0 ] } @test "key help command" { - run serverauditor help key + run termius help key [ "$status" -eq 0 ] } @test "Add general key" { - run serverauditor key -L test -i $private_key_path + run termius key -L test -i $private_key_path [ "$status" -eq 0 ] [ $(get_models_set_length 'sshkeycrypt_set') -eq 1 ] - [ $(diff ~/.serverauditor/ssh_keys/test $private_key_path) = ""] - [ "$(ls -al ~/.serverauditor/ssh_keys/test | awk '{print $1}')" = '-rw-------' ] + [ $(diff ~/.termius/ssh_keys/test $private_key_path) = ""] + [ "$(ls -al ~/.termius/ssh_keys/test | awk '{print $1}')" = '-rw-------' ] ssh_key=${lines[1]} [ "$(get_model_field 'sshkeycrypt_set' $ssh_key 'label')" = '"test"' ] [ "$(get_model_field 'sshkeycrypt_set' $ssh_key 'private_key')" = "\"$private_key_content\"" ] @@ -40,77 +40,77 @@ teardown() { } @test "Add many keys" { - run serverauditor key -L test_1 -i $private_key_path - run serverauditor key -L test_2 -i $private_key_path - run serverauditor key -L test_3 -i $private_key_path + run termius key -L test_1 -i $private_key_path + run termius key -L test_2 -i $private_key_path + run termius key -L test_3 -i $private_key_path [ "$status" -eq 0 ] [ $(get_models_set_length 'sshkeycrypt_set') -eq 3 ] - [ $(diff ~/.serverauditor/ssh_keys/test_1 $private_key_path) = ""] - [ "$(ls -al ~/.serverauditor/ssh_keys/test_1 | awk '{print $1}')" = '-rw-------' ] - [ $(diff ~/.serverauditor/ssh_keys/test_2 $private_key_path) = ""] - [ "$(ls -al ~/.serverauditor/ssh_keys/test_1 | awk '{print $1}')" = '-rw-------' ] - [ $(diff ~/.serverauditor/ssh_keys/test_3 $private_key_path) = ""] - [ "$(ls -al ~/.serverauditor/ssh_keys/test_1 | awk '{print $1}')" = '-rw-------' ] + [ $(diff ~/.termius/ssh_keys/test_1 $private_key_path) = ""] + [ "$(ls -al ~/.termius/ssh_keys/test_1 | awk '{print $1}')" = '-rw-------' ] + [ $(diff ~/.termius/ssh_keys/test_2 $private_key_path) = ""] + [ "$(ls -al ~/.termius/ssh_keys/test_1 | awk '{print $1}')" = '-rw-------' ] + [ $(diff ~/.termius/ssh_keys/test_3 $private_key_path) = ""] + [ "$(ls -al ~/.termius/ssh_keys/test_1 | awk '{print $1}')" = '-rw-------' ] } @test "Update key" { - key=$(serverauditor key -L test -i $private_key_path) - run serverauditor key -i $second_key_path $key + key=$(termius key -L test -i $private_key_path) + run termius key -i $second_key_path $key [ "$status" -eq 0 ] [ $(get_models_set_length 'sshkeycrypt_set') -eq 1 ] - [ $(diff ~/.serverauditor/ssh_keys/key $second_key_path) = ""] - [ "$(ls -al ~/.serverauditor/ssh_keys/test | awk '{print $1}')" = '-rw-------' ] + [ $(diff ~/.termius/ssh_keys/key $second_key_path) = ""] + [ "$(ls -al ~/.termius/ssh_keys/test | awk '{print $1}')" = '-rw-------' ] [ "$(get_model_field 'sshkeycrypt_set' $key 'label')" = '"test"' ] [ "$(get_model_field 'sshkeycrypt_set' $key 'private_key')" = "\"$second_key_content\"" ] [ $(get_model_field 'sshkeycrypt_set' $key 'ssh_key') = 'null' ] } @test "Update many keys" { - key1=$(serverauditor key -L test_1 -i $private_key_path) - key2=$(serverauditor key -L test_2 -i $private_key_path) - key3=$(serverauditor key -L test_3 -i $private_key_path) - run serverauditor key -i $private_key_path $key1 $key2 $key3 + key1=$(termius key -L test_1 -i $private_key_path) + key2=$(termius key -L test_2 -i $private_key_path) + key3=$(termius key -L test_3 -i $private_key_path) + run termius key -i $private_key_path $key1 $key2 $key3 [ "$status" -eq 0 ] [ $(get_models_set_length 'sshkeycrypt_set') -eq 3 ] - [ $(diff ~/.serverauditor/ssh_keys/test_1 $private_key_path) = ""] - [ "$(ls -al ~/.serverauditor/ssh_keys/test_1 | awk '{print $1}')" = '-rw-------' ] - [ $(diff ~/.serverauditor/ssh_keys/test_2 $private_key_path) = ""] - [ "$(ls -al ~/.serverauditor/ssh_keys/test_2 | awk '{print $1}')" = '-rw-------' ] - [ $(diff ~/.serverauditor/ssh_keys/test_3 $private_key_path) = ""] - [ "$(ls -al ~/.serverauditor/ssh_keys/test_2 | awk '{print $1}')" = '-rw-------' ] + [ $(diff ~/.termius/ssh_keys/test_1 $private_key_path) = ""] + [ "$(ls -al ~/.termius/ssh_keys/test_1 | awk '{print $1}')" = '-rw-------' ] + [ $(diff ~/.termius/ssh_keys/test_2 $private_key_path) = ""] + [ "$(ls -al ~/.termius/ssh_keys/test_2 | awk '{print $1}')" = '-rw-------' ] + [ $(diff ~/.termius/ssh_keys/test_3 $private_key_path) = ""] + [ "$(ls -al ~/.termius/ssh_keys/test_2 | awk '{print $1}')" = '-rw-------' ] } @test "Delete key" { - key=$(serverauditor key -L test_1 -i $private_key_path) - run serverauditor key --delete $key + key=$(termius key -L test_1 -i $private_key_path) + run termius key --delete $key [ "$status" -eq 0 ] [ $(get_models_set_length 'sshkeycrypt_set') -eq 0 ] - ! [ -f ~/.serverauditor/ssh_keys/test_1 ] + ! [ -f ~/.termius/ssh_keys/test_1 ] } @test "Delete many keys" { - key1=$(serverauditor key -L test_1 -i $private_key_path) - key2=$(serverauditor key -L test_2 -i $private_key_path) - key3=$(serverauditor key -L test_3 -i $private_key_path) - run serverauditor key --delete $key1 $key2 $key3 + key1=$(termius key -L test_1 -i $private_key_path) + key2=$(termius key -L test_2 -i $private_key_path) + key3=$(termius key -L test_3 -i $private_key_path) + run termius key --delete $key1 $key2 $key3 [ "$status" -eq 0 ] [ $(get_models_set_length 'sshkeycrypt_set') -eq 0 ] - ! [ -f ~/.serverauditor/ssh_keys/test_1 ] - ! [ -f ~/.serverauditor/ssh_keys/test_2 ] - ! [ -f ~/.serverauditor/ssh_keys/test_3 ] + ! [ -f ~/.termius/ssh_keys/test_1 ] + ! [ -f ~/.termius/ssh_keys/test_2 ] + ! [ -f ~/.termius/ssh_keys/test_3 ] } @test "Not add key with same ids" { - serverauditor key -L test -i $private_key_path - run serverauditor key -L test -i $private_key_path + termius key -L test -i $private_key_path + run termius key -L test -i $private_key_path [ "$status" -eq 1 ] [ $(get_models_set_length 'sshkeycrypt_set') -eq 1 ] } @test "Not update key with same ids" { - key1=$(serverauditor key -L test_1 -i $private_key_path) - key2=$(serverauditor key -L test_2 -i $private_key_path) - run serverauditor key -L test_2 -i $private_key_path $key1 + key1=$(termius key -L test_1 -i $private_key_path) + key2=$(termius key -L test_2 -i $private_key_path) + run termius key -L test_2 -i $private_key_path $key1 [ "$status" -eq 1 ] [ $(get_models_set_length 'sshkeycrypt_set') -eq 2 ] } diff --git a/tests/integration/keys.bats b/tests/integration/keys.bats index aa43162..757cff1 100644 --- a/tests/integration/keys.bats +++ b/tests/integration/keys.bats @@ -11,18 +11,18 @@ teardown() { } @test "keys help by arg" { - run serverauditor keys --help + run termius keys --help [ "$status" -eq 0 ] } @test "keys help command" { - run serverauditor help keys + run termius help keys [ "$status" -eq 0 ] } @test "List snippets in table format" { - serverauditor key -L test -i key - run serverauditor keys + termius key -L test -i key + run termius keys [ "$status" -eq 0 ] [ $(get_models_set_length 'sshkeycrypt_set') -eq 1 ] } diff --git a/tests/integration/login.bats b/tests/integration/login.bats index 1d7dbc7..f5e9bcc 100644 --- a/tests/integration/login.bats +++ b/tests/integration/login.bats @@ -2,12 +2,12 @@ load test_helper @test "login help by arg" { - run serverauditor login --help + run termius login --help [ "$status" -eq 0 ] } @test "login help command" { - run serverauditor help login + run termius help login [ "$status" -eq 0 ] } @@ -15,11 +15,11 @@ load test_helper if [ "$SERVERAUDITOR_USERNAME" == '' ] || [ "$SERVERAUDITOR_PASSWORD" == '' ];then skip '$SERVERAUDITOR_USERNAME or $SERVERAUDITOR_PASSWORD are not set!' fi - rm ~/.serverauditor/config || true + rm ~/.termius/config || true - run serverauditor login --username $SERVERAUDITOR_USERNAME -p $SERVERAUDITOR_PASSWORD + run termius login --username $SERVERAUDITOR_USERNAME -p $SERVERAUDITOR_PASSWORD [ "$status" -eq 0 ] - ! [ -z "$(cat ~/.serverauditor/config)" ] + ! [ -z "$(cat ~/.termius/config)" ] } @test "Change tester account" { @@ -27,12 +27,12 @@ load test_helper [ "$SERVERAUDITOR_USERNAME_2" == '' ] || [ "$SERVERAUDITOR_PASSWORD_2" == '' ] ;then skip '$SERVERAUDITOR_USERNAME or $SERVERAUDITOR_PASSWORD or $SERVERAUDITOR_USERNAME_2 or $SERVERAUDITOR_PASSWORD_2 are not set!' fi - rm ~/.serverauditor/config || true + rm ~/.termius/config || true - serverauditor login --username $SERVERAUDITOR_USERNAME -p $SERVERAUDITOR_PASSWORD + termius login --username $SERVERAUDITOR_USERNAME -p $SERVERAUDITOR_PASSWORD populate_storage - run serverauditor login --username $SERVERAUDITOR_USERNAME_2 -p $SERVERAUDITOR_PASSWORD_2 + run termius login --username $SERVERAUDITOR_USERNAME_2 -p $SERVERAUDITOR_PASSWORD_2 [ "$status" -eq 0 ] - ! [ -z "$(cat ~/.serverauditor/config)" ] + ! [ -z "$(cat ~/.termius/config)" ] assert_clear_storage } diff --git a/tests/integration/logout.bats b/tests/integration/logout.bats index fdbf9b5..7f1a325 100644 --- a/tests/integration/logout.bats +++ b/tests/integration/logout.bats @@ -6,12 +6,12 @@ setup() { } @test "logout help by arg" { - run serverauditor logout --help + run termius logout --help [ "$status" -eq 0 ] } @test "logout help command" { - run serverauditor help logout + run termius help logout [ "$status" -eq 0 ] } @@ -20,11 +20,11 @@ setup() { skip '$SERVERAUDITOR_USERNAME and $SERVERAUDITOR_PASSWORD are not set!' fi - rm ~/.serverauditor/config || true - serverauditor login --username $SERVERAUDITOR_USERNAME -p $SERVERAUDITOR_PASSWORD + rm ~/.termius/config || true + termius login --username $SERVERAUDITOR_USERNAME -p $SERVERAUDITOR_PASSWORD populate_storage - run serverauditor logout + run termius logout [ "$status" -eq 0 ] - [ -z "$(cat ~/.serverauditor/config)" ] + [ -z "$(cat ~/.termius/config)" ] assert_clear_storage } diff --git a/tests/integration/pfrule.bats b/tests/integration/pfrule.bats index 0d93c98..ffbe874 100644 --- a/tests/integration/pfrule.bats +++ b/tests/integration/pfrule.bats @@ -7,18 +7,18 @@ setup() { } @test "pfrule help by arg" { - run serverauditor pfrule --help + run termius pfrule --help [ "$status" -eq 0 ] } @test "pfrule help command" { - run serverauditor help pfrule + run termius help pfrule [ "$status" -eq 0 ] } @test "Add local pfrule" { - host=$(serverauditor host --label test2 --address local) - run serverauditor pfrule --local --host $host --binding 2:127.0.0.1:2222 + host=$(termius host --label test2 --address local) + run termius pfrule --local --host $host --binding 2:127.0.0.1:2222 [ "$status" -eq 0 ] [ $(get_models_set_length 'pfrule_set') -eq 1 ] pfrule=${lines[1]} @@ -31,8 +31,8 @@ setup() { } @test "Add remote pfrule" { - host="$(serverauditor host --label test2 --address 127.0.0.1)" - run serverauditor pfrule --remote --host $host --binding 2:127.0.0.1:2222 + host="$(termius host --label test2 --address 127.0.0.1)" + run termius pfrule --remote --host $host --binding 2:127.0.0.1:2222 [ "$status" -eq 0 ] [ $(get_models_set_length 'pfrule_set') -eq 1 ] pfrule=${lines[1]} @@ -45,8 +45,8 @@ setup() { } @test "Add dynamic pfrule" { - host="$(serverauditor host --label test2 --address 127.0.0.1)" - run serverauditor pfrule --dynamic --host $host --binding 2222 + host="$(termius host --label test2 --address 127.0.0.1)" + run termius pfrule --dynamic --host $host --binding 2222 [ "$status" -eq 0 ] [ $(get_models_set_length 'pfrule_set') -eq 1 ] pfrule=${lines[1]} @@ -59,8 +59,8 @@ setup() { } @test "Add local pfrule with bound_address" { - host="$(serverauditor host --label test2 --address 127.0.0.1)" - run serverauditor pfrule --local --host $host --binding local:2:127.0.0.1:2222 + host="$(termius host --label test2 --address 127.0.0.1)" + run termius pfrule --local --host $host --binding local:2:127.0.0.1:2222 [ "$status" -eq 0 ] [ $(get_models_set_length 'pfrule_set') -eq 1 ] pfrule=${lines[1]} @@ -73,8 +73,8 @@ setup() { } @test "Add remote pfrule with bound_address" { - host="$(serverauditor host --label test2 --address 127.0.0.1)" - run serverauditor pfrule --remote --host $host --binding localhost:2:127.0.0.1:2222 + host="$(termius host --label test2 --address 127.0.0.1)" + run termius pfrule --remote --host $host --binding localhost:2:127.0.0.1:2222 [ "$status" -eq 0 ] [ $(get_models_set_length 'pfrule_set') -eq 1 ] pfrule=${lines[1]} @@ -87,8 +87,8 @@ setup() { } @test "Add dynamic pfrule with bound_address" { - host="$(serverauditor host --label test2 --address 127.0.0.1)" - run serverauditor pfrule --dynamic --host $host --binding 127.0.0.1:2222 + host="$(termius host --label test2 --address 127.0.0.1)" + run termius pfrule --dynamic --host $host --binding 127.0.0.1:2222 [ "$status" -eq 0 ] [ $(get_models_set_length 'pfrule_set') -eq 1 ] pfrule=${lines[1]} @@ -101,9 +101,9 @@ setup() { } @test "Update local pfrule" { - host="$(serverauditor host --label test2 --address 127.0.0.1)" - pfrule=$(serverauditor pfrule --local --host $host --binding local:2:127.0.0.1:2222) - run serverauditor pfrule --binding local:2:127.0.0.1:2200 $pfrule + host="$(termius host --label test2 --address 127.0.0.1)" + pfrule=$(termius pfrule --local --host $host --binding local:2:127.0.0.1:2222) + run termius pfrule --binding local:2:127.0.0.1:2200 $pfrule [ "$status" -eq 0 ] [ $(get_models_set_length 'pfrule_set') -eq 1 ] pfrule=${lines[1]} @@ -116,67 +116,67 @@ setup() { } @test "Update many remote pfrules" { - host1="$(serverauditor host --label test2 --address 127.0.0.1)" - pfrule1=$(serverauditor pfrule --remote --host $host1 --binding localhost:2:127.0.0.1:2222) - pfrule2=$(serverauditor pfrule --remote --host $host1 --binding localhost:2:127.0.0.1:2220) - host2="$(serverauditor host --label test3 --address 127.0.0.2)" - run serverauditor pfrule --host $host2 $pfrule1 $pfrule2 + host1="$(termius host --label test2 --address 127.0.0.1)" + pfrule1=$(termius pfrule --remote --host $host1 --binding localhost:2:127.0.0.1:2222) + pfrule2=$(termius pfrule --remote --host $host1 --binding localhost:2:127.0.0.1:2220) + host2="$(termius host --label test3 --address 127.0.0.2)" + run termius pfrule --host $host2 $pfrule1 $pfrule2 [ "$status" -eq 0 ] [ $(get_models_set_length 'pfrule_set') -eq 2 ] } @test "Delete local pfrule" { - host="$(serverauditor host --label test2 --address 127.0.0.1)" - pfrule=$(serverauditor pfrule --local --host $host --binding local:2:127.0.0.1:2222) - run serverauditor pfrule --delete $pfrule + host="$(termius host --label test2 --address 127.0.0.1)" + pfrule=$(termius pfrule --local --host $host --binding local:2:127.0.0.1:2222) + run termius pfrule --delete $pfrule [ "$status" -eq 0 ] [ $(get_models_set_length 'pfrule_set') -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] } @test "Delete many remote pfrules" { - host1="$(serverauditor host --label test2 --address 127.0.0.1)" - pfrule1=$(serverauditor pfrule --remote --host $host1 --binding localhost:2:127.0.0.1:2222) - pfrule2=$(serverauditor pfrule --remote --host $host1 --binding localhost:2:127.0.0.1:2220) - run serverauditor pfrule --delete $pfrule1 $pfrule2 --debug + host1="$(termius host --label test2 --address 127.0.0.1)" + pfrule1=$(termius pfrule --remote --host $host1 --binding localhost:2:127.0.0.1:2222) + pfrule2=$(termius pfrule --remote --host $host1 --binding localhost:2:127.0.0.1:2220) + run termius pfrule --delete $pfrule1 $pfrule2 --debug [ "$status" -eq 0 ] [ $(get_models_set_length 'pfrule_set') -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] } @test "Not add local pfrule with invalid binding" { - host="$(serverauditor host --label test2 --address 127.0.0.1)" - run serverauditor pfrule --local --host $host --binding 127.0.0.1:2222 + host="$(termius host --label test2 --address 127.0.0.1)" + run termius pfrule --local --host $host --binding 127.0.0.1:2222 [ "$status" -eq 1 ] [ $(get_models_set_length 'pfrule_set') -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] } @test "Not add remote pfrule with invalid binding" { - host="$(serverauditor host --label test2 --address 127.0.0.1)" - run serverauditor pfrule --remote --host $host --binding 127.0.0.1:2222 + host="$(termius host --label test2 --address 127.0.0.1)" + run termius pfrule --remote --host $host --binding 127.0.0.1:2222 [ "$status" -eq 1 ] [ $(get_models_set_length 'pfrule_set') -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] } @test "Not add dynamic pfrule with invalid binding" { - host="$(serverauditor host --label test2 --address 127.0.0.1)" - run serverauditor pfrule --dynamic --host $host --binding 127.0.0.1:2222.13 + host="$(termius host --label test2 --address 127.0.0.1)" + run termius pfrule --dynamic --host $host --binding 127.0.0.1:2222.13 [ "$status" -eq 1 ] [ $(get_models_set_length 'pfrule_set') -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] } @test "Not add remote pfrule require host" { - run serverauditor pfrule --remote --binding localhost:2:127.0.0.1:2222 + run termius pfrule --remote --binding localhost:2:127.0.0.1:2222 [ "$status" -eq 1 ] - ! [ -f ~/.serverauditor/storage ] + ! [ -f ~/.termius/storage ] } @test "Not add remote pfrule require pf_type" { - host="$(serverauditor host --label test2 --address 127.0.0.1)" - run serverauditor pfrule --host $host --binding localhost:2:127.0.0.1:2222 + host="$(termius host --label test2 --address 127.0.0.1)" + run termius pfrule --host $host --binding localhost:2:127.0.0.1:2222 [ "$status" -eq 1 ] [ $(get_models_set_length 'pfrule_set') -eq 0 ] [ $(get_models_set_length 'host_set') -eq 1 ] diff --git a/tests/integration/pfrules.bats b/tests/integration/pfrules.bats index 6f789ef..87a0b42 100644 --- a/tests/integration/pfrules.bats +++ b/tests/integration/pfrules.bats @@ -7,19 +7,19 @@ setup() { } @test "pfrules help by arg" { - run serverauditor pfrules --help + run termius pfrules --help [ "$status" -eq 0 ] } @test "pfrules help command" { - run serverauditor help pfrules + run termius help pfrules [ "$status" -eq 0 ] } @test "List pfrules in table format" { - host="$(serverauditor host --label test2 --address 127.0.0.1)" - serverauditor pfrule --dynamic --host $host --binding 127.0.0.1:2222 - run serverauditor pfrules + host="$(termius host --label test2 --address 127.0.0.1)" + termius pfrule --dynamic --host $host --binding 127.0.0.1:2222 + run termius pfrules [ "$status" -eq 0 ] [ $(get_models_set_length 'pfrule_set') -eq 1 ] } diff --git a/tests/integration/pull.bats b/tests/integration/pull.bats index c3266aa..aa37eb0 100644 --- a/tests/integration/pull.bats +++ b/tests/integration/pull.bats @@ -7,31 +7,31 @@ setup() { } @test "pull help by arg" { - run serverauditor pull --help + run termius pull --help [ "$status" -eq 0 ] } @test "pull help command" { - run serverauditor help pull + run termius help pull [ "$status" -eq 0 ] } @test "pull logged in" { - login_serverauditor + login_termius - run serverauditor pull -p $SERVERAUDITOR_PASSWORD + run termius pull -p $SERVERAUDITOR_PASSWORD [ "$status" -eq 0 ] } @test "pull logged in incorrect password" { - login_serverauditor + login_termius - run serverauditor pull -p "" + run termius pull -p "" [ "$status" -eq 1 ] } @test "pull not logged in" { - serverauditor logout - run serverauditor pull -p "" + termius logout + run termius pull -p "" [ "$status" -eq 1 ] } diff --git a/tests/integration/push.bats b/tests/integration/push.bats index 31dc6b2..b7657cc 100644 --- a/tests/integration/push.bats +++ b/tests/integration/push.bats @@ -6,33 +6,33 @@ setup() { } @test "push help by arg" { - run serverauditor push --help + run termius push --help [ "$status" -eq 0 ] } @test "push help command" { - run serverauditor help push + run termius help push [ "$status" -eq 0 ] } @test "push logged in" { - login_serverauditor + login_termius - serverauditor pull -p $SERVERAUDITOR_PASSWORD - run serverauditor push -p $SERVERAUDITOR_PASSWORD + termius pull -p $SERVERAUDITOR_PASSWORD + run termius push -p $SERVERAUDITOR_PASSWORD [ "$status" -eq 0 ] } @test "push nothing logged in incorrect password" { - login_serverauditor + login_termius - run serverauditor push -p "" --debug + run termius push -p "" --debug echo ${lines[*]} [ "$status" -eq 1 ] } @test "push not logged in" { - serverauditor logout - run serverauditor pull -p "" + termius logout + run termius pull -p "" [ "$status" -eq 1 ] } diff --git a/tests/integration/settings.bats b/tests/integration/settings.bats index 537c74e..7469a69 100644 --- a/tests/integration/settings.bats +++ b/tests/integration/settings.bats @@ -6,21 +6,21 @@ setup() { } @test "info help by arg" { - run serverauditor settings --help + run termius settings --help [ "$status" -eq 0 ] } @test "info help command" { - run serverauditor help settings + run termius help settings [ "$status" -eq 0 ] } @test "Settings yes" { - run serverauditor settings --synchronize-key=yes --agent-forwarding yes + run termius settings --synchronize-key=yes --agent-forwarding yes [ "$status" -eq 0 ] } @test "Settings no" { - run serverauditor settings --synchronize-key=no --agent-forwarding no + run termius settings --synchronize-key=no --agent-forwarding no [ "$status" -eq 0 ] } diff --git a/tests/integration/snippet.bats b/tests/integration/snippet.bats index e60cce9..a50be99 100644 --- a/tests/integration/snippet.bats +++ b/tests/integration/snippet.bats @@ -7,17 +7,17 @@ setup() { } @test "Snippet help by arg" { - run serverauditor snippet --help + run termius snippet --help [ "$status" -eq 0 ] } @test "Snippet help command" { - run serverauditor help snippet + run termius help snippet [ "$status" -eq 0 ] } @test "Add general snippet" { - run serverauditor snippet -L test --script 'ls' + run termius snippet -L test --script 'ls' [ "$status" -eq 0 ] [ $(get_models_set_length 'snippet_set') -eq 1 ] snippet=${lines[1]} @@ -26,16 +26,16 @@ setup() { } @test "Add many snippets" { - run serverauditor snippet -L test_1 --script 'ls' - run serverauditor snippet -L test_2 --script 'whoami' - run serverauditor snippet -L test_3 --script 'exit' + run termius snippet -L test_1 --script 'ls' + run termius snippet -L test_2 --script 'whoami' + run termius snippet -L test_3 --script 'exit' [ "$status" -eq 0 ] [ $(get_models_set_length 'snippet_set') -eq 3 ] } @test "Update snippet" { - snippet=$(serverauditor snippet -L test --script 'ls') - run serverauditor snippet --script 'cd /' $snippet + snippet=$(termius snippet -L test --script 'ls') + run termius snippet --script 'cd /' $snippet [ "$status" -eq 0 ] [ $(get_models_set_length 'snippet_set') -eq 1 ] [ "$(get_model_field 'snippet_set' $snippet 'label')" = '"test"' ] @@ -43,26 +43,26 @@ setup() { } @test "Update many snippets" { - snippet1=$(serverauditor snippet -L test_1 --script 'ls') - snippet2=$(serverauditor snippet -L test_2 --script 'whoami') - snippet3=$(serverauditor snippet -L test_3 --script 'exit') - run serverauditor snippet --script 'cd /' $snippet1 $snippet2 $snippet3 + snippet1=$(termius snippet -L test_1 --script 'ls') + snippet2=$(termius snippet -L test_2 --script 'whoami') + snippet3=$(termius snippet -L test_3 --script 'exit') + run termius snippet --script 'cd /' $snippet1 $snippet2 $snippet3 [ "$status" -eq 0 ] [ $(get_models_set_length 'snippet_set') -eq 3 ] } @test "Delete snippet" { - snippet=$(serverauditor snippet -L test --script 'ls') - run serverauditor snippet --delete $snippet + snippet=$(termius snippet -L test --script 'ls') + run termius snippet --delete $snippet [ "$status" -eq 0 ] [ $(get_models_set_length 'snippet_set') -eq 0 ] } @test "Delete many snippets" { - snippet1=$(serverauditor snippet -L test_1 --script 'ls') - snippet2=$(serverauditor snippet -L test_2 --script 'whoami') - snippet3=$(serverauditor snippet -L test_3 --script 'exit') - run serverauditor snippet --delete $snippet1 $snippet2 $snippet3 + snippet1=$(termius snippet -L test_1 --script 'ls') + snippet2=$(termius snippet -L test_2 --script 'whoami') + snippet3=$(termius snippet -L test_3 --script 'exit') + run termius snippet --delete $snippet1 $snippet2 $snippet3 [ "$status" -eq 0 ] [ $(get_models_set_length 'snippet_set') -eq 0 ] } diff --git a/tests/integration/snippets.bats b/tests/integration/snippets.bats index 3cc4c9f..ba4488d 100644 --- a/tests/integration/snippets.bats +++ b/tests/integration/snippets.bats @@ -7,18 +7,18 @@ setup() { } @test "snippets help by arg" { - run serverauditor snippets --help + run termius snippets --help [ "$status" -eq 0 ] } @test "snippets help command" { - run serverauditor help snippets + run termius help snippets [ "$status" -eq 0 ] } @test "List snippets in table format" { - serverauditor snippet -L test --script 'ls' - run serverauditor snippets + termius snippet -L test --script 'ls' + run termius snippets [ "$status" -eq 0 ] [ $(get_models_set_length 'snippet_set') -eq 1 ] } diff --git a/tests/integration/sync.bats b/tests/integration/sync.bats index 470f931..ef8124f 100644 --- a/tests/integration/sync.bats +++ b/tests/integration/sync.bats @@ -1,17 +1,17 @@ #!/usr/bin/env bats @test "sync help by arg" { - run serverauditor sync --help + run termius sync --help [ "$status" -eq 0 ] } @test "sync help command" { - run serverauditor help sync + run termius help sync [ "$status" -eq 0 ] } @test "sync not supported service" { - run serverauditor sync awesomeservice + run termius sync awesomeservice [ "$status" -eq 1 ] [ "$output" = "Do not support service: awesomeservice." ] } diff --git a/tests/integration/tags.bats b/tests/integration/tags.bats index 12ebc9c..a8aa80a 100644 --- a/tests/integration/tags.bats +++ b/tests/integration/tags.bats @@ -7,35 +7,35 @@ setup() { } @test "tags help by arg" { - run serverauditor tags --help + run termius tags --help [ "$status" -eq 0 ] } @test "tags help command" { - run serverauditor help tags + run termius help tags [ "$status" -eq 0 ] } @test "tags list" { - serverauditor host -L test --port 2022 --address localhost --username root --password password -t A -t B -t C + termius host -L test --port 2022 --address localhost --username root --password password -t A -t B -t C - run serverauditor tags + run termius tags [ "$status" -eq 0 ] [ $(get_models_set_length 'tag_set') -eq 3 ] [ $(get_models_set_length 'taghost_set') -eq 3 ] } @test "tags filter not existed" { - run serverauditor tags 1 + run termius tags 1 [ "$status" -eq 1 ] } @test "tags list filter some" { - serverauditor host -L test --address localhost --username root --password password -t A -t B -t C - serverauditor host -L test --address local2 --username root -t 1 -t A -t B - serverauditor host -L test --address host1 --password password -t A + termius host -L test --address localhost --username root --password password -t A -t B -t C + termius host -L test --address local2 --username root -t 1 -t A -t B + termius host -L test --address host1 --password password -t A - run serverauditor tags A B --debug + run termius tags A B --debug [ "$status" -eq 0 ] [ $(get_models_set_length 'tag_set') -eq 4 ] [ $(get_models_set_length 'taghost_set') -eq 7 ] diff --git a/tests/integration/test_helper.bash b/tests/integration/test_helper.bash index 162d7a9..98afbda 100644 --- a/tests/integration/test_helper.bash +++ b/tests/integration/test_helper.bash @@ -1,37 +1,37 @@ -login_serverauditor () { +login_termius () { if [ "$SERVERAUDITOR_USERNAME" == '' ] || [ "$SERVERAUDITOR_PASSWORD" == '' ];then skip '$SERVERAUDITOR_USERNAME and $SERVERAUDITOR_PASSWORD are not set!' fi - serverauditor login --username $SERVERAUDITOR_USERNAME -p $SERVERAUDITOR_PASSWORD + termius login --username $SERVERAUDITOR_USERNAME -p $SERVERAUDITOR_PASSWORD } -pull_serverauditor() { - login_serverauditor +pull_termius() { + login_termius - serverauditor pull -p $SERVERAUDITOR_PASSWORD + termius pull -p $SERVERAUDITOR_PASSWORD } get_models_set() { - cat ~/.serverauditor/storage | jq .$1 + cat ~/.termius/storage | jq .$1 } get_models_set_length() { - cat ~/.serverauditor/storage | jq ".$1 | length" + cat ~/.termius/storage | jq ".$1 | length" } get_model_field() { - instances=$(cat ~/.serverauditor/storage | jq ".$1" | jq ".[] | select(.${4:-id} == $2)") + instances=$(cat ~/.termius/storage | jq ".$1" | jq ".[] | select(.${4:-id} == $2)") echo $instances | jq ".$3" } clean_storage() { - rm ~/.serverauditor/storage + rm ~/.termius/storage } populate_storage() { - serverauditor host --address localhost + termius host --address localhost } assert_clear_storage() { diff --git a/tests/sync/providers/ssh_test.py b/tests/sync/providers/ssh_test.py index e4f218d..09b75c2 100644 --- a/tests/sync/providers/ssh_test.py +++ b/tests/sync/providers/ssh_test.py @@ -3,13 +3,13 @@ from mock import patch, MagicMock from six import StringIO from nose.tools import eq_ -from serverauditor_sshconfig.sync.providers.ssh import SSHService -from serverauditor_sshconfig.core.models.terminal import ( +from termius.sync.providers.ssh import SSHService +from termius.core.models.terminal import ( Host, SshConfig, Identity, SshKey ) -@patch('serverauditor_sshconfig.sync.providers.ssh.Path') +@patch('termius.sync.providers.ssh.Path') def test_empty_sshconfig(mockpath): mockpath.return_value.open.return_value.__enter__.return_value = StringIO() service = SSHService(None, '') @@ -17,7 +17,7 @@ def test_empty_sshconfig(mockpath): eq_(ssh_hosts, []) -@patch('serverauditor_sshconfig.sync.providers.ssh.Path') +@patch('termius.sync.providers.ssh.Path') def test_single_sshconfig(mockpath): mockpath.return_value.open.return_value.__enter__.return_value = StringIO( """ @@ -51,7 +51,7 @@ def test_single_sshconfig(mockpath): ]) -@patch('serverauditor_sshconfig.sync.providers.ssh.Path') +@patch('termius.sync.providers.ssh.Path') def test_single_sshconfig_with_fnmatch(mockpath): mockpath.return_value.open.return_value.__enter__.return_value = StringIO( """ @@ -84,7 +84,7 @@ def test_single_sshconfig_with_fnmatch(mockpath): ]) -@patch('serverauditor_sshconfig.sync.providers.ssh.Path') +@patch('termius.sync.providers.ssh.Path') def test_single_sshconfig_with_keys(mockpath): sshconfig_content = """ Host firstone