[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Change the rule for which descriptors get included in t...



Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv31412/lib/mixminion

Modified Files:
	test.py 
Log Message:
Change the rule for which descriptors get included in the directory.

The old rule was:  If A and B supercede C over all time, don't include C.

The new rule is: If A and B supercede C _over the interveral of time
      for which the directory is generated_, don't included C.

This way, if the directory gets C (valid Jan-May), and then gets a
more recently published A (valid Jan-Feb) it won't include "C" when
generating a directory for Jan.

(whew!)



Index: test.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/test.py,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -d -r1.113 -r1.114
--- test.py	30 May 2003 03:07:56 -0000	1.113
+++ test.py	2 Jun 2003 20:55:23 -0000	1.114
@@ -3923,19 +3923,18 @@
         # Now generate a directory...
         lst.generateDirectory(now, dayLater, 0,
                               identity, now)
-        # (Fred1, and Lola0, and Lola1 should get included.)
+        # (Fred1, and Lola1 should get included.)
         d = readFile(lst.getDirectoryFilename())
         self.assert_(d.startswith("[Directory]\n"))
-        eq(3, d.count("[Server]\n"))
+        eq(2, d.count("[Server]\n"))
         self.assert_(stringContains(d, examples["Fred"][1]))
-        self.assert_(stringContains(d, examples["Lola"][0]))
         self.assert_(stringContains(d, examples["Lola"][1]))
 
         # Did a backup directory get made?
         eq(1, len(os.listdir(dirArchiveDir)))
         # Validate the directory, and check that values are as expected.
         sd = ServerDirectory(d)
-        eq(len(sd.getServers()), 3)
+        eq(len(sd.getServers()), 2)
         eq(sd["Directory"]["Version"], "0.2")
         eq(sd["Directory"]["Published"], int(now))
         eq(sd["Directory"]["Valid-After"], previousMidnight(now))
@@ -3970,7 +3969,7 @@
                               identity)
         d2 = readFile(lst.getDirectoryFilename())
         sd2 = ServerDirectory(d2)
-        self.assertEquals(3, len(sd2.getServers()))
+        self.assertEquals(2, len(sd2.getServers()))
 
         # Now try cleaning servers.   First, make sure we can't insert
         # an expired server.