From 111d9951edb33c01be2ce1042956ba029badae9a Mon Sep 17 00:00:00 2001 From: ansgarz Date: Sun, 27 Aug 2023 12:51:57 +0200 Subject: [PATCH] [skip ci] rename isHostKnown -> isKnownHost --- .../provs/framework/ubuntu/keys/base/Ssh.kt | 2 +- .../provs/framework/ubuntu/git/base/GitKtTest.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/keys/base/Ssh.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/keys/base/Ssh.kt index d4d4cbc..3cfe7e9 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/keys/base/Ssh.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/keys/base/Ssh.kt @@ -23,7 +23,7 @@ fun Prov.configureSshKeys(sshKeys: SshKeyPair) = task { * * @return whether if was found */ -fun Prov.isHostKnown(hostOrIp: String): Boolean { +fun Prov.isKnownHost(hostOrIp: String): Boolean { return cmdNoEval("ssh-keygen -F $hostOrIp").out?.isNotEmpty() ?: false } diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/git/base/GitKtTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/git/base/GitKtTest.kt index 51f6a14..1376ae0 100644 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/git/base/GitKtTest.kt +++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/git/base/GitKtTest.kt @@ -3,7 +3,7 @@ package org.domaindrivenarchitecture.provs.framework.ubuntu.git.base import org.domaindrivenarchitecture.provs.desktop.domain.addKnownHosts import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.checkDir import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.aptInstall -import org.domaindrivenarchitecture.provs.framework.ubuntu.keys.base.isHostKnown +import org.domaindrivenarchitecture.provs.framework.ubuntu.keys.base.isKnownHost import org.domaindrivenarchitecture.provs.test.defaultTestContainer import org.domaindrivenarchitecture.provs.test.tags.ContainerTest import org.domaindrivenarchitecture.provs.test.tags.ExtensiveContainerTest @@ -24,8 +24,8 @@ internal class GitKtTest { // then assertTrue(res.success) - assertTrue(a.isHostKnown("github.com"), "github.com does not seem to be a known host") - assertTrue(a.isHostKnown("gitlab.com"), "gitlab.com does not seem to be a known host") + assertTrue(a.isKnownHost("github.com"), "github.com does not seem to be a known host") + assertTrue(a.isKnownHost("gitlab.com"), "gitlab.com does not seem to be a known host") } @ExtensiveContainerTest