-
Notifications
You must be signed in to change notification settings - Fork 3k
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
testing: Add vagrant based integration tests #45
Conversation
70f284a
to
1f0fe9c
Compare
cc5444c
to
1ff73f8
Compare
I've used Vagrant quite a bit in the past, so I'll take care of reviewing this. Right now I don't have VirtualBox installed, so the review will take a bit of time. |
I tested this a bit with latest Vagrant+Virtualbox and most of it seemed to work fine out of the box - excellent work! I'm just wondering what kind of test setup we want exactly... right now, the "real" test server runs several OpenVPN server instances configured differently and listening on different ports. Each of the clients (buildslaves) connect to each of the server instances in turn. This is something we might (or might not) want to replicate here. Another option would be to focus on building and running the server-side code on different VM instances, each running a different OS, and run the tests to ensure that the virtual host can connect to each of them. There could be several differently configured OpenVPN server instances on each of the VMs. Is this what you're trying achieve here? In any case, I think we should strive for maximum automation, so that any developer is able to recreate the t_client.sh test environment with minimal tinkering and knowledge about t_client.sh. Which brings me to a couple of issues I noticed:
What about having a tailored t_client.rc-vagrant file that fixes the two issues above? Making the VPN IP addresses predictable probably takes some effort, but would be worth it imho. This is probably unrelated to this patch, but I noticed that the "stopping OpenVPN" part in t_client.sh hangs (indefinitely?) on Fedora 23. |
Hi
Both are viable routes that might not be exclusive (e.g. maybe they are more or less the same with a slightly different configuration) IMHO the use cases are:
Use case #1 is a MUST. Use case #2 is a SHOULD, and #3 its a COULD My high level goals:
Next iteration :-) Cheers
|
Right now we do this after the patch is in Git "master", because buildbot polls the "master" branch. We could and intend to add more testing branches that allow us to trigger builds before pushing anything to master.
This is a good start and a reasonable sanity test. We can implement 2) and 3) as needed.
I agree, as we're probably targeting individual developers with Vagrant. The project as a whole can afford more complex testing systems, as those are built only once and the maintenance cost is thus low. |
@neuhalje : any progress on fixing the issues that I identified? One further issue I noticed is the use of #!/bin/bash in some of the scripts. The scripts might include some bashisms, which need to be removed also. While most developers probably run Linux, Vagrant and Virtualbox also run on FreeBSD, which does not have Bash installed by default. So it would be preferable If the scripts were converted to POSIX shell format to avoid complaints later on. As the last step the commits could probably be squashed to a few larger ones with no ill effects. |
I'll look into the bashisms to get this moving forward. This PR might benefit from the new t_client.rc EXPECT_IFCONFIG* auto-detection and caching patch that just got merged. |
Provide a virtual machine based 'in situ' integration test setup that integrates t_client.sh with phoenix-style test servers. E.g. running `tests/server/ubuntu_precise64/launch_t_client.sh` would - Create a fresh Ubuntu Precise VM - Install everything needed to build openvpn - Compile openvpn from the current source - Start the openvpn server inside the VM - Optionally: Locally run t_client.sh against this servers IP Details: - Each of the virtual machines is configured to compile openvpn and run a server from the current source. - Inside the vm a openvpn server can be launched to run `t_client.sh` tests against it. Sample launcher scripts are provided. - Virtual machines defined by [Vagrant](https://www.vagrantup.com) scripts. VirtualBox is used for virtualisation. Signed-off-by: Jens Neuhalfen <jens@neuhalfen.name>
This script will prepare (compile and start openvpn) a VM, run t_client.sh against it, and then halt the VM. The local and remote output is merged in the console and colorized to highlight the interaction between client and server. Tested on MacOS X. Signed-off-by: Jens Neuhalfen <jens@neuhalfen.name>
Split up sourcing of t_client.rc and running sudo. Also always source tc_client.sh regardless of we already run as root (preparation for further usage of t_client.rc parameters).
c971ac1
to
2bb90cf
Compare
Ok, back again. I'm going to try to get the scripts ksh compatible. |
@neuhalje : it's been a while since I implemented the IP caching, but two things need to be done:
|
Independent from the rest of this, the "run tests needing 'ld --wrap' only where supported" sounds like something we want to have right away... can you send that one as standalone patch relative to master to the -devel list? thanks (Actually, I want the functionality, but we should check whether ld --wrap works, instead of just declaring "only on Linux" - FreeBSD has clang with the GNU ld, so it works perfectly fine there, for example. So the first hunk needs to be "configure runs a ld --wrap test" not "on Linux") |
--wrap is a feature of ld that is only available on Linux systems. http://www.mockator.com/projects/mockator/wiki/Wrap_Functions "Alas, this feature is *only available with the GNU tool chain on Linux*. GCC for Mac OS X does not offer the linker flag --wrap. "
04d565c
to
b4183ac
Compare
I pushed the 'ld --wrap' fix as PR #79 |
@cron2 Gert, any clue on how to run a |
Hi,
On Tue, Jan 17, 2017 at 03:13:37PM -0800, Jens Neuhalfen wrote:
Gert, any clue on how to run a `ld --wrap`-works test? My autotools are sub-zero
My autotools knowledge is at 0.03 or so, so "more than zero because I
had to", but not really. Selva is the wonderman, though :-)
But we'll get this done together!
gert
…--
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany gert@greenie.muc.de
fax: +49-89-35655025 gert@net.informatik.tu-muenchen.de
|
|
on macos:
|
try 'ld --help 2>/dev/null' |
Let's continue the '--wrap' topic on PR#79 |
sorry, I did not notice "vagrant" in the topic |
probably dead by now .. cleaning up |
This PR was a good idea and I intended to get this merged. But I had never time to do it, nor does it look likely that I ever will 😞. |
This patch will add test servers to use with t_client.sh. This will make testing on different systems much easier. Bonus: testing on a laptop is a breeze by "one command integration tests".
Example
Virtual machines are defined by Vagrant scripts. Virtualbox is used for virtualisation.
Each of the virtual machines is configured to compile openvpn and run a server.
Inside the vm a openvpn server can be launched to run
t_client.sh
tests against it. Sample launcher scripts are provided.