-
Notifications
You must be signed in to change notification settings - Fork 7
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
one_session branch working with win7 #14
base: Transport
Are you sure you want to change the base?
Conversation
…itial copy is working but dirty check not working and recopy copying bad zip
…e. The is implemented from the base driver so SSH will remain unchanged but winrm will go down this path
The busser will currently fail given any set of test files greater than 8k. This is due to windows 8k command line limit that basically limits what can be sent to the busser via stdin. I just added functionality to ensure that the busser uses the transport upload method. This is done in the base driver so SSH is unaffected. It may be best to have SSH go down this route as well to keep things simpler. However, its clear that the original intent of the busser is to have the busser gem handle as much instance side logic as possible including file copy. I think this needs to be reconsidered in a future release since this approach just will not work with any sizable windows test suite. |
I think this breaks linux via test kitchen. See below: chefdk! $> kitchen verify
If I switch back to Salim's code Linux works but Windows does not due to 8K limitation. |
Interesting. Would you mind running with I have not had issues running against linux but perhaps your driver is using the base driver and not the Thanks for reporting this! |
I will as soon as I am able. I am using Salim's kitchen-vagrant fork. |
cool. what driver are you using? |
The kitchen-vagrant fork 0.16.0 from salim's repo with vagrant 1.6.5 and virtualbox 4.3.20. Hopefully this answers your question. |
Transport branch |
that does thanks! |
kitchen debug output: -----> Starting Kitchen (v1.3.0) sudo -E /tmp/busser/bin/busser suite cleanup ') D ------Backtrace------- |
Thanks. I'll take a look at this today. I'm working out of a new pr now. Salim's branch was recently ported to a new branch that has been merged with the latest test-kitchen code. That branch has been broken by some of the recent path changes but I've got that working to the point now that I can test your scenario. I typically use a vsphere driver for Linux VMS and not vagrant so that driver is likely going through the base driver so I obviously need to tweak things there. |
I was able to reproduce this using this cookbook: https://github.com/mwrock/export-node I have a fix that i pushed to the PR mentioned above: I validated the fix on my box. Its a simple one line change that adds the /tmp/busser directory on linux during setup so that the subsequent uploads via scp do not fail with permissions problems. Again, thanks so much for mentioning this and if you have a chance to test, let me know if you have any further issues. |
Hmm, just looked at your most recent change. Have not tested it yet but wondering how that one line affects sup connections to Linux, given where it is in the code. Will test it today. |
Forget my last, I see it, was originally thinking it was in the cmd block but now see it is in Bourne block. Will test it today. |
Still failing. I run Salim's Transport branch code and verify works fine using a bats test suite. I then change to to this code leaving the successfully verified virtual box vm untouched and run another verify. Setup Completes. Verify Starts and runs 'sudo -E /tmp/busser/bin/busser suite cleanup' which deletes '/tmp/busser/suites/bats' leaving '/tmp/busser/suites/'. I think the issue is with the code: 183 local_suite_files.each do |f| Even if I create the full directory path manually expected on the vm the file copy fails. However, if I manually add write access using 'chmod o+w /tmp/busser/suites' a verify using your code works. Verify action is not able to create the /tmp/busser/suites/bats folder unless suites folder has relaxed write perms. That is as far as I got. Hopefully it points you in the right direction. |
Probably not a good fix but I changed your one line of code into these two lines: #{sudo("mkdir")} -p #{config[:root_path]}/suites Fixes the issue on Linux. |
ah yes. this would be required if you were trying the fix on an instance that had already run setup under the former code path. I had whacked my /tmp directory prior to testing the fix. good catch and thanks! |
I will try again with your original code on a freshly created vm to see if that makes a difference. |
Tried with spinning up a new box. Still not 100%. 'kitchen test' now gets me:...output omitted for brevity... -----> Setting up Busser sudo -E /tmp/busser/bin/busser suite cleanup ') sudo -E /tmp/busser/bin/busser test
sudo -E /tmp/busser/bin/busser test
D ------Exception------- sudo -E /tmp/busser/bin/busser test sudo -E /tmp/busser/bin/busser test Looks like bats tests are loaded successfully but to '/tmp/busser/suites' instead of '/tmp/busser/suites/bats' Running kitchen verify then succeeds.After verify bats tests are in '/tmp/busser/suites/bats' |
Updated the above with debug output. |
sorry. things have been busy and have not had a chance to get to this. @afiune chimed in offline and suggested I add |
Yeah I posted the /suites add earlier in this thread and also told him (afiune) offline it fixed my issue. I wonder why the host OS seems to make a difference? I am developing on a Mac and the /suites is required. I have a fork based on his Transport branch merged with your one session branch plus the /suites add that I am using until something better is available. It works well for both linux and windows but the Serverspec Tests are very slow on Windows. |
Is test-kitchen#562 working well at this point? Should I switch to it instead of using the older one session branch? |
I’m gonna confirm later but it could be that the “flavor” of scp.exe on windows creates the directory with different perms?? I’ve noticed that sometimes the first test does take a while to start. I have not looked into it but it is definitely annoying. It’ll be nice when all this stuff gets merged together into master. From: Dax T Games Yeah I posted the /suites add earlier in this thread and also told him (afiune) offline it fixed my issue. I wonder why the host OS seems to make a difference? I am developing on a Mac and the /suites is required. I have a fork based on his Transport branch merged with your one session branch plus the /suites add that I am using until something better is available. It works well for both linux and windows but the Serverspec Tests are very slow on Windows. — |
That is off the branch that folks are doing testing. I need to do more testing myself but I have tested several scenarios successfully. If anything doesn’t work we’d really like to hear about it. Thanks a bunch for the feedback! From: Dax T Games Is test-kitchen#562 working well at this point? Should I switch to it instead of using the older one session branch? — |
This is now working on windows 7 and follows the approach we discussed of counting operations. I ended up taking the code in the latest WinRM dev branch that has my latest file copy code and copying it over because its cleaner and organized in such a way that tracking state on the shell is easier.
Unfortunately the lookup commands on the maxConcurrentOperationsPerUser property are also blocked remotely so I base the limit on your OS version. There is a slim chance that a user may have tweaked these but likely to increase them so I think this is pretty safe.
There was also a small but significant powershell snippet that broke in psv2 so had to fix that too and will be porting both fixes to winrm. Really glad you caught this! When winrm v1.3 releases, we can delete most of this code (yay!).
I'm gonna look into the busser copying next. Let me know if you run into any issues here.