Пример #1
0
        public void Trigger_Simple_Deployment_And_Check_AppPool_And_Website_Test()
        {
            var client = GetClient();

            var request = new TriggerDeployment()
            {
                AppPoolName         = "ZZZ_Integration_PoolName",
                AppPoolUser         = "******",
                AppPoolPassword     = "******",
                WebsiteName         = "ZZZ_Integration_Website_Simple",
                AppRoot             = "/",
                PackageId           = "IntegrationTest",
                PackageVersion      = "1.3.3.7",
                WebsitePhysicalPath = @"C:\temp\integrationtests",
                RuntimeVersion      = RuntimeVersion.Version40,
            };

            client.PostFileWithRequest <TriggerDeploymentResponse>("/deployments", new FileInfo("src/PowerDeploy.IISDeployService.Tests/Files/package.zip".MapVcsRoot()), request).PrintDump();

            using (var manager = new ServerManager())
            {
                Assert.IsNotNull(manager.ApplicationPools[request.AppPoolName]);
                Assert.AreEqual(request.AppPoolName, manager.ApplicationPools[request.AppPoolName].Name);
                Assert.AreEqual(request.AppPoolUser, manager.ApplicationPools[request.AppPoolName].ProcessModel.UserName);
                Assert.AreEqual(request.AppPoolPassword, manager.ApplicationPools[request.AppPoolName].ProcessModel.Password);

                Assert.IsNotNull(manager.Sites[request.WebsiteName]);
                Assert.AreEqual(Path.Combine(request.WebsitePhysicalPath, "{0}_v{1}".Fmt(request.PackageId, request.PackageVersion)), manager.Sites[request.WebsiteName].Applications["/"].VirtualDirectories["/"].PhysicalPath);
            }

            IISManagerTestBuddy.DeleteAppPool(request.AppPoolName);
            IISManagerTestBuddy.DeleteWebsite(request.WebsiteName);
        }
Пример #2
0
        public void Rollback_Website_Test()
        {
            var client = GetClient();

            var request = new TriggerDeployment()
            {
                AppPoolName         = "ZZZ_Integration_PoolName",
                AppPoolUser         = "******",
                AppPoolPassword     = "******",
                WebsiteName         = "ZZZ_Integration_Website_Simple",
                AppRoot             = "/",
                PackageId           = "IntegrationTest",
                PackageVersion      = "1.3.3.7",
                WebsitePhysicalPath = @"C:\temp\integrationtests",
                RuntimeVersion      = RuntimeVersion.Version40,
                WebsitePort         = 2000,
            };

            client.PostFileWithRequest <TriggerDeploymentResponse>("/deployments", new FileInfo("src/PowerDeploy.IISDeployService.Tests/Files/package.zip".MapVcsRoot()), request).PrintDump();
            request.PackageVersion = "1.3.3.8";
            client.PostFileWithRequest <TriggerDeploymentResponse>("/deployments", new FileInfo("src/PowerDeploy.IISDeployService.Tests/Files/package.zip".MapVcsRoot()), request).PrintDump();

            var rollbackRequest = new RollbackDeployment()
            {
                WebsiteName = request.WebsiteName, RollbackTarget = "{0}_v{1}".Fmt(request.PackageId, "1.3.3.7")
            };

            client.Post(rollbackRequest);

            IISManagerTestBuddy.AssertWebsite(request.WebsiteName, Path.Combine(request.WebsitePhysicalPath, rollbackRequest.RollbackTarget), request.WebsitePort, request.AppPoolName);
            IISManagerTestBuddy.DeleteAppPool(request.AppPoolName);
            IISManagerTestBuddy.DeleteWebsite(request.WebsiteName);
        }
Пример #3
0
        public void Create_AppPool_Test()
        {
            IISManagerTestBuddy.DeleteAppPool("UnitTestAppPool");

            new IISManager().CreateAppPool("UnitTestAppPool", "pool-user", "pool-pass", RuntimeVersion.Version40);

            IISManagerTestBuddy.AssertAppPool("UnitTestAppPool", "pool-user", "pool-pass");
        }
Пример #4
0
        public void Create_Website_Test()
        {
            IISManagerTestBuddy.DeleteWebsite("UnitTestWebsite");
            IISManagerTestBuddy.DeleteAppPool("UnitTestAppPool");

            new IISManager().CreateWebsite("UnitTestWebsite", @"c:\temp", 80, "UnitTestAppPool");

            IISManagerTestBuddy.AssertWebsite("UnitTestWebsite", @"c:\temp", 80, "UnitTestAppPool");
        }