This C# program should run on a DTM server. It's used by the whql_client_install test to delete the client machine from the server's data store (if listed there) prior to client installation. This seems to be necessary to prevent trouble during testing (like failure to contact the client machine). Note: the binary is copied to the server at run time, so it doesn't need to be packaged in winutils.iso. Signed-off-by: Michael Goldish <mgoldish@xxxxxxxxxx> --- client/tests/kvm/deps/whql_delete_machine_15.cs | 82 ++++++++++++++++++++++ client/tests/kvm/deps/whql_delete_machine_15.exe | Bin 0 -> 10240 bytes 2 files changed, 82 insertions(+), 0 deletions(-) create mode 100644 client/tests/kvm/deps/whql_delete_machine_15.cs create mode 100644 client/tests/kvm/deps/whql_delete_machine_15.exe diff --git a/client/tests/kvm/deps/whql_delete_machine_15.cs b/client/tests/kvm/deps/whql_delete_machine_15.cs new file mode 100644 index 0000000..1d78a6d --- /dev/null +++ b/client/tests/kvm/deps/whql_delete_machine_15.cs @@ -0,0 +1,82 @@ +// DTM machine deletion tool +// Author: Michael Goldish <mgoldish@xxxxxxxxxx> +// Based on sample code by Microsoft. + +using System; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using Microsoft.DistributedAutomation.DeviceSelection; +using Microsoft.DistributedAutomation.SqlDataStore; + +namespace automate0 +{ + class AutoJob + { + static int Main(string[] args) + { + if (args.Length != 2) + { + Console.WriteLine("Error: incorrect number of command line arguments"); + Console.WriteLine("Usage: {0} serverName clientName", + System.Environment.GetCommandLineArgs()[0]); + return 1; + } + string serverName = args[0]; + string clientName = args[1]; + + try + { + // Initialize DeviceScript and connect to data store + Console.WriteLine("Initializing DeviceScript object"); + DeviceScript script = new DeviceScript(); + Console.WriteLine("Connecting to data store"); + script.ConnectToNamedDataStore(serverName); + + // Find the client machine + IResourcePool rootPool = script.GetResourcePoolByName("$"); + Console.WriteLine("Looking for client machine '{0}'", clientName); + IResource machine = rootPool.GetResourceByName(clientName); + if (machine == null) + { + Console.WriteLine("Client machine not found"); + return 0; + } + Console.WriteLine("Client machine '{0}' found ({1}, {2})", + clientName, machine.OperatingSystem, machine.ProcessorArchitecture); + + // Change the client machine's status to 'unsafe' + Console.WriteLine("Changing the client machine's status to 'Unsafe'"); + try + { + machine.ChangeResourceStatus("Unsafe"); + } + catch (Exception e) + { + Console.WriteLine("Warning: " + e.Message); + } + while (machine.Status != "Unsafe") + { + try + { + machine = rootPool.GetResourceByName(clientName); + } + catch (Exception e) + { + Console.WriteLine("Warning: " + e.Message); + } + System.Threading.Thread.Sleep(1000); + } + + // Delete the client machine from datastore + Console.WriteLine("Deleting client machine from data store"); + script.DeleteResource(machine.Id); + return 0; + } + catch (Exception e) + { + Console.WriteLine("Error: " + e.Message); + return 1; + } + } + } +} diff --git a/client/tests/kvm/deps/whql_delete_machine_15.exe b/client/tests/kvm/deps/whql_delete_machine_15.exe new file mode 100644 index 0000000000000000000000000000000000000000..3817ac42d7748b87af3683e86e1137757ed6073a GIT binary patch literal 10240 zcmeHMeQX@Zb$@%j;~h`rS#u{HC5p6`q$D0i@<@tGBPo(iilmft_#yKs*>0pr%exh| z%H8dGc26e#(I^N~IDn(rKw1=PTGvI>HU)y(v5Uq{Z5RD;QNRw8B1K&kR^7sIjMS)u zHvLM_sJ}P6%R5q%tDya-K$hIMZ{EE3=6%h~?%eFpK1oeP6vlo1I?>nh<ZE2P4+fXf zo!I#Y33{RB_3p20Gp~0qUa%a!D(z)yl=Xs9so1W*Wa_e3(XEO;HJ{hZcG1kXwZ(V& zs!vQ4&1g+zUAt>080{?zX`8ed(Vd{+!Pm7T06Ok*+zfO)LZ02gl>Pjq%eX=3tBJ-x zOSD=2*PnjVW1+{PH_!Mu(Hk6ujn_G%R?yx!Ow_rt?}OU<n(2xwhW1Ar__MCL;-dX_ z7XbQ{ufE-AsY@q1mz9nzprvdZ2hxmN$K7y^!}_c=OEwtURyv29b?w33aE%ikZD=a= zk2tQl*tQTw==&L>cT+?f+NcX2?I*f+jD)EGDaeb^6>CSfO9HKC5Zbsj8H)f*U(J9g z-o7`Kz8Vj;U)>bicC|IM{c2mN<7y^~o>W-=TOj731mdZPJfQh{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!(V$A#*OcXo zSZ8n&w9X>@7y+v)I21e5GrQ`4k*o7Iqgw45_B6P%=D4}adHXi)+1I1wFt%eBYB(NT z_1mCG97w@Vvv@*UmvAb%Y&y58bu7@T<ErbyQdFq1#WUt5v!s_89_cZhT;-DeNmKUd zHEW{4M{!4b&Ko7i^qo>lhHqj`VEXVn+Yb+~1py3)hl32E!P)-lb=wiZ#A*feTMhfq NZOi_Y@&A1U{u`?1<*)z% literal 0 HcmV?d00001 -- 1.5.4.1 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html