User Tools

Site Tools


juju-testing

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
juju-testing [2015/02/05 19:30]
gsamfira
juju-testing [2015/07/09 15:54] (current)
bteleaga
Line 1: Line 1:
 ====== Running Juju-Core tests on Windows ====== ====== Running Juju-Core tests on Windows ======
  
-===== Installing a base windows ​system =====+===== Installing a base Windows ​system =====
  
-First we need to install a windows ​machine obviously. A verry light weight windows version (and free)  [[http://​www.microsoft.com/​en-us/​evalcenter/​evaluate-hyper-v-server-2012-r2|can be found at this link]]+First we need to install a Windows ​machineobviously. A very light weight windows version (and free)  [[http://​www.microsoft.com/​en-us/​evalcenter/​evaluate-hyper-v-server-2012-r2|can be found at this link]]. You may need to register first, but that's free and mostly painless.
  
-You can install this version of Windows on top of KVM using any ubuntu version >= Ubuntu 14.04. Installation steps are simple, just follow the wizzard.+You can install this version of Windows on top of KVM using any ubuntu version >= Ubuntu 14.04. Installation steps are simple, just follow the wizard.
  
 ===== Post install steps ===== ===== Post install steps =====
  
-Windows Hyper-V ​server ​2012 is basically a stripped down version of windows with no GUI (well almostGUI is baked into the kernel). When you first login, you should see something like this:+Windows Hyper-V ​Server ​2012 is basically a stripped down version of windows with no GUI (well almost, as the Windows ​GUI is baked into the kernel). When you first login, you should see something like this:
  
 {{:​059cbb7cf94b6f2ab7e94dc945ffa96c.png?​800|}} {{:​059cbb7cf94b6f2ab7e94dc945ffa96c.png?​800|}}
Line 26: Line 26:
   - select 2 and hit enter   - select 2 and hit enter
  
-This will enable remote desktop. Now lets disable the firewall (you don't really need it for testing). In the black cmd terminal type:+This will enable remote desktop. Now let'​s ​disable the firewall (you don't really need it for testing). In the black cmd terminal type:
  
   netsh advfirewall set allprofiles state off   netsh advfirewall set allprofiles state off
  
  
-You should now be able to connect to your windows ​machine via your favorite ​RDP client. On Ubuntu systems, my personal preference is remmina, but any client should work. +You should now be able to connect to your Windows ​machine via your favourite ​RDP client. On Ubuntu systems, my personal preference is Remmina, but any client should work. 
  
 ==== Installing Chocolatey ==== ==== Installing Chocolatey ====
  
-Chocolatey is awesome. Why its not default in windows is beyond me. In essence its a windows ​version of a package manager like apt-get or yum. So lets have us a little bit of chocolate. First lets get a powershell ​prompt. Working on windows ​after so many years of using Linux I have found that powershell ​is a more friendly tool then cmd, as it is better suited to my muscle memory. It has things like ls, mkdir, mv, rm aliased to powershell commandlets. Granted the options differ, but at least in their simplest forms, you get to use familiar commands. So lets open up a powershell ​terminal:+Chocolatey is awesome. Why it'​s ​not default in windows is beyond me. In essence its a Windows ​version of a package manager like apt-get or yum. So let'​s ​have us a little bit of chocolate. First lets get a PowerShell ​prompt. Working on Windows ​after so many years of using LinuxI have found that PowerShell ​is a more friendly tool than cmd, as it is better suited to my muscle memory. It has things like ls, mkdir, mv, rm aliased to powershell commandlets. Granted the options differ, but at least in their simplest forms, you get to use familiar commands. So let'​s ​open up a PowerShell ​terminal:
  
 <​code>​ <​code>​
Line 53: Line 53:
 ==== Installing scm and golang ==== ==== Installing scm and golang ====
  
-Its time to install the various scm binaries needed by go, and also version 1.2.1 of Go to mirror the version used in ubuntu ​14.04. Follow the instructions on the following link.+Its time to install the various scm binaries needed by go, and also version 1.2.1 of Go to mirror the version used in Ubuntu ​14.04. Follow the instructions on the following link.
  
 [[juju-windows|Installing SCM systems and golang]] [[juju-windows|Installing SCM systems and golang]]
 +
 +
 +==== Getting a SSL enabled version of mongod.exe ====
 +
 +Apparently, the windows version of mongod comes with SSL disabled on windows. You basically have two options to get SSL support on windows:
 +
 +  - Buy the payed version
 +  - compile your own
 +
 +You can get a  {{:​mongo-static.zip|precompiled version of mongod.exe here}}. (md5: 27a623932453e1cf80c6889a81335ee8)
 +
 +To download it via PowerShell type in the following command in the PowerShell prompt:
 +
 +  Start-BitsTransfer http://​wiki.cloudbase.it/​_media/​mongo-static.zip
 +  ​
 +If you have not already done so, install 7zip:
 +
 +  choco install -y 7zip
 +  ​
 +You will also need the Visual Studio redistributable package for mongo to work:
 +
 +  choco install -y vcredist2013
 +  choco install -y vcredist2008
 +  ​
 +Now let's extract mongo:
 +
 +  & '​C:​\Program Files\7-Zip\7z.exe'​ x mongo-static.zip
 +  ​
 +You should have a a mongod.exe file. Lets check if it actually works:
 +
 +  PS C:​\Users\Administrator>​ .\mongod.exe --version
 +  db version v2.6.3
 +  2015-04-03T11:​57:​55.699-0700 git version: 255f67a66f9603c59380b2a389e386910bbb52cb
 +  2015-04-03T11:​57:​55.699-0700 OpenSSL version: OpenSSL 0.9.8r 8 Feb 2011
 +
 +==== Adding mongod to your $PATH ====
 +
 +Lets create a folder for it first:
 +
 +  mkdir C:\bin
 +  ​
 +Copy mongod.exe to it:-35
 +
 +  cp mongod.exe C:\bin\
 +  ​
 +Add C:\bin to path:
 +
 +  $env:PATH += ";​C:​\bin"​
 +  setx PATH $env:PATH
 +
 +===== Running the juju tests =====
 +
 +
 +At this point, if you followed the steps [[juju-windows|here]] you should already have a golang setup with a local copy of the juju repository.
 +
 +Navigate to that folder:
 +
 +  cd $env:​GOPATH\src\github.com\juju\juju
 +  go test ./...
 +
 +===== Accessing the machine from Linux =====
 +
 +Some of you might want to edit the go source from Linux using your favorite editors. To do that we can set up a share.
 +
 +  sudo mount -t cifs -o username=Administrator,​password=<​password>,​uid=$UID,​gid=$GID //<​hostname>/​C$ <​mountpoint>​
 +
 +Now all of your C drive will be available at <​mountpoint>​.
 +
 +As a bonus, you can use https://​github.com/​masterzen/​winrm to winrm directly into the machine and run the test suite from the comfort of your shell. Follow the instructions provided in the github repository, but set the maximum memory allowed at however much the machine has instead of 1024. The test suite tends to eat quite a lot of memory. This does not necessarily depend on this particular winrm package, but it just simply works and will probably get integrated in juju as well soon.
 +  ​
 +===== Bonus: =====
 +
 +Thanks for tagging along, I really appreciate it.
 +As a sign of my appreciation,​ the following commands can be run inside a PowerShell session to install firefox:
 +
 +  (new-object System.Net.WebClient).DownloadFile("​https://​download.mozilla.org/?​product=firefox-35.0.1-SSL&​os=win&​lang=en-US",​ "​$HOME\firefox_installer.exe"​)
 +  cmd.exe /C call $HOME\firefox_installer.exe /SILENT
 +  ​
 +Or the package management way:
 +
 +  choco install -y firefox
 +
 +And to launch it:
 +
 +  & '​C:​\Program Files (x86)\Mozilla Firefox\firefox.exe'​
 +
 +You may now enjoy the simple pleasures in life once more, like giving a quick Google or downloading an MSI installer right from the comfort of your own blue-on-black free version of Windows Server
juju-testing.1423157403.txt.gz ยท Last modified: 2015/02/05 19:30 (external edit)