coverage/index.html in vagrant-windows-1.3.0.pre.3 vs coverage/index.html in vagrant-windows-1.3.0

- old
+ new

@@ -12,31 +12,31 @@ <body> <div id="loading"> <img src="./assets/0.7.1/loading.gif" alt="loading"/> </div> <div id="wrapper" style="display:none;"> - <div class="timestamp">Generated <abbr class="timeago" title="2013-11-04T14:20:57-08:00">2013-11-04T14:20:57-08:00</abbr></div> + <div class="timestamp">Generated <abbr class="timeago" title="2013-11-14T12:48:58-08:00">2013-11-14T12:48:58-08:00</abbr></div> <ul class="group_tabs"></ul> <div id="content"> <div class="file_list_container" id="AllFiles"> <h2> <span class="group_name">All Files</span> - (<span class="covered_percent"><span class="red">72.51%</span></span> + (<span class="covered_percent"><span class="red">57.41%</span></span> covered at <span class="covered_strength"> <span class="green"> - 1.42 + 1.07 </span> </span> hits/line) </h2> <a name="AllFiles"></a> <div> <b>29</b> files in total. - <b>793</b> relevant lines. - <span class="green"><b>575</b> lines covered</span> and - <span class="red"><b>218</b> lines missed </span> + <b>796</b> relevant lines. + <span class="green"><b>457</b> lines covered</span> and + <span class="red"><b>339</b> lines missed </span> </div> <table class="file_list"> <thead> <tr> <th>File</th> @@ -50,36 +50,36 @@ </thead> <tbody> <tr> <td class="strong"><a href="#a339881f7104a1cf05fd48bd4ccc36f8b0bb43e2" class="src_link" title="lib/vagrant-windows.rb">lib/vagrant-windows.rb</a></td> - <td class="green strong">100.0 %</td> + <td class="green strong">90.91 %</td> <td>24</td> <td>11</td> - <td>11</td> - <td>0</td> - <td>2.6</td> + <td>10</td> + <td>1</td> + <td>1.3</td> </tr> <tr> <td class="strong"><a href="#dec1987bc6b58f2134e55c26a9e0d4f67a0e5a04" class="src_link" title="lib/vagrant-windows/communication/guestnetwork.rb">lib/vagrant-windows/communication/guestnetwork.rb</a></td> - <td class="yellow strong">81.67 %</td> + <td class="red strong">35.0 %</td> <td>133</td> <td>60</td> - <td>49</td> - <td>11</td> - <td>1.5</td> + <td>21</td> + <td>39</td> + <td>0.4</td> </tr> <tr> <td class="strong"><a href="#9c5c265071fce540a59ec662bb558312c6c54c4b" class="src_link" title="lib/vagrant-windows/communication/winrmcommunicator.rb">lib/vagrant-windows/communication/winrmcommunicator.rb</a></td> - <td class="red strong">75.0 %</td> + <td class="red strong">41.07 %</td> <td>108</td> <td>56</td> - <td>42</td> - <td>14</td> - <td>1.3</td> + <td>23</td> + <td>33</td> + <td>0.4</td> </tr> <tr> <td class="strong"><a href="#46df79007581e23184efb74db86daf5c58254ec5" class="src_link" title="lib/vagrant-windows/communication/winrmfinder.rb">lib/vagrant-windows/communication/winrmfinder.rb</a></td> <td class="red strong">78.26 %</td> @@ -90,26 +90,26 @@ <td>1.3</td> </tr> <tr> <td class="strong"><a href="#206e71d4215a183bebef0dee5b2d9ce2fe77aea6" class="src_link" title="lib/vagrant-windows/communication/winrmshell.rb">lib/vagrant-windows/communication/winrmshell.rb</a></td> - <td class="green strong">92.5 %</td> + <td class="red strong">38.75 %</td> <td>159</td> <td>80</td> - <td>74</td> - <td>6</td> - <td>5.4</td> + <td>31</td> + <td>49</td> + <td>0.4</td> </tr> <tr> <td class="strong"><a href="#defc50d3a200328d3130424dcb644d83faccadaa" class="src_link" title="lib/vagrant-windows/communication/winrmshell_factory.rb">lib/vagrant-windows/communication/winrmshell_factory.rb</a></td> - <td class="yellow strong">90.0 %</td> + <td class="red strong">70.0 %</td> <td>34</td> <td>10</td> - <td>9</td> - <td>1</td> - <td>0.9</td> + <td>7</td> + <td>3</td> + <td>0.7</td> </tr> <tr> <td class="strong"><a href="#ec6c148e559f5558fb277fea15c45c85fa409d28" class="src_link" title="lib/vagrant-windows/config/windows.rb">lib/vagrant-windows/config/windows.rb</a></td> <td class="red strong">76.19 %</td> @@ -210,15 +210,15 @@ <td>0.3</td> </tr> <tr> <td class="strong"><a href="#9387455ce27f9821d2f4388bcb52524681914003" class="src_link" title="lib/vagrant-windows/monkey_patches/plugins/provisioners/puppet/provisioner/puppet.rb">lib/vagrant-windows/monkey_patches/plugins/provisioners/puppet/provisioner/puppet.rb</a></td> - <td class="red strong">26.15 %</td> - <td>129</td> - <td>65</td> - <td>17</td> - <td>48</td> + <td class="red strong">26.47 %</td> + <td>138</td> + <td>68</td> + <td>18</td> + <td>50</td> <td>0.3</td> </tr> <tr> <td class="strong"><a href="#6093af51a0c7e6f795cd8cd2111d8d673bde18c3" class="src_link" title="lib/vagrant-windows/monkey_patches/plugins/provisioners/puppet/provisioner/puppet_server.rb">lib/vagrant-windows/monkey_patches/plugins/provisioners/puppet/provisioner/puppet_server.rb</a></td> @@ -310,16 +310,16 @@ <td>3.9</td> </tr> <tr> <td class="strong"><a href="#844842835a3c9ba296ba1e91954dcd0979df99b4" class="src_link" title="spec/vagrant-windows/winrmcommunicator_spec.rb">spec/vagrant-windows/winrmcommunicator_spec.rb</a></td> - <td class="green strong">100.0 %</td> + <td class="red strong">37.5 %</td> <td>47</td> <td>24</td> - <td>24</td> - <td>0</td> - <td>1.1</td> + <td>9</td> + <td>15</td> + <td>0.4</td> </tr> <tr> <td class="strong"><a href="#5bf85486dfa43acdf015a1bc09ffbc798937c5ed" class="src_link" title="spec/vagrant-windows/winrmfinder_spec.rb">spec/vagrant-windows/winrmfinder_spec.rb</a></td> <td class="green strong">100.0 %</td> @@ -330,16 +330,16 @@ <td>1.2</td> </tr> <tr> <td class="strong"><a href="#25447093b9cbe29e6009455b5e95c517f212a004" class="src_link" title="spec/vagrant-windows/winrmshell_spec.rb">spec/vagrant-windows/winrmshell_spec.rb</a></td> - <td class="green strong">100.0 %</td> + <td class="red strong">45.0 %</td> <td>39</td> <td>20</td> - <td>20</td> - <td>0</td> - <td>1.5</td> + <td>9</td> + <td>11</td> + <td>0.5</td> </tr> </tbody> </table> </div> @@ -357,15 +357,15 @@ <div class="source_files"> <div class="source_table" id="a339881f7104a1cf05fd48bd4ccc36f8b0bb43e2"> <div class="header"> <h3>lib/vagrant-windows.rb</h3> - <h4><span class="green">100.0 %</span> covered</h4> + <h4><span class="green">90.91 %</span> covered</h4> <div> <b>11</b> relevant lines. - <span class="green"><b>11</b> lines covered</span> and - <span class="red"><b>0</b> lines missed.</span> + <span class="green"><b>10</b> lines covered</span> and + <span class="red"><b>1</b> lines missed.</span> </div> </div> <pre> <ol> @@ -398,12 +398,12 @@ <span class="hits">1</span> <code class="ruby"> def self.vagrant_windows_root</code> </li> - <li class="covered" data-hits="8" data-linenumber="6"> - <span class="hits">8</span> + <li class="covered" data-hits="3" data-linenumber="6"> + <span class="hits">3</span> <code class="ruby"> @vagrant_windows_root ||= Pathname.new(File.expand_path(&quot;../../&quot;, __FILE__))</code> </li> <li class="never" data-hits="" data-linenumber="7"> @@ -422,13 +422,13 @@ <span class="hits">1</span> <code class="ruby"> def self.load_script(script_file_name)</code> </li> - <li class="covered" data-hits="5" data-linenumber="10"> - <span class="hits">5</span> + <li class="missed" data-hits="0" data-linenumber="10"> + <code class="ruby"> File.read(expand_script_path(script_file_name))</code> </li> <li class="never" data-hits="" data-linenumber="11"> @@ -470,12 +470,12 @@ <span class="hits">1</span> <code class="ruby"> def self.expand_script_path(script_file_name)</code> </li> - <li class="covered" data-hits="7" data-linenumber="18"> - <span class="hits">7</span> + <li class="covered" data-hits="2" data-linenumber="18"> + <span class="hits">2</span> <code class="ruby"> File.expand_path(&quot;lib/vagrant-windows/scripts/#{script_file_name}&quot;, VagrantWindows.vagrant_windows_root)</code> </li> <li class="never" data-hits="" data-linenumber="19"> @@ -519,15 +519,15 @@ </div> <div class="source_table" id="dec1987bc6b58f2134e55c26a9e0d4f67a0e5a04"> <div class="header"> <h3>lib/vagrant-windows/communication/guestnetwork.rb</h3> - <h4><span class="yellow">81.67 %</span> covered</h4> + <h4><span class="red">35.0 %</span> covered</h4> <div> <b>60</b> relevant lines. - <span class="green"><b>49</b> lines covered</span> and - <span class="red"><b>11</b> lines missed.</span> + <span class="green"><b>21</b> lines covered</span> and + <span class="red"><b>39</b> lines missed.</span> </div> </div> <pre> <ol> @@ -638,25 +638,25 @@ <span class="hits">1</span> <code class="ruby"> def initialize(winrmshell)</code> </li> - <li class="covered" data-hits="1" data-linenumber="19"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="19"> + <code class="ruby"> @logger = Log4r::Logger.new(&quot;vagrant_windows::communication::winrmshell&quot;)</code> </li> - <li class="covered" data-hits="1" data-linenumber="20"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="20"> + <code class="ruby"> @logger.debug(&quot;initializing WinRMShell&quot;)</code> </li> - <li class="covered" data-hits="1" data-linenumber="21"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="21"> + <code class="ruby"> @winrmshell = winrmshell</code> </li> <li class="never" data-hits="" data-linenumber="22"> @@ -698,13 +698,13 @@ <span class="hits">1</span> <code class="ruby"> def network_adapters()</code> </li> - <li class="covered" data-hits="3" data-linenumber="29"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="29"> + <code class="ruby"> wsman_version() == 2? network_adapters_v2_winrm() : network_adapters_v3_winrm() </code> </li> <li class="never" data-hits="" data-linenumber="30"> @@ -740,49 +740,49 @@ <span class="hits">1</span> <code class="ruby"> def is_dhcp_enabled(nic_index)</code> </li> - <li class="covered" data-hits="3" data-linenumber="36"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="36"> + <code class="ruby"> has_dhcp_enabled = false</code> </li> - <li class="covered" data-hits="3" data-linenumber="37"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="37"> + <code class="ruby"> cmd = &quot;Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter \&quot;Index=#{nic_index} and DHCPEnabled=True\&quot;&quot;</code> </li> - <li class="covered" data-hits="3" data-linenumber="38"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="38"> + <code class="ruby"> @winrmshell.powershell(cmd) do |type, line|</code> </li> - <li class="covered" data-hits="6" data-linenumber="39"> - <span class="hits">6</span> + <li class="missed" data-hits="0" data-linenumber="39"> + <code class="ruby"> has_dhcp_enabled = !line.nil?</code> </li> <li class="never" data-hits="" data-linenumber="40"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="3" data-linenumber="41"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="41"> + <code class="ruby"> @logger.debug(&quot;NIC #{nic_index} has DHCP enabled: #{has_dhcp_enabled}&quot;)</code> </li> - <li class="covered" data-hits="3" data-linenumber="42"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="42"> + <code class="ruby"> has_dhcp_enabled</code> </li> <li class="never" data-hits="" data-linenumber="43"> @@ -824,19 +824,19 @@ <span class="hits">1</span> <code class="ruby"> def configure_dhcp_interface(nic_index, net_connection_id)</code> </li> - <li class="covered" data-hits="1" data-linenumber="50"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="50"> + <code class="ruby"> @logger.info(&quot;Configuring NIC #{net_connection_id} for DHCP&quot;)</code> </li> - <li class="covered" data-hits="1" data-linenumber="51"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="51"> + <code class="ruby"> if !is_dhcp_enabled(nic_index)</code> </li> <li class="missed" data-hits="0" data-linenumber="52"> @@ -908,31 +908,31 @@ <span class="hits">1</span> <code class="ruby"> def configure_static_interface(nic_index, net_connection_id, ip, netmask)</code> </li> - <li class="covered" data-hits="1" data-linenumber="64"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="64"> + <code class="ruby"> @logger.info(&quot;Configuring NIC #{net_connection_id} using static ip #{ip}&quot;)</code> </li> <li class="never" data-hits="" data-linenumber="65"> <code class="ruby"> #netsh interface ip set address &quot;Local Area Connection 2&quot; static 192.168.33.10 255.255.255.0</code> </li> - <li class="covered" data-hits="1" data-linenumber="66"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="66"> + <code class="ruby"> netsh = &quot;netsh interface ip set address \&quot;#{net_connection_id}\&quot; static #{ip} #{netmask}&quot;</code> </li> - <li class="covered" data-hits="1" data-linenumber="67"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="67"> + <code class="ruby"> @winrmshell.powershell(netsh)</code> </li> <li class="never" data-hits="" data-linenumber="68"> @@ -968,25 +968,25 @@ <span class="hits">1</span> <code class="ruby"> def set_all_networks_to_work()</code> </li> - <li class="covered" data-hits="1" data-linenumber="74"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="74"> + <code class="ruby"> @logger.info(&quot;Setting all networks to 'Work Network'&quot;)</code> </li> - <li class="covered" data-hits="1" data-linenumber="75"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="75"> + <code class="ruby"> command = VagrantWindows.load_script(&quot;set_work_network.ps1&quot;)</code> </li> - <li class="covered" data-hits="1" data-linenumber="76"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="76"> + <code class="ruby"> @winrmshell.powershell(command)</code> </li> <li class="never" data-hits="" data-linenumber="77"> @@ -1046,49 +1046,49 @@ <span class="hits">1</span> <code class="ruby"> def wsman_version()</code> </li> - <li class="covered" data-hits="3" data-linenumber="87"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="87"> + <code class="ruby"> @logger.debug(&quot;querying WSMan version&quot;)</code> </li> - <li class="covered" data-hits="3" data-linenumber="88"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="88"> + <code class="ruby"> version = ''</code> </li> - <li class="covered" data-hits="3" data-linenumber="89"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="89"> + <code class="ruby"> @winrmshell.powershell(PS_GET_WSMAN_VER) do |type, line|</code> </li> - <li class="covered" data-hits="6" data-linenumber="90"> - <span class="hits">6</span> + <li class="missed" data-hits="0" data-linenumber="90"> + <code class="ruby"> version = version + &quot;#{line}&quot; if type == :stdout &amp;&amp; !line.nil?</code> </li> <li class="never" data-hits="" data-linenumber="91"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="3" data-linenumber="92"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="92"> + <code class="ruby"> @logger.debug(&quot;wsman version: #{version}&quot;)</code> </li> - <li class="covered" data-hits="3" data-linenumber="93"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="93"> + <code class="ruby"> Integer(version)</code> </li> <li class="never" data-hits="" data-linenumber="94"> @@ -1136,13 +1136,13 @@ <span class="hits">1</span> <code class="ruby"> def network_adapters_v2_winrm()</code> </li> - <li class="covered" data-hits="3" data-linenumber="102"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="102"> + <code class="ruby"> @logger.debug(&quot;querying network adapters&quot;)</code> </li> <li class="never" data-hits="" data-linenumber="103"> @@ -1154,25 +1154,25 @@ <code class="ruby"> # http://msdn.microsoft.com/en-us/library/windows/desktop/aa394216(v=vs.85).aspx</code> </li> - <li class="covered" data-hits="3" data-linenumber="105"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="105"> + <code class="ruby"> adapters = @winrmshell.wql(WQL_NET_ADAPTERS_V2)[:win32_network_adapter]</code> </li> - <li class="covered" data-hits="3" data-linenumber="106"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="106"> + <code class="ruby"> @logger.debug(&quot;#{adapters.inspect}&quot;)</code> </li> - <li class="covered" data-hits="3" data-linenumber="107"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="107"> + <code class="ruby"> return adapters</code> </li> <li class="never" data-hits="" data-linenumber="108"> @@ -1335,15 +1335,15 @@ </div> <div class="source_table" id="9c5c265071fce540a59ec662bb558312c6c54c4b"> <div class="header"> <h3>lib/vagrant-windows/communication/winrmcommunicator.rb</h3> - <h4><span class="red">75.0 %</span> covered</h4> + <h4><span class="red">41.07 %</span> covered</h4> <div> <b>56</b> relevant lines. - <span class="green"><b>42</b> lines covered</span> and - <span class="red"><b>14</b> lines missed.</span> + <span class="green"><b>23</b> lines covered</span> and + <span class="red"><b>33</b> lines missed.</span> </div> </div> <pre> <ol> @@ -1454,37 +1454,37 @@ <span class="hits">1</span> <code class="ruby"> def initialize(machine)</code> </li> - <li class="covered" data-hits="1" data-linenumber="19"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="19"> + <code class="ruby"> @windows_machine = VagrantWindows::WindowsMachine.new(machine)</code> </li> - <li class="covered" data-hits="1" data-linenumber="20"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="20"> + <code class="ruby"> @winrm_shell_factory = WinRMShellFactory.new(@windows_machine, WinRMFinder.new(@windows_machine))</code> </li> <li class="never" data-hits="" data-linenumber="21"> <code class="ruby"> </code> </li> - <li class="covered" data-hits="1" data-linenumber="22"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="22"> + <code class="ruby"> @logger = Log4r::Logger.new(&quot;vagrant_windows::communication::winrmcommunicator&quot;)</code> </li> - <li class="covered" data-hits="1" data-linenumber="23"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="23"> + <code class="ruby"> @logger.debug(&quot;initializing WinRMCommunicator&quot;)</code> </li> <li class="never" data-hits="" data-linenumber="24"> @@ -1604,13 +1604,13 @@ <span class="hits">1</span> <code class="ruby"> def execute(command, opts={}, &amp;block)</code> </li> - <li class="covered" data-hits="4" data-linenumber="44"> - <span class="hits">4</span> + <li class="missed" data-hits="0" data-linenumber="44"> + <code class="ruby"> opts = {</code> </li> <li class="never" data-hits="" data-linenumber="45"> @@ -1646,37 +1646,37 @@ <code class="ruby"> }.merge(opts || {})</code> </li> - <li class="covered" data-hits="4" data-linenumber="51"> - <span class="hits">4</span> + <li class="missed" data-hits="0" data-linenumber="51"> + <code class="ruby"> exit_status = do_execute(command, opts[:shell], &amp;block)</code> </li> - <li class="covered" data-hits="4" data-linenumber="52"> - <span class="hits">4</span> + <li class="missed" data-hits="0" data-linenumber="52"> + <code class="ruby"> if opts[:error_check] &amp;&amp; exit_status != 0</code> </li> - <li class="covered" data-hits="2" data-linenumber="53"> - <span class="hits">2</span> + <li class="missed" data-hits="0" data-linenumber="53"> + <code class="ruby"> raise_execution_error(opts, exit_status)</code> </li> <li class="never" data-hits="" data-linenumber="54"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="2" data-linenumber="55"> - <span class="hits">2</span> + <li class="missed" data-hits="0" data-linenumber="55"> + <code class="ruby"> exit_status</code> </li> <li class="never" data-hits="" data-linenumber="56"> @@ -1760,19 +1760,19 @@ <span class="hits">1</span> <code class="ruby"> def upload(from, to)</code> </li> - <li class="covered" data-hits="2" data-linenumber="70"> - <span class="hits">2</span> + <li class="missed" data-hits="0" data-linenumber="70"> + <code class="ruby"> @logger.debug(&quot;Uploading: #{from} to #{to}&quot;)</code> </li> - <li class="covered" data-hits="2" data-linenumber="71"> - <span class="hits">2</span> + <li class="missed" data-hits="0" data-linenumber="71"> + <code class="ruby"> winrmshell.upload(from, to)</code> </li> <li class="never" data-hits="" data-linenumber="72"> @@ -1814,13 +1814,13 @@ <span class="hits">1</span> <code class="ruby"> def winrmshell=(winrmshell)</code> </li> - <li class="covered" data-hits="1" data-linenumber="79"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="79"> + <code class="ruby"> @winrmshell = winrmshell</code> </li> <li class="never" data-hits="" data-linenumber="80"> @@ -1838,13 +1838,13 @@ <span class="hits">1</span> <code class="ruby"> def winrmshell</code> </li> - <li class="covered" data-hits="6" data-linenumber="83"> - <span class="hits">6</span> + <li class="missed" data-hits="0" data-linenumber="83"> + <code class="ruby"> @winrmshell ||= @winrm_shell_factory.create_winrm_shell()</code> </li> <li class="never" data-hits="" data-linenumber="84"> @@ -1880,13 +1880,13 @@ <span class="hits">1</span> <code class="ruby"> def do_execute(command, shell, &amp;block)</code> </li> - <li class="covered" data-hits="4" data-linenumber="90"> - <span class="hits">4</span> + <li class="missed" data-hits="0" data-linenumber="90"> + <code class="ruby"> if shell.eql? :cmd</code> </li> <li class="missed" data-hits="0" data-linenumber="91"> @@ -1898,19 +1898,19 @@ <code class="ruby"> else</code> </li> - <li class="covered" data-hits="4" data-linenumber="93"> - <span class="hits">4</span> + <li class="missed" data-hits="0" data-linenumber="93"> - <code class="ruby"> command = VagrantWindows.load_script(&quot;command_alias.ps1&quot;) &lt;&lt; &quot;\r\n&quot; &lt;&lt; command</code> + + <code class="ruby"> command = VagrantWindows.load_script(&quot;command_alias.ps1&quot;) &lt;&lt; &quot;\r\n&quot; &lt;&lt; command &lt;&lt; &quot;\r\nexit $LASTEXITCODE&quot;</code> </li> - <li class="covered" data-hits="4" data-linenumber="94"> - <span class="hits">4</span> + <li class="missed" data-hits="0" data-linenumber="94"> + <code class="ruby"> winrmshell.powershell(command, &amp;block)[:exitcode]</code> </li> <li class="never" data-hits="" data-linenumber="95"> @@ -1946,25 +1946,25 @@ <code class="ruby"> # configuration parameter, so we set it here from `error_key`</code> </li> - <li class="covered" data-hits="2" data-linenumber="101"> - <span class="hits">2</span> + <li class="missed" data-hits="0" data-linenumber="101"> + <code class="ruby"> msg = &quot;Command execution failed with an exit code of #{exit_code}&quot;</code> </li> - <li class="covered" data-hits="2" data-linenumber="102"> - <span class="hits">2</span> + <li class="missed" data-hits="0" data-linenumber="102"> + <code class="ruby"> error_opts = opts.merge(:_key =&gt; opts[:error_key], :message =&gt; msg)</code> </li> - <li class="covered" data-hits="2" data-linenumber="103"> - <span class="hits">2</span> + <li class="missed" data-hits="0" data-linenumber="103"> + <code class="ruby"> raise opts[:error_class], error_opts</code> </li> <li class="never" data-hits="" data-linenumber="104"> @@ -2084,18 +2084,18 @@ <span class="hits">1</span> <code class="ruby"> def initialize(windows_machine)</code> </li> - <li class="covered" data-hits="4" data-linenumber="13"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="13"> + <span class="hits">3</span> <code class="ruby"> @windows_machine = windows_machine</code> </li> - <li class="covered" data-hits="4" data-linenumber="14"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="14"> + <span class="hits">3</span> <code class="ruby"> @logger = Log4r::Logger.new(&quot;vagrant_windows::communication::winrmfinder&quot;)</code> </li> <li class="never" data-hits="" data-linenumber="15"> @@ -2325,15 +2325,15 @@ </div> <div class="source_table" id="206e71d4215a183bebef0dee5b2d9ce2fe77aea6"> <div class="header"> <h3>lib/vagrant-windows/communication/winrmshell.rb</h3> - <h4><span class="green">92.5 %</span> covered</h4> + <h4><span class="red">38.75 %</span> covered</h4> <div> <b>80</b> relevant lines. - <span class="green"><b>74</b> lines covered</span> and - <span class="red"><b>6</b> lines missed.</span> + <span class="green"><b>31</b> lines covered</span> and + <span class="red"><b>49</b> lines missed.</span> </div> </div> <pre> <ol> @@ -2552,61 +2552,61 @@ <span class="hits">1</span> <code class="ruby"> def initialize(host, username, password, options = {})</code> </li> - <li class="covered" data-hits="3" data-linenumber="37"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="37"> + <code class="ruby"> @logger = Log4r::Logger.new(&quot;vagrant_windows::communication::winrmshell&quot;)</code> </li> - <li class="covered" data-hits="3" data-linenumber="38"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="38"> + <code class="ruby"> @logger.debug(&quot;initializing WinRMShell&quot;)</code> </li> <li class="never" data-hits="" data-linenumber="39"> <code class="ruby"> </code> </li> - <li class="covered" data-hits="3" data-linenumber="40"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="40"> + <code class="ruby"> @host = host</code> </li> - <li class="covered" data-hits="3" data-linenumber="41"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="41"> + <code class="ruby"> @port = options[:port] || 5985</code> </li> - <li class="covered" data-hits="3" data-linenumber="42"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="42"> + <code class="ruby"> @username = username</code> </li> - <li class="covered" data-hits="3" data-linenumber="43"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="43"> + <code class="ruby"> @password = password</code> </li> - <li class="covered" data-hits="3" data-linenumber="44"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="44"> + <code class="ruby"> @timeout_in_seconds = options[:timeout_in_seconds] || 60</code> </li> - <li class="covered" data-hits="3" data-linenumber="45"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="45"> + <code class="ruby"> @max_tries = options[:max_tries] || 20</code> </li> <li class="never" data-hits="" data-linenumber="46"> @@ -2624,13 +2624,13 @@ <span class="hits">1</span> <code class="ruby"> def powershell(command, &amp;block)</code> </li> - <li class="covered" data-hits="20" data-linenumber="49"> - <span class="hits">20</span> + <li class="missed" data-hits="0" data-linenumber="49"> + <code class="ruby"> execute_shell(command, :powershell, &amp;block)</code> </li> <li class="never" data-hits="" data-linenumber="50"> @@ -2648,13 +2648,13 @@ <span class="hits">1</span> <code class="ruby"> def cmd(command, &amp;block)</code> </li> - <li class="covered" data-hits="5" data-linenumber="53"> - <span class="hits">5</span> + <li class="missed" data-hits="0" data-linenumber="53"> + <code class="ruby"> execute_shell(command, :cmd, &amp;block)</code> </li> <li class="never" data-hits="" data-linenumber="54"> @@ -2672,13 +2672,13 @@ <span class="hits">1</span> <code class="ruby"> def wql(query)</code> </li> - <li class="covered" data-hits="3" data-linenumber="57"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="57"> + <code class="ruby"> execute_wql(query)</code> </li> <li class="never" data-hits="" data-linenumber="58"> @@ -2696,19 +2696,19 @@ <span class="hits">1</span> <code class="ruby"> def upload(from, to)</code> </li> - <li class="covered" data-hits="2" data-linenumber="61"> - <span class="hits">2</span> + <li class="missed" data-hits="0" data-linenumber="61"> + <code class="ruby"> @logger.debug(&quot;Uploading: #{from} to #{to}&quot;)</code> </li> - <li class="covered" data-hits="2" data-linenumber="62"> - <span class="hits">2</span> + <li class="missed" data-hits="0" data-linenumber="62"> + <code class="ruby"> file_name = (cmd(&quot;echo %TEMP%\\winrm-upload-#{rand()}&quot;))[:data][0][:stdout].chomp</code> </li> <li class="never" data-hits="" data-linenumber="63"> @@ -2732,25 +2732,25 @@ <code class="ruby"> }</code> </li> - <li class="covered" data-hits="2" data-linenumber="67"> - <span class="hits">2</span> + <li class="missed" data-hits="0" data-linenumber="67"> + <code class="ruby"> EOH</code> </li> - <li class="covered" data-hits="2" data-linenumber="68"> - <span class="hits">2</span> + <li class="missed" data-hits="0" data-linenumber="68"> + <code class="ruby"> Base64.encode64(IO.binread(from)).gsub(&quot;\n&quot;,'').chars.to_a.each_slice(8000-file_name.size) do |chunk|</code> </li> - <li class="covered" data-hits="2" data-linenumber="69"> - <span class="hits">2</span> + <li class="missed" data-hits="0" data-linenumber="69"> + <code class="ruby"> out = cmd(&quot;echo #{chunk.join} &gt;&gt; \&quot;#{file_name}\&quot;&quot;)</code> </li> <li class="never" data-hits="" data-linenumber="70"> @@ -2792,13 +2792,13 @@ <code class="ruby"> [System.IO.File]::WriteAllBytes($new_file,$bytes)</code> </li> - <li class="covered" data-hits="2" data-linenumber="77"> - <span class="hits">2</span> + <li class="missed" data-hits="0" data-linenumber="77"> + <code class="ruby"> EOH</code> </li> <li class="never" data-hits="" data-linenumber="78"> @@ -2828,25 +2828,25 @@ <span class="hits">1</span> <code class="ruby"> def execute_shell(command, shell=:powershell, &amp;block)</code> </li> - <li class="covered" data-hits="25" data-linenumber="83"> - <span class="hits">25</span> + <li class="missed" data-hits="0" data-linenumber="83"> + <code class="ruby"> raise Errors::WinRMInvalidShell, :shell =&gt; shell unless shell == :cmd || shell == :powershell</code> </li> - <li class="covered" data-hits="25" data-linenumber="84"> - <span class="hits">25</span> + <li class="missed" data-hits="0" data-linenumber="84"> + <code class="ruby"> begin</code> </li> - <li class="covered" data-hits="25" data-linenumber="85"> - <span class="hits">25</span> + <li class="missed" data-hits="0" data-linenumber="85"> + <code class="ruby"> execute_shell_with_retry(command, shell, &amp;block)</code> </li> <li class="missed" data-hits="0" data-linenumber="86"> @@ -2882,55 +2882,55 @@ <span class="hits">1</span> <code class="ruby"> def execute_shell_with_retry(command, shell, &amp;block)</code> </li> - <li class="covered" data-hits="25" data-linenumber="92"> - <span class="hits">25</span> + <li class="missed" data-hits="0" data-linenumber="92"> + <code class="ruby"> retryable(:tries =&gt; @max_tries, :on =&gt; @@exceptions_to_retry_on, :sleep =&gt; 10) do</code> </li> - <li class="covered" data-hits="25" data-linenumber="93"> - <span class="hits">25</span> + <li class="missed" data-hits="0" data-linenumber="93"> + <code class="ruby"> @logger.debug(&quot;#{shell} executing:\n#{command}&quot;)</code> </li> - <li class="covered" data-hits="25" data-linenumber="94"> - <span class="hits">25</span> + <li class="missed" data-hits="0" data-linenumber="94"> + <code class="ruby"> output = session.send(shell, command) do |out, err|</code> </li> - <li class="covered" data-hits="32" data-linenumber="95"> - <span class="hits">32</span> + <li class="missed" data-hits="0" data-linenumber="95"> + <code class="ruby"> block.call(:stdout, out) if block_given? &amp;&amp; out</code> </li> - <li class="covered" data-hits="32" data-linenumber="96"> - <span class="hits">32</span> + <li class="missed" data-hits="0" data-linenumber="96"> + <code class="ruby"> block.call(:stderr, err) if block_given? &amp;&amp; err</code> </li> <li class="never" data-hits="" data-linenumber="97"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="25" data-linenumber="98"> - <span class="hits">25</span> + <li class="missed" data-hits="0" data-linenumber="98"> + <code class="ruby"> @logger.debug(&quot;Exit status: #{output[:exitcode].inspect}&quot;)</code> </li> - <li class="covered" data-hits="25" data-linenumber="99"> - <span class="hits">25</span> + <li class="missed" data-hits="0" data-linenumber="99"> + <code class="ruby"> return output</code> </li> <li class="never" data-hits="" data-linenumber="100"> @@ -2954,37 +2954,37 @@ <span class="hits">1</span> <code class="ruby"> def execute_wql(query)</code> </li> - <li class="covered" data-hits="3" data-linenumber="104"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="104"> + <code class="ruby"> retryable(:tries =&gt; @max_tries, :on =&gt; @@exceptions_to_retry_on, :sleep =&gt; 10) do</code> </li> - <li class="covered" data-hits="3" data-linenumber="105"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="105"> + <code class="ruby"> @logger.debug(&quot;#executing wql: #{query}&quot;)</code> </li> - <li class="covered" data-hits="3" data-linenumber="106"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="106"> + <code class="ruby"> output = session.wql(query)</code> </li> - <li class="covered" data-hits="3" data-linenumber="107"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="107"> + <code class="ruby"> @logger.debug(&quot;wql result: #{output.inspect}&quot;)</code> </li> - <li class="covered" data-hits="3" data-linenumber="108"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="108"> + <code class="ruby"> return output</code> </li> <li class="never" data-hits="" data-linenumber="109"> @@ -3104,61 +3104,61 @@ <span class="hits">1</span> <code class="ruby"> def new_session</code> </li> - <li class="covered" data-hits="3" data-linenumber="129"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="129"> + <code class="ruby"> @logger.info(&quot;Attempting to connect to WinRM...&quot;)</code> </li> - <li class="covered" data-hits="3" data-linenumber="130"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="130"> + <code class="ruby"> @logger.info(&quot; - Host: #{@host}&quot;)</code> </li> - <li class="covered" data-hits="3" data-linenumber="131"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="131"> + <code class="ruby"> @logger.info(&quot; - Port: #{@port}&quot;)</code> </li> - <li class="covered" data-hits="3" data-linenumber="132"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="132"> + <code class="ruby"> @logger.info(&quot; - Username: #{@username}&quot;)</code> </li> <li class="never" data-hits="" data-linenumber="133"> <code class="ruby"> </code> </li> - <li class="covered" data-hits="3" data-linenumber="134"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="134"> + <code class="ruby"> client = ::WinRM::WinRMWebService.new(endpoint, :plaintext, endpoint_options)</code> </li> - <li class="covered" data-hits="3" data-linenumber="135"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="135"> + <code class="ruby"> client.set_timeout(@timeout_in_seconds)</code> </li> - <li class="covered" data-hits="3" data-linenumber="136"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="136"> + <code class="ruby"> client.toggle_nori_type_casting(:off) #we don't want coersion of types</code> </li> - <li class="covered" data-hits="3" data-linenumber="137"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="137"> + <code class="ruby"> client</code> </li> <li class="never" data-hits="" data-linenumber="138"> @@ -3176,13 +3176,13 @@ <span class="hits">1</span> <code class="ruby"> def session</code> </li> - <li class="covered" data-hits="28" data-linenumber="141"> - <span class="hits">28</span> + <li class="missed" data-hits="0" data-linenumber="141"> + <code class="ruby"> @session ||= new_session</code> </li> <li class="never" data-hits="" data-linenumber="142"> @@ -3200,13 +3200,13 @@ <span class="hits">1</span> <code class="ruby"> def endpoint</code> </li> - <li class="covered" data-hits="3" data-linenumber="145"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="145"> + <code class="ruby"> &quot;http://#{@host}:#{@port}/wsman&quot;</code> </li> <li class="never" data-hits="" data-linenumber="146"> @@ -3254,13 +3254,13 @@ <code class="ruby"> :operation_timeout =&gt; @timeout_in_seconds,</code> </li> - <li class="covered" data-hits="3" data-linenumber="154"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="154"> + <code class="ruby"> :basic_auth_only =&gt; true }</code> </li> <li class="never" data-hits="" data-linenumber="155"> @@ -3297,15 +3297,15 @@ </div> <div class="source_table" id="defc50d3a200328d3130424dcb644d83faccadaa"> <div class="header"> <h3>lib/vagrant-windows/communication/winrmshell_factory.rb</h3> - <h4><span class="yellow">90.0 %</span> covered</h4> + <h4><span class="red">70.0 %</span> covered</h4> <div> <b>10</b> relevant lines. - <span class="green"><b>9</b> lines covered</span> and - <span class="red"><b>1</b> lines missed.</span> + <span class="green"><b>7</b> lines covered</span> and + <span class="red"><b>3</b> lines missed.</span> </div> </div> <pre> <ol> @@ -3380,19 +3380,19 @@ <span class="hits">1</span> <code class="ruby"> def initialize(windows_machine, winrm_finder)</code> </li> - <li class="covered" data-hits="1" data-linenumber="13"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="13"> + <code class="ruby"> @windows_machine = windows_machine</code> </li> - <li class="covered" data-hits="1" data-linenumber="14"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="14"> + <code class="ruby"> @winrm_finder = winrm_finder</code> </li> <li class="never" data-hits="" data-linenumber="15"> @@ -6087,15 +6087,15 @@ </div> <div class="source_table" id="9387455ce27f9821d2f4388bcb52524681914003"> <div class="header"> <h3>lib/vagrant-windows/monkey_patches/plugins/provisioners/puppet/provisioner/puppet.rb</h3> - <h4><span class="red">26.15 %</span> covered</h4> + <h4><span class="red">26.47 %</span> covered</h4> <div> - <b>65</b> relevant lines. - <span class="green"><b>17</b> lines covered</span> and - <span class="red"><b>48</b> lines missed.</span> + <b>68</b> relevant lines. + <span class="green"><b>18</b> lines covered</span> and + <span class="red"><b>50</b> lines missed.</span> </div> </div> <pre> <ol> @@ -6116,761 +6116,815 @@ <span class="hits">1</span> <code class="ruby">require_relative '../../../../../helper'</code> </li> - <li class="never" data-hits="" data-linenumber="4"> + <li class="covered" data-hits="1" data-linenumber="4"> + <span class="hits">1</span> + <code class="ruby">require_relative '../../../../../errors'</code> + </li> + + <li class="never" data-hits="" data-linenumber="5"> + <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="5"> + <li class="covered" data-hits="1" data-linenumber="6"> <span class="hits">1</span> <code class="ruby">module VagrantPlugins</code> </li> - <li class="covered" data-hits="1" data-linenumber="6"> + <li class="covered" data-hits="1" data-linenumber="7"> <span class="hits">1</span> <code class="ruby"> module Puppet</code> </li> - <li class="covered" data-hits="1" data-linenumber="7"> + <li class="covered" data-hits="1" data-linenumber="8"> <span class="hits">1</span> <code class="ruby"> module Provisioner</code> </li> - <li class="covered" data-hits="1" data-linenumber="8"> + <li class="covered" data-hits="1" data-linenumber="9"> <span class="hits">1</span> <code class="ruby"> class Puppet &lt; Vagrant.plugin(&quot;2&quot;, :provisioner)</code> </li> - <li class="never" data-hits="" data-linenumber="9"> + <li class="never" data-hits="" data-linenumber="10"> <code class="ruby"> </code> </li> - <li class="covered" data-hits="1" data-linenumber="10"> + <li class="covered" data-hits="1" data-linenumber="11"> <span class="hits">1</span> <code class="ruby"> include VagrantWindows::Helper</code> </li> - <li class="never" data-hits="" data-linenumber="11"> + <li class="never" data-hits="" data-linenumber="12"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="12"> + <li class="never" data-hits="" data-linenumber="13"> <code class="ruby"> # This patch is needed until Vagrant supports Puppet on Windows guests</code> </li> - <li class="covered" data-hits="1" data-linenumber="13"> + <li class="covered" data-hits="1" data-linenumber="14"> <span class="hits">1</span> <code class="ruby"> provision_on_linux = instance_method(:provision)</code> </li> - <li class="covered" data-hits="1" data-linenumber="14"> + <li class="covered" data-hits="1" data-linenumber="15"> <span class="hits">1</span> <code class="ruby"> run_puppet_apply_on_linux = instance_method(:run_puppet_apply)</code> </li> - <li class="covered" data-hits="1" data-linenumber="15"> + <li class="covered" data-hits="1" data-linenumber="16"> <span class="hits">1</span> <code class="ruby"> configure_on_linux = instance_method(:configure)</code> </li> - <li class="never" data-hits="" data-linenumber="16"> + <li class="never" data-hits="" data-linenumber="17"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="17"> + <li class="covered" data-hits="1" data-linenumber="18"> <span class="hits">1</span> <code class="ruby"> define_method(:run_puppet_apply) do</code> </li> - <li class="missed" data-hits="0" data-linenumber="18"> + <li class="missed" data-hits="0" data-linenumber="19"> <code class="ruby"> is_windows? ? run_puppet_apply_on_windows() : run_puppet_apply_on_linux.bind(self).()</code> </li> - <li class="never" data-hits="" data-linenumber="19"> + <li class="never" data-hits="" data-linenumber="20"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="20"> + <li class="never" data-hits="" data-linenumber="21"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="21"> + <li class="covered" data-hits="1" data-linenumber="22"> <span class="hits">1</span> <code class="ruby"> define_method(:configure) do |root_config|</code> </li> - <li class="missed" data-hits="0" data-linenumber="22"> + <li class="missed" data-hits="0" data-linenumber="23"> <code class="ruby"> is_windows? ? configure_on_windows(root_config) : configure_on_linux.bind(self).(root_config)</code> </li> - <li class="never" data-hits="" data-linenumber="23"> + <li class="never" data-hits="" data-linenumber="24"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="24"> + <li class="never" data-hits="" data-linenumber="25"> <code class="ruby"> </code> </li> - <li class="covered" data-hits="1" data-linenumber="25"> + <li class="covered" data-hits="1" data-linenumber="26"> <span class="hits">1</span> <code class="ruby"> define_method(:provision) do</code> </li> - <li class="missed" data-hits="0" data-linenumber="26"> + <li class="missed" data-hits="0" data-linenumber="27"> <code class="ruby"> windows_machine = VagrantWindows::WindowsMachine.new(@machine)</code> </li> - <li class="missed" data-hits="0" data-linenumber="27"> + <li class="missed" data-hits="0" data-linenumber="28"> <code class="ruby"> wait_if_rebooting(windows_machine) if is_windows?</code> </li> - <li class="missed" data-hits="0" data-linenumber="28"> + <li class="missed" data-hits="0" data-linenumber="29"> <code class="ruby"> provision_on_linux.bind(self).()</code> </li> - <li class="never" data-hits="" data-linenumber="29"> + <li class="never" data-hits="" data-linenumber="30"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="30"> + <li class="never" data-hits="" data-linenumber="31"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="31"> + <li class="covered" data-hits="1" data-linenumber="32"> <span class="hits">1</span> <code class="ruby"> def run_puppet_apply_on_windows</code> </li> - <li class="never" data-hits="" data-linenumber="32"> + <li class="never" data-hits="" data-linenumber="33"> <code class="ruby"> </code> </li> - <li class="never" data-hits="" data-linenumber="33"> + <li class="never" data-hits="" data-linenumber="34"> <code class="ruby"> # This re-establishes our symbolic links if they were created between now and a reboot</code> </li> - <li class="missed" data-hits="0" data-linenumber="34"> + <li class="missed" data-hits="0" data-linenumber="35"> <code class="ruby"> @machine.communicate.execute('&amp; net use a-non-existant-share', :error_check =&gt; false)</code> </li> - <li class="never" data-hits="" data-linenumber="35"> + <li class="never" data-hits="" data-linenumber="36"> <code class="ruby"> </code> </li> - <li class="missed" data-hits="0" data-linenumber="36"> + <li class="missed" data-hits="0" data-linenumber="37"> - <code class="ruby"> options = [config.options].flatten</code> + <code class="ruby"> options = [@config.options].flatten</code> </li> - <li class="missed" data-hits="0" data-linenumber="37"> + <li class="missed" data-hits="0" data-linenumber="38"> <code class="ruby"> module_paths = @module_paths.map { |_, to| to }</code> </li> - <li class="missed" data-hits="0" data-linenumber="38"> + <li class="missed" data-hits="0" data-linenumber="39"> <code class="ruby"> if !@module_paths.empty?</code> </li> - <li class="never" data-hits="" data-linenumber="39"> + <li class="never" data-hits="" data-linenumber="40"> <code class="ruby"> # Prepend the default module path</code> </li> - <li class="missed" data-hits="0" data-linenumber="40"> + <li class="missed" data-hits="0" data-linenumber="41"> <code class="ruby"> module_paths.unshift(&quot;/ProgramData/PuppetLabs/puppet/etc/modules&quot;)</code> </li> - <li class="never" data-hits="" data-linenumber="41"> + <li class="never" data-hits="" data-linenumber="42"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="42"> + <li class="never" data-hits="" data-linenumber="43"> <code class="ruby"> # Add the command line switch to add the module path</code> </li> - <li class="missed" data-hits="0" data-linenumber="43"> + <li class="missed" data-hits="0" data-linenumber="44"> <code class="ruby"> options &lt;&lt; &quot;--modulepath '#{module_paths.join(';')}'&quot;</code> </li> - <li class="never" data-hits="" data-linenumber="44"> + <li class="never" data-hits="" data-linenumber="45"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="45"> + <li class="never" data-hits="" data-linenumber="46"> <code class="ruby"></code> </li> - <li class="missed" data-hits="0" data-linenumber="46"> + <li class="missed" data-hits="0" data-linenumber="47"> <code class="ruby"> if @hiera_config_path</code> </li> - <li class="missed" data-hits="0" data-linenumber="47"> + <li class="missed" data-hits="0" data-linenumber="48"> <code class="ruby"> options &lt;&lt; &quot;--hiera_config=#{@hiera_config_path}&quot;</code> </li> - <li class="never" data-hits="" data-linenumber="48"> + <li class="never" data-hits="" data-linenumber="49"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="49"> + <li class="never" data-hits="" data-linenumber="50"> <code class="ruby"></code> </li> - <li class="missed" data-hits="0" data-linenumber="50"> + <li class="missed" data-hits="0" data-linenumber="51"> <code class="ruby"> if !@machine.env.ui.is_a?(Vagrant::UI::Colored)</code> </li> - <li class="missed" data-hits="0" data-linenumber="51"> + <li class="missed" data-hits="0" data-linenumber="52"> <code class="ruby"> options &lt;&lt; &quot;--color=false&quot;</code> </li> - <li class="never" data-hits="" data-linenumber="52"> + <li class="never" data-hits="" data-linenumber="53"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="53"> + <li class="never" data-hits="" data-linenumber="54"> <code class="ruby"></code> </li> - <li class="missed" data-hits="0" data-linenumber="54"> + <li class="missed" data-hits="0" data-linenumber="55"> <code class="ruby"> options &lt;&lt; &quot;--manifestdir #{manifests_guest_path}&quot;</code> </li> - <li class="missed" data-hits="0" data-linenumber="55"> + <li class="missed" data-hits="0" data-linenumber="56"> <code class="ruby"> options &lt;&lt; &quot;--detailed-exitcodes&quot;</code> </li> - <li class="missed" data-hits="0" data-linenumber="56"> + <li class="missed" data-hits="0" data-linenumber="57"> <code class="ruby"> options &lt;&lt; @manifest_file</code> </li> - <li class="missed" data-hits="0" data-linenumber="57"> + <li class="missed" data-hits="0" data-linenumber="58"> <code class="ruby"> options = options.join(&quot; &quot;)</code> </li> - <li class="never" data-hits="" data-linenumber="58"> + <li class="never" data-hits="" data-linenumber="59"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="59"> + <li class="never" data-hits="" data-linenumber="60"> <code class="ruby"> # Build up the custom facts if we have any</code> </li> - <li class="missed" data-hits="0" data-linenumber="60"> + <li class="missed" data-hits="0" data-linenumber="61"> <code class="ruby"> facter = &quot;&quot;</code> </li> - <li class="missed" data-hits="0" data-linenumber="61"> + <li class="missed" data-hits="0" data-linenumber="62"> - <code class="ruby"> if !config.facter.empty?</code> + <code class="ruby"> if !@config.facter.empty?</code> </li> - <li class="missed" data-hits="0" data-linenumber="62"> + <li class="missed" data-hits="0" data-linenumber="63"> <code class="ruby"> facts = []</code> </li> - <li class="missed" data-hits="0" data-linenumber="63"> + <li class="missed" data-hits="0" data-linenumber="64"> - <code class="ruby"> config.facter.each do |key, value|</code> + <code class="ruby"> @config.facter.each do |key, value|</code> </li> - <li class="missed" data-hits="0" data-linenumber="64"> + <li class="missed" data-hits="0" data-linenumber="65"> <code class="ruby"> facts &lt;&lt; &quot;$env:FACTER_#{key}='#{value}';&quot;</code> </li> - <li class="never" data-hits="" data-linenumber="65"> + <li class="never" data-hits="" data-linenumber="66"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="66"> + <li class="never" data-hits="" data-linenumber="67"> <code class="ruby"></code> </li> - <li class="missed" data-hits="0" data-linenumber="67"> + <li class="missed" data-hits="0" data-linenumber="68"> <code class="ruby"> facter = &quot;#{facts.join(&quot; &quot;)} &quot;</code> </li> - <li class="never" data-hits="" data-linenumber="68"> + <li class="never" data-hits="" data-linenumber="69"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="69"> + <li class="never" data-hits="" data-linenumber="70"> <code class="ruby"></code> </li> - <li class="missed" data-hits="0" data-linenumber="70"> + <li class="missed" data-hits="0" data-linenumber="71"> <code class="ruby"> command = &quot;#{facter} puppet apply #{options}&quot;</code> </li> - <li class="missed" data-hits="0" data-linenumber="71"> + <li class="missed" data-hits="0" data-linenumber="72"> - <code class="ruby"> if config.working_directory</code> + <code class="ruby"> if @config.working_directory</code> </li> - <li class="missed" data-hits="0" data-linenumber="72"> + <li class="missed" data-hits="0" data-linenumber="73"> - <code class="ruby"> command = &quot;cd #{config.working_directory}; if($?) \{ #{command} \}&quot;</code> + <code class="ruby"> command = &quot;cd #{@config.working_directory}; if($?) \{ #{command} \}&quot;</code> </li> - <li class="never" data-hits="" data-linenumber="73"> + <li class="never" data-hits="" data-linenumber="74"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="74"> + <li class="never" data-hits="" data-linenumber="75"> <code class="ruby"></code> </li> - <li class="missed" data-hits="0" data-linenumber="75"> + <li class="missed" data-hits="0" data-linenumber="76"> <code class="ruby"> @machine.env.ui.info I18n.t(&quot;vagrant.provisioners.puppet.running_puppet&quot;,</code> </li> - <li class="never" data-hits="" data-linenumber="76"> + <li class="never" data-hits="" data-linenumber="77"> <code class="ruby"> :manifest =&gt; @manifest_file)</code> </li> - <li class="never" data-hits="" data-linenumber="77"> + <li class="never" data-hits="" data-linenumber="78"> <code class="ruby"></code> </li> - <li class="missed" data-hits="0" data-linenumber="78"> + <li class="missed" data-hits="0" data-linenumber="79"> - <code class="ruby"> @machine.communicate.sudo(command) do |type, data|</code> + <code class="ruby"> exit_status = @machine.communicate.sudo(command, :error_check =&gt; false) do |type, data|</code> </li> - <li class="missed" data-hits="0" data-linenumber="79"> + <li class="missed" data-hits="0" data-linenumber="80"> <code class="ruby"> if !data.empty?</code> </li> - <li class="missed" data-hits="0" data-linenumber="80"> + <li class="missed" data-hits="0" data-linenumber="81"> <code class="ruby"> @machine.env.ui.info(data, :new_line =&gt; false, :prefix =&gt; false)</code> </li> - <li class="never" data-hits="" data-linenumber="81"> + <li class="never" data-hits="" data-linenumber="82"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="82"> + <li class="never" data-hits="" data-linenumber="83"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="83"> + <li class="never" data-hits="" data-linenumber="84"> + <code class="ruby"> </code> + </li> + + <li class="never" data-hits="" data-linenumber="85"> + + + <code class="ruby"> # Puppet returns 0 or 2 for success with --detailed-exitcodes</code> + </li> + + <li class="missed" data-hits="0" data-linenumber="86"> + + + <code class="ruby"> if ![0,2].include?(exit_status)</code> + </li> + + <li class="missed" data-hits="0" data-linenumber="87"> + + + <code class="ruby"> raise ::VagrantWindows::Errors::WinRMExecutionError,</code> + </li> + + <li class="never" data-hits="" data-linenumber="88"> + + + <code class="ruby"> :shell =&gt; :powershell,</code> + </li> + + <li class="never" data-hits="" data-linenumber="89"> + + + <code class="ruby"> :command =&gt; command,</code> + </li> + + <li class="never" data-hits="" data-linenumber="90"> + + + <code class="ruby"> :message =&gt; &quot;Puppet failed with an exit code of #{exit_status}&quot;</code> + </li> + + <li class="never" data-hits="" data-linenumber="91"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="92"> + + <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="84"> + <li class="never" data-hits="" data-linenumber="93"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="85"> + <li class="covered" data-hits="1" data-linenumber="94"> <span class="hits">1</span> <code class="ruby"> def configure_on_windows(root_config)</code> </li> - <li class="never" data-hits="" data-linenumber="86"> + <li class="never" data-hits="" data-linenumber="95"> <code class="ruby"> # Calculate the paths we're going to use based on the environment</code> </li> - <li class="missed" data-hits="0" data-linenumber="87"> + <li class="missed" data-hits="0" data-linenumber="96"> <code class="ruby"> root_path = @machine.env.root_path</code> </li> - <li class="missed" data-hits="0" data-linenumber="88"> + <li class="missed" data-hits="0" data-linenumber="97"> <code class="ruby"> @expanded_manifests_path = @config.expanded_manifests_path(root_path)</code> </li> - <li class="missed" data-hits="0" data-linenumber="89"> + <li class="missed" data-hits="0" data-linenumber="98"> <code class="ruby"> @expanded_module_paths = @config.expanded_module_paths(root_path)</code> </li> - <li class="missed" data-hits="0" data-linenumber="90"> + <li class="missed" data-hits="0" data-linenumber="99"> <code class="ruby"> @manifest_file = File.join(manifests_guest_path, @config.manifest_file)</code> </li> - <li class="never" data-hits="" data-linenumber="91"> + <li class="never" data-hits="" data-linenumber="100"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="92"> + <li class="never" data-hits="" data-linenumber="101"> <code class="ruby"> # Setup the module paths</code> </li> - <li class="missed" data-hits="0" data-linenumber="93"> + <li class="missed" data-hits="0" data-linenumber="102"> <code class="ruby"> @module_paths = []</code> </li> - <li class="missed" data-hits="0" data-linenumber="94"> + <li class="missed" data-hits="0" data-linenumber="103"> <code class="ruby"> @expanded_module_paths.each_with_index do |path, i|</code> </li> - <li class="missed" data-hits="0" data-linenumber="95"> + <li class="missed" data-hits="0" data-linenumber="104"> - <code class="ruby"> @module_paths &lt;&lt; [path, File.join(config.temp_dir, &quot;modules-#{i}&quot;)]</code> + <code class="ruby"> @module_paths &lt;&lt; [path, File.join(@config.temp_dir, &quot;modules-#{i}&quot;)]</code> </li> - <li class="never" data-hits="" data-linenumber="96"> + <li class="never" data-hits="" data-linenumber="105"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="97"> + <li class="never" data-hits="" data-linenumber="106"> <code class="ruby"></code> </li> - <li class="missed" data-hits="0" data-linenumber="98"> + <li class="missed" data-hits="0" data-linenumber="107"> <code class="ruby"> @logger.debug(&quot;Syncing folders from puppet configure&quot;)</code> </li> - <li class="missed" data-hits="0" data-linenumber="99"> + <li class="missed" data-hits="0" data-linenumber="108"> <code class="ruby"> @logger.debug(&quot;manifests_guest_path = #{manifests_guest_path}&quot;)</code> </li> - <li class="missed" data-hits="0" data-linenumber="100"> + <li class="missed" data-hits="0" data-linenumber="109"> <code class="ruby"> @logger.debug(&quot;expanded_manifests_path = #{@expanded_manifests_path}&quot;)</code> </li> - <li class="never" data-hits="" data-linenumber="101"> + <li class="never" data-hits="" data-linenumber="110"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="102"> + <li class="never" data-hits="" data-linenumber="111"> <code class="ruby"> # Windows guest volume mounting fails without an &quot;id&quot; specified</code> </li> - <li class="never" data-hits="" data-linenumber="103"> + <li class="never" data-hits="" data-linenumber="112"> <code class="ruby"> # This hacks around that problem and allows the PS mount script to work</code> </li> - <li class="missed" data-hits="0" data-linenumber="104"> + <li class="missed" data-hits="0" data-linenumber="113"> <code class="ruby"> root_config.vm.synced_folder(</code> </li> - <li class="never" data-hits="" data-linenumber="105"> + <li class="never" data-hits="" data-linenumber="114"> <code class="ruby"> @expanded_manifests_path, manifests_guest_path,</code> </li> - <li class="never" data-hits="" data-linenumber="106"> + <li class="never" data-hits="" data-linenumber="115"> <code class="ruby"> :id =&gt; &quot;v-manifests-1&quot;)</code> </li> - <li class="never" data-hits="" data-linenumber="107"> + <li class="never" data-hits="" data-linenumber="116"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="108"> + <li class="never" data-hits="" data-linenumber="117"> <code class="ruby"> # Share the manifests directory with the guest</code> </li> - <li class="never" data-hits="" data-linenumber="109"> + <li class="never" data-hits="" data-linenumber="118"> <code class="ruby"> #root_config.vm.synced_folder(</code> </li> - <li class="never" data-hits="" data-linenumber="110"> + <li class="never" data-hits="" data-linenumber="119"> <code class="ruby"> # @expanded_manifests_path, manifests_guest_path)</code> </li> - <li class="never" data-hits="" data-linenumber="111"> + <li class="never" data-hits="" data-linenumber="120"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="112"> + <li class="never" data-hits="" data-linenumber="121"> <code class="ruby"> # Share the module paths</code> </li> - <li class="missed" data-hits="0" data-linenumber="113"> + <li class="missed" data-hits="0" data-linenumber="122"> <code class="ruby"> count = 0</code> </li> - <li class="missed" data-hits="0" data-linenumber="114"> + <li class="missed" data-hits="0" data-linenumber="123"> <code class="ruby"> @module_paths.each do |from, to|</code> </li> - <li class="never" data-hits="" data-linenumber="115"> + <li class="never" data-hits="" data-linenumber="124"> <code class="ruby"> # Sorry for the cryptic key here, but VirtualBox has a strange limit on</code> </li> - <li class="never" data-hits="" data-linenumber="116"> + <li class="never" data-hits="" data-linenumber="125"> <code class="ruby"> # maximum size for it and its something small (around 10)</code> </li> - <li class="missed" data-hits="0" data-linenumber="117"> + <li class="missed" data-hits="0" data-linenumber="126"> <code class="ruby"> root_config.vm.synced_folder(from, to, :id =&gt; &quot;v-modules-#{count}&quot;)</code> </li> - <li class="missed" data-hits="0" data-linenumber="118"> + <li class="missed" data-hits="0" data-linenumber="127"> <code class="ruby"> count += 1</code> </li> - <li class="never" data-hits="" data-linenumber="119"> + <li class="never" data-hits="" data-linenumber="128"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="120"> + <li class="never" data-hits="" data-linenumber="129"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="121"> + <li class="never" data-hits="" data-linenumber="130"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="122"> + <li class="covered" data-hits="1" data-linenumber="131"> <span class="hits">1</span> <code class="ruby"> def is_windows?</code> </li> - <li class="missed" data-hits="0" data-linenumber="123"> + <li class="missed" data-hits="0" data-linenumber="132"> <code class="ruby"> VagrantWindows::WindowsMachine.is_windows?(@machine)</code> </li> - <li class="never" data-hits="" data-linenumber="124"> + <li class="never" data-hits="" data-linenumber="133"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="125"> + <li class="never" data-hits="" data-linenumber="134"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="126"> + <li class="never" data-hits="" data-linenumber="135"> <code class="ruby"> end # Puppet class</code> </li> - <li class="never" data-hits="" data-linenumber="127"> + <li class="never" data-hits="" data-linenumber="136"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="128"> + <li class="never" data-hits="" data-linenumber="137"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="129"> + <li class="never" data-hits="" data-linenumber="138"> <code class="ruby">end</code> </li> @@ -8360,18 +8414,18 @@ <span class="hits">1</span> <code class="ruby"> def initialize(machine)</code> </li> - <li class="covered" data-hits="4" data-linenumber="18"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="18"> + <span class="hits">3</span> <code class="ruby"> @machine = machine</code> </li> - <li class="covered" data-hits="4" data-linenumber="19"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="19"> + <span class="hits">3</span> <code class="ruby"> @logger = Log4r::Logger.new(&quot;vagrant_windows::windows_machine&quot;)</code> </li> <li class="never" data-hits="" data-linenumber="20"> @@ -9855,15 +9909,15 @@ </div> <div class="source_table" id="844842835a3c9ba296ba1e91954dcd0979df99b4"> <div class="header"> <h3>spec/vagrant-windows/winrmcommunicator_spec.rb</h3> - <h4><span class="green">100.0 %</span> covered</h4> + <h4><span class="red">37.5 %</span> covered</h4> <div> <b>24</b> relevant lines. - <span class="green"><b>24</b> lines covered</span> and - <span class="red"><b>0</b> lines missed.</span> + <span class="green"><b>9</b> lines covered</span> and + <span class="red"><b>15</b> lines missed.</span> </div> </div> <pre> <ol> @@ -9908,19 +9962,19 @@ <code class="ruby"> # Not ideal, but you have to start somewhere</code> </li> - <li class="covered" data-hits="1" data-linenumber="8"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="8"> + <code class="ruby"> @communicator = VagrantWindows::Communication::WinRMCommunicator.new({})</code> </li> - <li class="covered" data-hits="1" data-linenumber="9"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="9"> + <code class="ruby"> @communicator.winrmshell = VagrantWindows::Communication::WinRMShell.new(&quot;127.0.0.1&quot;, &quot;vagrant&quot;, &quot;vagrant&quot;)</code> </li> <li class="never" data-hits="" data-linenumber="10"> @@ -9944,13 +9998,13 @@ <span class="hits">1</span> <code class="ruby"> it &quot;should return 1 when error_check is false&quot; do</code> </li> - <li class="covered" data-hits="1" data-linenumber="14"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="14"> + <code class="ruby"> expect(@communicator.execute(&quot;exit 1&quot;, { :error_check =&gt; false })).to eq(1)</code> </li> <li class="never" data-hits="" data-linenumber="15"> @@ -9968,13 +10022,13 @@ <span class="hits">1</span> <code class="ruby"> it &quot;should raise WinRMExecutionError when error_check is true&quot; do</code> </li> - <li class="covered" data-hits="2" data-linenumber="18"> - <span class="hits">2</span> + <li class="missed" data-hits="0" data-linenumber="18"> + <code class="ruby"> expect { @communicator.execute(&quot;exit 1&quot;) }.to raise_error(VagrantWindows::Errors::WinRMExecutionError)</code> </li> <li class="never" data-hits="" data-linenumber="19"> @@ -9992,19 +10046,19 @@ <span class="hits">1</span> <code class="ruby"> it &quot;should raise specified error type when specified and error_check is true&quot; do</code> </li> - <li class="covered" data-hits="1" data-linenumber="22"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="22"> + <code class="ruby"> opts = { :error_class =&gt; VagrantWindows::Errors::WinRMInvalidShell }</code> </li> - <li class="covered" data-hits="2" data-linenumber="23"> - <span class="hits">2</span> + <li class="missed" data-hits="0" data-linenumber="23"> + <code class="ruby"> expect { @communicator.execute(&quot;exit 1&quot;, opts) }.to raise_error(VagrantWindows::Errors::WinRMInvalidShell)</code> </li> <li class="never" data-hits="" data-linenumber="24"> @@ -10034,25 +10088,25 @@ <span class="hits">1</span> <code class="ruby"> it &quot;should upload the file and overwrite it if it exists&quot; do</code> </li> - <li class="covered" data-hits="1" data-linenumber="29"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="29"> + <code class="ruby"> test_file = Tempfile.new(&quot;uploadtest&quot;)</code> </li> - <li class="covered" data-hits="1" data-linenumber="30"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="30"> + <code class="ruby"> IO.write(test_file, &quot;hello world&quot;)</code> </li> - <li class="covered" data-hits="1" data-linenumber="31"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="31"> + <code class="ruby"> @communicator.upload(test_file, &quot;c:\\vagrantuploadtest.txt&quot;)</code> </li> <li class="never" data-hits="" data-linenumber="32"> @@ -10064,19 +10118,19 @@ <code class="ruby"> # ensure we can overwrite</code> </li> - <li class="covered" data-hits="1" data-linenumber="34"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="34"> + <code class="ruby"> IO.write(test_file, &quot;goodbye cruel world&quot;)</code> </li> - <li class="covered" data-hits="1" data-linenumber="35"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="35"> + <code class="ruby"> @communicator.upload(test_file, &quot;c:\\vagrantuploadtest.txt&quot;)</code> </li> <li class="never" data-hits="" data-linenumber="36"> @@ -10088,25 +10142,25 @@ <code class="ruby"> # get the uploaded file's contents to ensure it uploaded properly</code> </li> - <li class="covered" data-hits="1" data-linenumber="38"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="38"> + <code class="ruby"> uploaded_file_content = ''</code> </li> - <li class="covered" data-hits="1" data-linenumber="39"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="39"> + <code class="ruby"> @communicator.execute(&quot;cat c:\\vagrantuploadtest.txt&quot;, {}) do |type, line|</code> </li> - <li class="covered" data-hits="2" data-linenumber="40"> - <span class="hits">2</span> + <li class="missed" data-hits="0" data-linenumber="40"> + <code class="ruby"> uploaded_file_content = uploaded_file_content + line</code> </li> <li class="never" data-hits="" data-linenumber="41"> @@ -10118,13 +10172,13 @@ <code class="ruby"> </code> </li> - <li class="covered" data-hits="1" data-linenumber="43"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="43"> + <code class="ruby"> expect(uploaded_file_content.chomp).to eq(&quot;goodbye cruel world&quot;)</code> </li> <li class="never" data-hits="" data-linenumber="44"> @@ -10425,15 +10479,15 @@ </div> <div class="source_table" id="25447093b9cbe29e6009455b5e95c517f212a004"> <div class="header"> <h3>spec/vagrant-windows/winrmshell_spec.rb</h3> - <h4><span class="green">100.0 %</span> covered</h4> + <h4><span class="red">45.0 %</span> covered</h4> <div> <b>20</b> relevant lines. - <span class="green"><b>20</b> lines covered</span> and - <span class="red"><b>0</b> lines missed.</span> + <span class="green"><b>9</b> lines covered</span> and + <span class="red"><b>11</b> lines missed.</span> </div> </div> <pre> <ol> @@ -10478,13 +10532,13 @@ <code class="ruby"> # Not ideal, but you have to start somewhere</code> </li> - <li class="covered" data-hits="1" data-linenumber="8"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="8"> + <code class="ruby"> @shell = VagrantWindows::Communication::WinRMShell.new(&quot;127.0.0.1&quot;, &quot;vagrant&quot;, &quot;vagrant&quot;)</code> </li> <li class="never" data-hits="" data-linenumber="9"> @@ -10508,13 +10562,13 @@ <span class="hits">1</span> <code class="ruby"> it &quot;should return exit code of 0&quot; do</code> </li> - <li class="covered" data-hits="1" data-linenumber="13"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="13"> + <code class="ruby"> expect(@shell.powershell(&quot;exit 0&quot;)[:exitcode]).to eq(0)</code> </li> <li class="never" data-hits="" data-linenumber="14"> @@ -10532,13 +10586,13 @@ <span class="hits">1</span> <code class="ruby"> it &quot;should return exit code greater than 0&quot; do</code> </li> - <li class="covered" data-hits="1" data-linenumber="17"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="17"> + <code class="ruby"> expect(@shell.powershell(&quot;exit 1&quot;)[:exitcode]).to eq(1)</code> </li> <li class="never" data-hits="" data-linenumber="18"> @@ -10556,37 +10610,37 @@ <span class="hits">1</span> <code class="ruby"> it &quot;should return stdout&quot; do</code> </li> - <li class="covered" data-hits="1" data-linenumber="21"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="21"> + <code class="ruby"> result = @shell.powershell(&quot;dir&quot;) do |type, line|</code> </li> - <li class="covered" data-hits="4" data-linenumber="22"> - <span class="hits">4</span> + <li class="missed" data-hits="0" data-linenumber="22"> + <code class="ruby"> expect(type).to eq(:stdout)</code> </li> - <li class="covered" data-hits="4" data-linenumber="23"> - <span class="hits">4</span> + <li class="missed" data-hits="0" data-linenumber="23"> + <code class="ruby"> expect(line.length).to be &gt; 1 </code> </li> <li class="never" data-hits="" data-linenumber="24"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="1" data-linenumber="25"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="25"> + <code class="ruby"> expect(result[:exitcode]).to eq(0)</code> </li> <li class="never" data-hits="" data-linenumber="26"> @@ -10616,35 +10670,35 @@ <span class="hits">1</span> <code class="ruby"> it &quot;should return stdout&quot; do</code> </li> - <li class="covered" data-hits="1" data-linenumber="31"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="31"> + <code class="ruby"> result = @shell.cmd(&quot;dir&quot;) do |type, line|</code> </li> - <li class="covered" data-hits="3" data-linenumber="32"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="32"> + <code class="ruby"> expect(type).to eq(:stdout)</code> </li> - <li class="covered" data-hits="3" data-linenumber="33"> - <span class="hits">3</span> + <li class="missed" data-hits="0" data-linenumber="33"> + <code class="ruby"> expect(line.length).to be &gt; 1 </code> </li> <li class="never" data-hits="" data-linenumber="34"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="1" data-linenumber="35"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="35"> + <code class="ruby"> expect(result[:exitcode]).to eq(0)</code> </li> <li class="never" data-hits="" data-linenumber="36">