major source structure and module name changes
This commit is contained in:
14
micasad/test/ReadMe.txt
Normal file
14
micasad/test/ReadMe.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
Read Me:
|
||||
-------
|
||||
The current Directoy "test" is has unit test cases to test the miCASA daemon c# code.
|
||||
It uses Nunit(nunit.org) to develop testcases and execute the same.
|
||||
|
||||
There is a directory structure similar to the daemon code inside the test dir.
|
||||
For any function or aspect which needs to be tested in Daemon, add Test code here and
|
||||
the Test stubs will appear in the Ddebug build of micasad.exe
|
||||
|
||||
usage mono /dependencies/nunit-console.exe ../../bin/lux/dbg/micasad.exe
|
||||
|
||||
Windows has a GUI tool, can be downloaded at nunit.org
|
||||
|
||||
|
||||
145
micasad/test/cache/TestKeyChain.cs
vendored
Normal file
145
micasad/test/cache/TestKeyChain.cs
vendored
Normal file
@@ -0,0 +1,145 @@
|
||||
/***********************************************************************
|
||||
*
|
||||
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, Novell, Inc.
|
||||
*
|
||||
* To contact Novell about this file by physical or electronic mail,
|
||||
* you may find current contact information at www.novell.com.
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
#if DEBUG
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
//using System.InvalidOperationException;
|
||||
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using sscs.common;
|
||||
|
||||
namespace sscs.cache
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
public class TestKeyChain
|
||||
{
|
||||
|
||||
Secret mysec;
|
||||
KeyChain mykc;
|
||||
string secval;
|
||||
byte[] secbyte;
|
||||
|
||||
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
|
||||
mykc = new KeyChain("TestingID");
|
||||
|
||||
secval= "novell123";
|
||||
secbyte = Encoding.ASCII.GetBytes(secval);
|
||||
mysec = new Secret();
|
||||
mysec.SetKey("testkey");
|
||||
mysec.SetValue(secbyte);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void TestAddSecret()
|
||||
{
|
||||
mykc.AddSecret(mysec);
|
||||
Secret returnsecret = mykc.GetSecret("testkey");
|
||||
|
||||
Assert.AreEqual("novell123", Encoding.ASCII.GetString(returnsecret.GetValue("testkey")));
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void TestAddSecretWithDup()
|
||||
{
|
||||
//Add one more with same secret id
|
||||
byte[] newvalue = Encoding.ASCII.GetBytes("miCASA");
|
||||
mysec.SetValue(newvalue);
|
||||
|
||||
mykc.AddSecret(mysec);
|
||||
Secret returnsecret = mykc.GetSecret("testkey");
|
||||
|
||||
Assert.AreEqual("miCASA", Encoding.ASCII.GetString(returnsecret.GetValue("testkey")));
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
[ExpectedException(typeof(SecretNotFoundException))]
|
||||
public void TestRemoveSecret()
|
||||
{
|
||||
|
||||
mykc.RemoveSecret("testkey");
|
||||
|
||||
//Try and get the same.
|
||||
//Secret sec = mykc.GetSecret("testkey");
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Test]
|
||||
[ExpectedException(typeof(InvalidOperationException))]
|
||||
public void TestGetAllSecretsWhenNone()
|
||||
{
|
||||
// IDictionaryEnumerator myenum = (IDictionaryEnumerator)mykc.GetAllSecrets();
|
||||
//Object temp = myenum.Current;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestGetAllSecrets()
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
byte[] val1 = Encoding.ASCII.GetBytes("val1");
|
||||
byte[] val2 = Encoding.ASCII.GetBytes("val2");
|
||||
byte[] val3 = Encoding.ASCII.GetBytes("val3");
|
||||
|
||||
Secret sec1 = new Secret("key1", val1);
|
||||
Secret sec2 = new Secret("key2", val2);
|
||||
Secret sec3 = new Secret("key3", val3);
|
||||
|
||||
mykc.AddSecret(sec1);
|
||||
mykc.AddSecret(sec2);
|
||||
mykc.AddSecret(sec3);
|
||||
|
||||
IDictionaryEnumerator myenum =(IDictionaryEnumerator) mykc.GetAllSecrets();
|
||||
|
||||
while(myenum.MoveNext())
|
||||
{
|
||||
count++;
|
||||
}
|
||||
|
||||
Assert.AreEqual(3, mykc.GetNumSecrets());
|
||||
Assert.AreEqual(3, count);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
77
micasad/test/cache/TestSecret.cs
vendored
Normal file
77
micasad/test/cache/TestSecret.cs
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
/***********************************************************************
|
||||
*
|
||||
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, Novell, Inc.
|
||||
*
|
||||
* To contact Novell about this file by physical or electronic mail,
|
||||
* you may find current contact information at www.novell.com.
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
#if DEBUG
|
||||
using System;
|
||||
using System.Text;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace sscs.cache
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
public class TestSecret
|
||||
{
|
||||
|
||||
[Test]
|
||||
public void DefaultAddSecret()
|
||||
{
|
||||
|
||||
string someotherstr = "newvalue";
|
||||
byte[] newval = Encoding.ASCII.GetBytes(someotherstr);
|
||||
|
||||
Secret mysec = new Secret();
|
||||
|
||||
mysec.SetKey("newkey");
|
||||
mysec.SetValue(newval);
|
||||
mysec.SetEpasswd("enhanced");
|
||||
mysec.SetKey("alternatekey");
|
||||
|
||||
Assert.AreEqual("newvalue", Encoding.ASCII.GetString(mysec.GetValue("alternatekey")));
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void TestAddSecret()
|
||||
{
|
||||
|
||||
string somestr = "novell123";
|
||||
string someotherstr = "newvalue";
|
||||
byte[] mybyte = Encoding.ASCII.GetBytes(somestr);
|
||||
byte[] newval = Encoding.ASCII.GetBytes(someotherstr);
|
||||
|
||||
Secret mysec = new Secret("mail", mybyte);
|
||||
mysec.SetKey("newkey");
|
||||
mysec.SetValue(newval);
|
||||
|
||||
Assert.AreEqual("newkey", mysec.GetKey());
|
||||
Assert.AreEqual("newvalue", Encoding.ASCII.GetString(mysec.GetValue()));
|
||||
|
||||
}
|
||||
|
||||
//TBD: Need to Add Timestamp related cases, could be done when we use it
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
150
micasad/test/cache/TestSecretStore.cs
vendored
Normal file
150
micasad/test/cache/TestSecretStore.cs
vendored
Normal file
@@ -0,0 +1,150 @@
|
||||
/***********************************************************************
|
||||
*
|
||||
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, Novell, Inc.
|
||||
*
|
||||
* To contact Novell about this file by physical or electronic mail,
|
||||
* you may find current contact information at www.novell.com.
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
#if DEBUG
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
//using System.InvalidOperationException;
|
||||
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using sscs.common;
|
||||
|
||||
namespace sscs.cache
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
public class TestSecretStore
|
||||
{
|
||||
|
||||
User theuser = null;
|
||||
UnixUserIdentifier UserId = null;
|
||||
SecretStore mysec = null;
|
||||
KeyChain mykc = null;
|
||||
byte[] secbyte = null;
|
||||
Secret mysecret = null;
|
||||
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
|
||||
mykc = new KeyChain("TestingID");
|
||||
|
||||
|
||||
mysecret = new Secret();
|
||||
mysecret.SetKey("testkey");
|
||||
secbyte = Encoding.ASCII.GetBytes("NOVELL");
|
||||
mysecret.SetValue(secbyte);
|
||||
|
||||
mykc.AddSecret(mysecret);
|
||||
|
||||
|
||||
UserId = new UnixUserIdentifier(420);
|
||||
theuser = new UnixUser(UserId);
|
||||
mysec = new SecretStore(theuser);
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void TestIntialState()
|
||||
{
|
||||
Assert.AreEqual(0, mysec.GetNumKeyChains());
|
||||
// Assert.AreEqual(0, mysec.getRefCount());
|
||||
Assert.AreEqual(0, mysec.GetSecretStoreState());
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void TestAddKeyChain()
|
||||
{
|
||||
mysec.AddKeyChain(mykc);
|
||||
|
||||
Assert.AreEqual(1, mysec.GetNumKeyChains());
|
||||
|
||||
Secret returnsec = (mysec.GetKeyChain("TestingID")).GetSecret("testkey");;
|
||||
|
||||
Assert.AreEqual("NOVELL", Encoding.ASCII.GetString(returnsec.GetValue("testkey")));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void TestRemoveKeyChain()
|
||||
{
|
||||
mysec.RemoveKeyChain("TestingID");
|
||||
Assert.AreEqual(0, mysec.GetNumKeyChains());
|
||||
|
||||
Assert.AreEqual(false, mysec.CheckIfKeyChainExists("TestingID"));
|
||||
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException(typeof(KeyChainDoesNotExistException))]
|
||||
public void TestRemoveKeyChainAgain()
|
||||
{
|
||||
mysec.GetKeyChain("TestingID");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[Test]
|
||||
public void TestGetKeyChainEnumerator()
|
||||
{
|
||||
KeyChain mykc1 = new KeyChain("kc1");
|
||||
KeyChain mykc2 = new KeyChain("kc2");
|
||||
KeyChain mykc3 = new KeyChain("kc3");
|
||||
|
||||
Secret mysecret1 = new Secret("key1", secbyte);
|
||||
Secret mysecret2 = new Secret("key2", secbyte);
|
||||
Secret mysecret3 = new Secret("key3", secbyte);
|
||||
|
||||
mykc1.AddSecret(mysecret1);
|
||||
mykc2.AddSecret(mysecret2);
|
||||
mykc3.AddSecret(mysecret3);
|
||||
|
||||
mysec.AddKeyChain(mykc1);
|
||||
mysec.AddKeyChain(mykc2);
|
||||
mysec.AddKeyChain(mykc3);
|
||||
|
||||
Assert.AreEqual(3, mysec.GetNumKeyChains());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
110
micasad/test/common/TestRequestParser.cs
Normal file
110
micasad/test/common/TestRequestParser.cs
Normal file
@@ -0,0 +1,110 @@
|
||||
/***********************************************************************
|
||||
*
|
||||
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, Novell, Inc.
|
||||
*
|
||||
* To contact Novell about this file by physical or electronic mail,
|
||||
* you may find current contact information at www.novell.com.
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
#if DEBUG
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
//using System.InvalidOperationException;
|
||||
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using sscs.common;
|
||||
using sscs.verbs;
|
||||
|
||||
namespace sscs.cache
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
public class TestRequestParser
|
||||
{
|
||||
|
||||
|
||||
RequestParser reqParser = null;
|
||||
|
||||
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
|
||||
reqParser = new RequestParser();
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
[ExpectedException(typeof(FormatException))]
|
||||
public void TestNullRequest()
|
||||
{
|
||||
|
||||
// SSVerb verb = reqParser.ParseRequest(null);
|
||||
reqParser.ParseRequest(null);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestParseRequest()
|
||||
{
|
||||
|
||||
// byte[] buf = new byte[1024];
|
||||
|
||||
//buf[0] = 1;
|
||||
// buf[1] = 1;
|
||||
int i =1;
|
||||
byte[] dummy = BitConverter.GetBytes(i);
|
||||
SSVerb verb = reqParser.ParseRequest(dummy);
|
||||
Assert.AreEqual("sscs.verbs.OpenSecretStore", verb.GetVerbName());
|
||||
|
||||
i = 18;
|
||||
dummy = BitConverter.GetBytes(i);
|
||||
verb = reqParser.ParseRequest(dummy);
|
||||
Assert.AreEqual("sscs.verbs.GetUserState", verb.GetVerbName());
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException(typeof(ArgumentNullException))]
|
||||
public void TestParseRequestInvalid()
|
||||
{
|
||||
byte[] buf = new byte[1024] ;
|
||||
buf[0] = 25;
|
||||
buf[1] = 25;
|
||||
// SSVerb verb = reqParser.ParseRequest(buf);
|
||||
reqParser.ParseRequest(buf);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
176
micasad/test/common/TestSessionManager.cs
Normal file
176
micasad/test/common/TestSessionManager.cs
Normal file
@@ -0,0 +1,176 @@
|
||||
/***********************************************************************
|
||||
*
|
||||
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, Novell, Inc.
|
||||
*
|
||||
* To contact Novell about this file by physical or electronic mail,
|
||||
* you may find current contact information at www.novell.com.
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
#if DEBUG
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
//using System.InvalidOperationException;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using sscs.common;
|
||||
using sscs.cache;
|
||||
|
||||
namespace sscs.common
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
public class TestSessionManager
|
||||
{
|
||||
|
||||
User theuser = null;
|
||||
UnixUserIdentifier UserId = null;
|
||||
UnixUserIdentifier root = null;
|
||||
SecretStore mysec = null;
|
||||
SecretStore anothersec = null;
|
||||
KeyChain mykc1 = null;
|
||||
KeyChain mykc2 = null;
|
||||
byte[] secbyte1 = null;
|
||||
byte[] secbyte2 = null;
|
||||
Secret mysecret1 = null;
|
||||
Secret mysecret2 = null;
|
||||
SessionManager sesman ;
|
||||
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
|
||||
sesman = SessionManager.GetSessionManager;
|
||||
|
||||
mykc1 = new KeyChain("k1");
|
||||
mykc2 = new KeyChain("k2");
|
||||
|
||||
|
||||
mysecret1 = new Secret();
|
||||
mysecret2 = new Secret();
|
||||
|
||||
mysecret1.SetKey("key1");
|
||||
mysecret2.SetKey("key2");
|
||||
secbyte1 = Encoding.ASCII.GetBytes("NOVELL");
|
||||
secbyte2 = Encoding.ASCII.GetBytes("IBM");
|
||||
|
||||
mysecret1.SetValue(secbyte1);
|
||||
mysecret2.SetValue(secbyte2);
|
||||
|
||||
mykc1.AddSecret(mysecret1);
|
||||
mykc2.AddSecret(mysecret2);
|
||||
|
||||
|
||||
UserId = new UnixUserIdentifier(420);
|
||||
root = new UnixUserIdentifier(0);
|
||||
|
||||
//theuser = new UnixUser(UserId);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void TestCreateUserSession()
|
||||
{
|
||||
|
||||
anothersec = SessionManager.CreateUserSession(root);
|
||||
mysec = SessionManager.CreateUserSession(UserId);
|
||||
|
||||
//Assert.AreEqual(1, mysec.getRefCount());
|
||||
//Assert.AreEqual(1, anothersec.getRefCount());
|
||||
|
||||
Assert.AreEqual(true, SessionManager.CheckIfUserSessionExists(UserId));
|
||||
Assert.AreEqual(true, SessionManager.CheckIfUserSessionExists(root));
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void TestAddtoSession()
|
||||
{
|
||||
SecretStore s1 = SessionManager.GetUserSecretStore(UserId);
|
||||
SecretStore s2 = SessionManager.GetUserSecretStore(root);
|
||||
|
||||
s1.AddKeyChain(mykc1);
|
||||
s2.AddKeyChain(mykc2);
|
||||
|
||||
s1 = SessionManager.GetUserSecretStore(UserId);
|
||||
s2 = SessionManager.GetUserSecretStore(root);
|
||||
|
||||
KeyChain returnK1 = s1.GetKeyChain("k1");
|
||||
Secret returnS1 = returnK1.GetSecret("key1");
|
||||
|
||||
KeyChain returnK2 = s2.GetKeyChain("k2");
|
||||
Secret returnS2 = returnK2.GetSecret("key2");
|
||||
|
||||
Assert.AreEqual("NOVELL", Encoding.ASCII.GetString(returnS1.GetValue()));
|
||||
Assert.AreEqual("IBM",Encoding.ASCII.GetString(returnS2.GetValue()) );
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
[ExpectedException(typeof(KeyChainDoesNotExistException))]
|
||||
public void TestInvalidAccess()
|
||||
{
|
||||
SecretStore s1 = SessionManager.GetUserSecretStore(UserId);
|
||||
//SecretStore s2 = SessionManager.GetUserSecretStore(root);
|
||||
|
||||
s1.GetKeyChain("k2");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Test]
|
||||
public void TestRemoveUserSession()
|
||||
{
|
||||
SessionManager.RemoveUserSession(UserId, true);
|
||||
Assert.AreEqual(false, SessionManager.CheckIfUserSessionExists(UserId));
|
||||
|
||||
//TBD :Make the ref count more than one and delete call remove sesison once.
|
||||
//The call it once more.. only second time it should remove the session entry.
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
79
micasad/test/communication/TestUnixCommunication.cs
Normal file
79
micasad/test/communication/TestUnixCommunication.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
/***********************************************************************
|
||||
*
|
||||
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, Novell, Inc.
|
||||
*
|
||||
* To contact Novell about this file by physical or electronic mail,
|
||||
* you may find current contact information at www.novell.com.
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
#if DEBUG
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using NUnit.Framework;
|
||||
|
||||
using sscs.communication;
|
||||
|
||||
|
||||
namespace sscs.communication
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
public class TestUnixCommunication
|
||||
{
|
||||
|
||||
static Communication comm;
|
||||
Thread listeningthread = null;
|
||||
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
//[Ignore("That thread thing")]
|
||||
public void TestCommunication()
|
||||
{
|
||||
|
||||
|
||||
comm = new UnixCommunication();
|
||||
listeningthread = new Thread(new ThreadStart(StartServ));
|
||||
listeningthread.Start();
|
||||
//comm.StartCommunicationEndPoint();
|
||||
comm.CloseCommunicationEndPoint();
|
||||
|
||||
Assert.AreEqual(false, File.Exists("/tmp/novellSSCS"));
|
||||
|
||||
}
|
||||
|
||||
private static void StartServ()
|
||||
{
|
||||
|
||||
comm.StartCommunicationEndPoint();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
BIN
micasad/test/dependencies/nunit-console.exe
Normal file
BIN
micasad/test/dependencies/nunit-console.exe
Normal file
Binary file not shown.
BIN
micasad/test/dependencies/nunit.core.dll
Normal file
BIN
micasad/test/dependencies/nunit.core.dll
Normal file
Binary file not shown.
BIN
micasad/test/dependencies/nunit.extensions.dll
Normal file
BIN
micasad/test/dependencies/nunit.extensions.dll
Normal file
Binary file not shown.
BIN
micasad/test/dependencies/nunit.framework.dll
Normal file
BIN
micasad/test/dependencies/nunit.framework.dll
Normal file
Binary file not shown.
BIN
micasad/test/dependencies/nunit.mocks.dll
Normal file
BIN
micasad/test/dependencies/nunit.mocks.dll
Normal file
Binary file not shown.
BIN
micasad/test/dependencies/nunit.util.dll
Normal file
BIN
micasad/test/dependencies/nunit.util.dll
Normal file
Binary file not shown.
69
micasad/test/verbs/TestAddKeychains.cs
Normal file
69
micasad/test/verbs/TestAddKeychains.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
/***********************************************************************
|
||||
*
|
||||
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, Novell, Inc.
|
||||
*
|
||||
* To contact Novell about this file by physical or electronic mail,
|
||||
* you may find current contact information at www.novell.com.
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
#if DEBUG
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
//using System.InvalidOperationException;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using sscs.common;
|
||||
using sscs.cache;
|
||||
using sscs.verbs;
|
||||
|
||||
namespace sscs.verbs
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
public class TestAddKeyChain
|
||||
{
|
||||
|
||||
|
||||
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// TBD: Need to construct the input buf and output buf and call the processRequest()
|
||||
//As of now all internal functions are tested and the cachelib test code
|
||||
// also indirectly tests this function.
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
65
micasad/test/verbs/TestCloseSecretStore.cs
Normal file
65
micasad/test/verbs/TestCloseSecretStore.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
/***********************************************************************
|
||||
*
|
||||
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, Novell, Inc.
|
||||
*
|
||||
* To contact Novell about this file by physical or electronic mail,
|
||||
* you may find current contact information at www.novell.com.
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
#if DEBUG
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
//using System.InvalidOperationException;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using sscs.common;
|
||||
using sscs.cache;
|
||||
using sscs.verbs;
|
||||
|
||||
namespace sscs.verbs
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
public class TestCloseSecretStore
|
||||
{
|
||||
|
||||
|
||||
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// TBD: Need to construct the input buf and output buf and call the processRequest()
|
||||
//As of now all internal functions are tested and the cachelib test code
|
||||
// also indirectly tests this function.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
68
micasad/test/verbs/TestEnumerateKeyChainIDs.cs
Normal file
68
micasad/test/verbs/TestEnumerateKeyChainIDs.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
/***********************************************************************
|
||||
*
|
||||
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, Novell, Inc.
|
||||
*
|
||||
* To contact Novell about this file by physical or electronic mail,
|
||||
* you may find current contact information at www.novell.com.
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
#if DEBUG
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
//using System.InvalidOperationException;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using sscs.common;
|
||||
using sscs.cache;
|
||||
using sscs.verbs;
|
||||
|
||||
namespace sscs.verbs
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
public class TestEnumerateKeyChainID
|
||||
{
|
||||
|
||||
|
||||
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// TBD: Need to construct the input buf and output buf and call the processRequest()
|
||||
//As of now all internal functions are tested and the cachelib test code
|
||||
// also indirectly tests this function.
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
69
micasad/test/verbs/TestEnumerateSecIDs.cs
Normal file
69
micasad/test/verbs/TestEnumerateSecIDs.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
/***********************************************************************
|
||||
*
|
||||
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, Novell, Inc.
|
||||
*
|
||||
* To contact Novell about this file by physical or electronic mail,
|
||||
* you may find current contact information at www.novell.com.
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
#if DEBUG
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
//using System.InvalidOperationException;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using sscs.common;
|
||||
using sscs.cache;
|
||||
using sscs.verbs;
|
||||
|
||||
namespace sscs.verbs
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
public class TestEnumerateSecID
|
||||
{
|
||||
|
||||
|
||||
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// TBD: Need to construct the input buf and output buf and call the processRequest()
|
||||
//As of now all internal functions are tested and the cachelib test code
|
||||
// also indirectly tests this function.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
84
micasad/test/verbs/TestOpenSecretStore.cs
Normal file
84
micasad/test/verbs/TestOpenSecretStore.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
/***********************************************************************
|
||||
*
|
||||
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, Novell, Inc.
|
||||
*
|
||||
* To contact Novell about this file by physical or electronic mail,
|
||||
* you may find current contact information at www.novell.com.
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
#if DEBUG
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
//using System.InvalidOperationException;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using sscs.common;
|
||||
using sscs.cache;
|
||||
using sscs.verbs;
|
||||
|
||||
namespace sscs.verbs
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
public class TestOpenSecretStore
|
||||
{
|
||||
|
||||
|
||||
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
[Test]
|
||||
[ExpectedException(typeof(InvalidOperationException))]
|
||||
public void TestNullVerb()
|
||||
{
|
||||
|
||||
SSVerb verb = new OpenSecretStore();
|
||||
verb.processRequest(UserId);
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
// TBD: Need to construct the input buf and output buf and call the processRequest()
|
||||
//As of now all internal functions are tested and the cachelib test code
|
||||
// also indirectly tests this function.
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
69
micasad/test/verbs/TestReadSecret.cs
Normal file
69
micasad/test/verbs/TestReadSecret.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
/***********************************************************************
|
||||
*
|
||||
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, Novell, Inc.
|
||||
*
|
||||
* To contact Novell about this file by physical or electronic mail,
|
||||
* you may find current contact information at www.novell.com.
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
#if DEBUG
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
//using System.InvalidOperationException;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using sscs.common;
|
||||
using sscs.cache;
|
||||
using sscs.verbs;
|
||||
|
||||
namespace sscs.verbs
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
public class TestReadSecret
|
||||
{
|
||||
|
||||
|
||||
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// TBD: Need to construct the input buf and output buf and call the processRequest()
|
||||
//As of now all internal functions are tested and the cachelib test code
|
||||
// also indirectly tests this function.
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
70
micasad/test/verbs/TestRemoveKeyChain.cs
Normal file
70
micasad/test/verbs/TestRemoveKeyChain.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
/***********************************************************************
|
||||
*
|
||||
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, Novell, Inc.
|
||||
*
|
||||
* To contact Novell about this file by physical or electronic mail,
|
||||
* you may find current contact information at www.novell.com.
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
#if DEBUG
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
//using System.InvalidOperationException;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using sscs.common;
|
||||
using sscs.cache;
|
||||
using sscs.verbs;
|
||||
|
||||
namespace sscs.verbs
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
public class TestRemoveKeyChain
|
||||
{
|
||||
|
||||
|
||||
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// TBD: Need to construct the input buf and output buf and call the processRequest()
|
||||
//As of now all internal functions are tested and the cachelib test code
|
||||
// also indirectly tests this function.
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
71
micasad/test/verbs/TestWriteSecret.cs
Normal file
71
micasad/test/verbs/TestWriteSecret.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
/***********************************************************************
|
||||
*
|
||||
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, Novell, Inc.
|
||||
*
|
||||
* To contact Novell about this file by physical or electronic mail,
|
||||
* you may find current contact information at www.novell.com.
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
#if DEBUG
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
//using System.InvalidOperationException;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using sscs.common;
|
||||
using sscs.cache;
|
||||
using sscs.verbs;
|
||||
|
||||
namespace sscs.verbs
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
public class TestWriteSecret
|
||||
{
|
||||
|
||||
|
||||
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// TBD: Need to construct the input buf and output buf and call the processRequest()
|
||||
//As of now all internal functions are tested and the cachelib test code
|
||||
// also indirectly tests this function.
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user