public string AddSshKey(string sshKey, string keyType, string comment)
        {
            string output = "";

            string key = string.Format("{0} {1} {2}", keyType, sshKey, comment);

            Sshd.AddKey(NodeConfig.Values["SSHD_BASE_DIR"], this.Uuid, key);

            return(output);
        }
Пример #2
0
        public void Test_Sshd()
        {
            bool testResult = true;

            try
            {
                if (Directory.Exists("TestHomeDir"))
                {
                    Directory.Delete("TestHomeDir", true);
                }
                Sshd.ConfigureSshd(@"c:\openshift\cygwin\installation", "testUser", "Administrator", "TestHomeDir", string.Empty);
                Sshd.AddKey(@"c:\openshift\cygwin\installation", "testUser", "testkey");
                Sshd.RemoveKey(@"c:\openshift\cygwin\installation", "testUser", "testkey");
                Sshd.RemoveUser(@"c:\openshift\cygwin\installation", "testUser", "Administrator", "TestHomeDir", string.Empty);
            }
            catch
            {
                testResult = false;
            }
            Assert.IsTrue(testResult);
        }