Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Enhancement: better testing progress #22

Open
TieWay59 opened this issue Mar 11, 2023 · 2 comments
Open

Enhancement: better testing progress #22

TieWay59 opened this issue Mar 11, 2023 · 2 comments

Comments

@TieWay59
Copy link
Contributor

@freedomkk-qfeng 在修复 #20 的过程中,我有一些新的想法:

目前的测试把 ip 和端口硬编码在开源代码中,是一种不太安全的实践。理论上应该由用户手动填写一个本地数据文件。

还有我通过阅读 ssh.go 这个包的源码发现,google 内部的单元测试是编写了一个模拟 ssh server 的对象来测试的。我觉得也可以借用这种思想去设计更好的测试流程。

https://cs.opensource.google/go/x/crypto/+/master:ssh/test/test_unix_test.go;l=300-301;drc=776e461a4e6d8b372a43c72122c5c28cfc40dca2

关于真机测试,还可以采用 ssh -T [email protected] 这种方式来验证远程连接的有效性,因为大多数人从GitHub克隆项目一般都已经配置了GitHub上的公钥。参考: https://docs.github.com/zh/authentication/connecting-to-github-with-ssh/testing-your-ssh-connection

@freedomkk-qfeng
Copy link
Member

git 的 ssh 测试,意义可能偏小。这个项目主要的场景是用于批量的ssh设备维护,他们绝大部分时候都是账号口令的方式。

模拟一个 ssh server 的对象来测试,是一个很好的想法,可以尝试。

@freedomkk-qfeng
Copy link
Member

freedomkk-qfeng commented Mar 12, 2023

关于密钥的部分,实际上这对了另一个需求 #18
如果尝试做这个优化的话,可以在这里引入 ssh -T [email protected] 的测试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants