可以在 Windows 上的单元测试中运行的虚拟迷你 Linux 发行版
我想自动测试一些用 Java 编写的远程 SSH 功能。为了真正测试它,我想要一些简单的 Linux 发行版来运行测试。自动化测试应该能够在 Windows 机器上运行。 Linux 可能作为来宾操作系统在某种虚拟机中运行,而测试类可能是启动和停止该操作系统的类。
你们中有人知道类似的事情或任何测试的替代方法吗?
I would like to automate testing of some remote SSH functionality written in Java. In order to test it for real I would like to have some simple Linux distro against which the test will run. Automated tests though should be able to run on Windows machine. Probably Linux may run in some kind of virtual machine as guest OS and test class may be the one starting and stopping that.
Do any of you know of something similar to this or any alternatives to testing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用安装了 Ubuntu 的 VirtualBox 来处理此类事情。原因是 VirtualBox 的设置非常简单,因此虚拟机看起来就像一台不同的计算机,具有本地计算机的正确 IP 地址(使用“桥接”网络接口),而 Ubuntu 的设置非常简单且快速(下载镜像,启动,回答 3-4 个问题,走开,15 分钟后回来)。
它还可以让您返回到上一个快照,以防万一您完全搞砸了。
如果关闭合成效果,它在“无缝”模式下也能完美运行,即您在 Windows 窗口中看到的 Linux 窗口就像屏幕上的任何其他窗口一样。
所以真的,所有的优点,几乎没有缺点。
I use VirtualBox with Ubuntu installed inside it for any such stuff. The reason being that VirtualBox is ridiculously easy to set up so the virtual machine looks like a different computer with a proper IP address for the local machine (use a "bridged" network interface), and Ubuntu is ridiculously easy and fast to set up (download the image, boot, answer 3-4 questions, walk away, come back 15 mins later).
It also lets you return to the last snapshot in case you totally screw it up.
It runs perfectly well in "seamless" mode too if compositing effects are turned off, i.e. you see the Linux Windows just like any other window on your screen, among the Windows windows.
So really, all the advantages, and hardly a disadvantage.
Cygwin 自 1995 年以来一直存在,非常适合在 Windows 下设置此类功能的单元测试,因为您可以在其中运行 sshd。请参阅 Cygwin 下的 sshd 和 Cygwin
Cygwin has been around since 1995, and would be perfect for setting up unit testing of this sort of feature under windows, since you can run an sshd in it. See sshd under Cygwin and Cygwin