forked from ccnet/CruiseControl.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCCnetDeploymentTests.cs
More file actions
45 lines (34 loc) · 1.74 KB
/
Copy pathCCnetDeploymentTests.cs
File metadata and controls
45 lines (34 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.IO;
using NUnit.Framework;
namespace ThoughtWorks.CruiseControl.UnitTests
{
/// <summary>
/// Class containing tests for CCNet deployment issues.
/// Just to make sure that certaing settings are ok before a package is made
/// ex.:
/// ° check that there are xsl files in the xsl files folder
/// ° check that there are no default passwords
/// </summary>
[TestFixture]
public class CCnetDeploymentTests
{
[Test]
public void TestForAdminPackageOfWebDashboardIsEmpty()
{
#if DEBUG
string configFile = System.IO.Path.Combine(new string[] {Directory.GetCurrentDirectory(), "..", "..", "..", "WebDashboard", "dashboard.config"});
#else
string configFile = System.IO.Path.Combine(new string[] {Directory.GetCurrentDirectory(), "..", "..", "project", "WebDashboard", "dashboard.config"});
#endif
Assert.IsTrue(System.IO.File.Exists(configFile), "Dashboard.config not found at {0}", configFile);
System.Xml.XmlDocument xdoc = new System.Xml.XmlDocument();
xdoc.Load(configFile);
var adminPluginNode = xdoc.SelectSingleNode("/dashboard/plugins/farmPlugins/administrationPlugin");
Assert.IsNotNull(adminPluginNode, "Admin package configuration not found in dashboard.config at {0}", configFile);
var pwd = adminPluginNode.Attributes["password"];
Assert.IsNotNull(pwd, "password attribute not defined in admin packackage in dashboard.config at {0}", configFile);
Assert.AreEqual("", pwd.Value, "Password must be empty string, to force users to enter one. No default passwords allowed in distribution");
}
}
}