public void VerifyLocal() { var ps = new DeploymentServer(Environment.MachineName); var ub = new UriBuilder("msmq", ps.Name) { Path = "dk_test" }; var t = new CreateLocalMsmqQueueTask(ps, new QueueAddress(ub.Uri)); var r = t.VerifyCanRun(); Assert.IsFalse(r.ContainsError(), "Errors occured during MSMQ create verification."); }
public void Bob() { var settings = new TestSettings(); settings.Bob = "dru"; settings.Environment = "PROD"; HUB.Settings = settings; _proto = new ProtoCopyFileTask(new DotNetPath(), "C:\\from\\here"); _proto.ToDirectory("C:\\to\\there\\{{Environment}}"); _serv = new DeploymentServer("bob"); _proto.RegisterRealTasks(_serv); }
public void CopyFileToUncDirectory() { var toDir = @"\\srvtestmachine\some_directory"; var fromDir = @".\bob"; HUB.Settings = new object(); var proto = new ProtoCopyFileTask(new DotNetPath(), fromDir); proto.ToDirectory(toDir); var server = new DeploymentServer("dru"); proto.RegisterRealTasks(server); }
public void Execute() { var ps = new DeploymentServer("srvtestweb01"); var ub = new UriBuilder("msmq", ps.Name) { Path = "dk_test" }; var address = new QueueAddress(ub.Uri); //delete the remote queue var t = new CreateRemoteMsmqQueueTask(ps, address); var r = t.Execute(); Assert.IsFalse(r.ContainsError(), "Errors occured during MSMQ create execution."); }
public void ExecuteLocal() { var ps = new DeploymentServer(Environment.MachineName); var ub = new UriBuilder("msmq", ps.Name) { Path = "dk_test2" }; var address = new QueueAddress(ub.Uri); if (MessageQueue.Exists(address.LocalName)) MessageQueue.Delete(address.LocalName); var t = new CreateLocalMsmqQueueTask(ps, address); var r = t.Execute(); Assert.IsFalse(r.ContainsError(), "Errors occured during MSMQ create execution."); }
public override void Context() { base.Context(); server = new DeploymentServer("127.0.0.1"); var ub = new UriBuilder("msmq", "127.0.0.1") { Path = "dk_test_remote" }; address = new QueueAddress(ub.Uri); task = new RemoteMsmqGrantReadWriteTask(server, address, user); }
public override void Context() { base.Context(); keyLocation = dotNetPath.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Microsoft", "Crypto", "RSA", "MachineKeys"); groups = new List<string> { WellKnownSecurityRoles.Users }; PhysicalServer server =new DeploymentServer("localhost"); task = new GrantReadCertificatePrivateKeyTask(server,groups, thumbprint, StoreName.My, StoreLocation.LocalMachine, dotNetPath); certificate = BaseSecurityCertificatePermissionsTask.FindCertificateBy(thumbprint, StoreName.My, StoreLocation.LocalMachine, server,result); }
public string test_share_name(string shareName, string destination) { var serverName = "localhost"; if (!Directory.Exists(destination)) { Directory.CreateDirectory(destination); } Win32Share.Create(serverName, shareName, destination, ""); var server = new DeploymentServer(serverName); var actual = path.GetPhysicalPath(server, @"~\{0}".FormatWith(shareName),false); Win32Share.Delete(serverName, shareName); Assert.AreEqual(System.IO.Path.GetFullPath(destination), actual); return actual; }
public void ExecuteLocal() { var ps = new DeploymentServer(Environment.MachineName); var ub = new UriBuilder("msmq", ps.Name) { Path = "dk_test2" }; var address = new QueueAddress(ub.Uri); if (MessageQueue.Exists(address.LocalName)) MessageQueue.Delete(address.LocalName); var t = new CreateLocalMsmqQueueTask(ps, address, transactional:true); var r = t.Execute(); Assert.IsFalse(r.ContainsError(), "Errors occured during MSMQ create execution."); var queue = MessageQueue.GetPrivateQueuesByMachine(Environment.MachineName).SingleOrDefault( x => address.LocalName.EndsWith(x.QueueName)); Assert.IsNotNull(queue, "Transactional queue was not created."); Assert.IsTrue(queue.Transactional, "Queue was created but is not transactional."); }
public void test_share_name(string shareName) { string serverName = "localhost"; string destination = @".\temp"; if (!Directory.Exists(destination)) { Directory.CreateDirectory(destination); } Win32Share.Create(serverName, shareName, destination, ""); var server = new DeploymentServer(serverName); var actual = _path.ConvertUncShareToLocalPath(server, @"~\{0}".FormatWith(shareName)); Win32Share.Delete(serverName, shareName); Assert.AreEqual(System.IO.Path.GetFullPath(destination), actual); }
public void AddServer(DeploymentServer server) { _servers.Add(server); }
public void when_converting_a_share_to_a_local_path_it_should_work_when_the_share_has_an_underscore_in_it() { var server = new DeploymentServer("localhost"); Assert.AreEqual(@"C:\code", _path.ConvertUncShareToLocalPath(server, @"~\code_")); }
void ProtoServer.MapTo(DeploymentServer server) { throw new NotImplementedException(); }
public void LocalhostShouldBeLocal() { var srv = new DeploymentServer("localhost"); Assert.IsTrue(srv.IsLocal); }
public void when_converting_a_share_to_a_local_path_it_should_work_when_the_share_is_prepended_with_the_server() { var server = new DeploymentServer("localhost"); Assert.AreEqual(@"C:\temp", _path.GetPhysicalPath(server, @"\\localhost\c$\temp", false)); }
public void when_converting_a_share_to_a_local_path_it_should_work_when_the_share_has_a_dollar_sign_in_it() { var server = new DeploymentServer("localhost"); Assert.AreEqual(@"C:\temp", _path.GetPhysicalPath(server, @"~\c$\temp", false)); }
public override void Context() { base.Context(); server = new DeploymentServer(remoteServerName); }
public void when_converting_a_share_to_a_local_path_it_should_work_when_the_share_is_prepended_with_a_tilda_aka_site_root() { var server = new DeploymentServer("localhost"); Assert.AreEqual(@"C:\temp", _path.ConvertUncShareToLocalPath(server, @"~\c$\temp")); }