diff options
Diffstat (limited to 'src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc')
-rw-r--r-- | src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc | 214 |
1 files changed, 94 insertions, 120 deletions
diff --git a/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc index 1467e353db..51314b6140 100644 --- a/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc @@ -404,20 +404,20 @@ TEST_F(MemfileLeaseMgrTest, leaseFileCleanup4) { // stored. std::string new_file_contents = "address,hwaddr,client_id,valid_lifetime,expire," - "subnet_id,fqdn_fwd,fqdn_rev,hostname\n"; + "subnet_id,fqdn_fwd,fqdn_rev,hostname,state\n"; // This string contains the contents of the lease file with exactly // one lease, but two entries. One of the entries should be removed // as a result of lease file cleanup. std::string current_file_contents = new_file_contents + - "192.0.2.2,02:02:02:02:02:02,,200,200,8,1,1,,\n" - "192.0.2.2,02:02:02:02:02:02,,200,800,8,1,1,,\n"; + "192.0.2.2,02:02:02:02:02:02,,200,200,8,1,1,,1\n" + "192.0.2.2,02:02:02:02:02:02,,200,800,8,1,1,,1\n"; LeaseFileIO current_file(getLeaseFilePath("leasefile4_0.csv")); current_file.writeFile(current_file_contents); std::string previous_file_contents = new_file_contents + - "192.0.2.3,03:03:03:03:03:03,,200,200,8,1,1,,\n" - "192.0.2.3,03:03:03:03:03:03,,200,800,8,1,1,,\n"; + "192.0.2.3,03:03:03:03:03:03,,200,200,8,1,1,,1\n" + "192.0.2.3,03:03:03:03:03:03,,200,800,8,1,1,,1\n"; LeaseFileIO previous_file(getLeaseFilePath("leasefile4_0.csv.2")); previous_file.writeFile(previous_file_contents); @@ -453,15 +453,15 @@ TEST_F(MemfileLeaseMgrTest, leaseFileCleanup4) { ASSERT_NO_THROW(lease_mgr->addLease(new_lease)); std::string updated_file_contents = new_file_contents + - "192.0.2.45,00:00:00:00:00:00,,100,100,1,0,0,\n"; + "192.0.2.45,00:00:00:00:00:00,,100,100,1,0,0,,1\n"; EXPECT_EQ(updated_file_contents, current_file.readFile()); // This string contains the contents of the lease file we // expect after the LFC run. It has two leases with one // entry each. std::string result_file_contents = new_file_contents + - "192.0.2.2,02:02:02:02:02:02,,200,800,8,1,1,\n" - "192.0.2.3,03:03:03:03:03:03,,200,800,8,1,1,\n"; + "192.0.2.2,02:02:02:02:02:02,,200,800,8,1,1,,1\n" + "192.0.2.3,03:03:03:03:03:03,,200,800,8,1,1,,1\n"; // The LFC should have created a file with the two leases and moved it // to leasefile4_0.csv.2 @@ -480,24 +480,24 @@ TEST_F(MemfileLeaseMgrTest, leaseFileCleanup6) { std::string new_file_contents = "address,duid,valid_lifetime,expire,subnet_id," "pref_lifetime,lease_type,iaid,prefix_len,fqdn_fwd," - "fqdn_rev,hostname,hwaddr\n"; + "fqdn_rev,hostname,hwaddr,state\n"; // This string contains the contents of the lease file with exactly // one lease, but two entries. One of the entries should be removed // as a result of lease file cleanup. std::string current_file_contents = new_file_contents + "2001:db8:1::1,00:01:02:03:04:05:06:0a:0b:0c:0d:0e:0f,200,200," - "8,100,0,7,0,1,1,,\n" + "8,100,0,7,0,1,1,,,1\n" "2001:db8:1::1,00:01:02:03:04:05:06:0a:0b:0c:0d:0e:0f,200,800," - "8,100,0,7,0,1,1,,\n"; + "8,100,0,7,0,1,1,,,1\n"; LeaseFileIO current_file(getLeaseFilePath("leasefile6_0.csv")); current_file.writeFile(current_file_contents); std::string previous_file_contents = new_file_contents + "2001:db8:1::2,01:01:01:01:01:01:01:01:01:01:01:01:01,200,200," - "8,100,0,7,0,1,1,,\n" + "8,100,0,7,0,1,1,,,1\n" "2001:db8:1::2,01:01:01:01:01:01:01:01:01:01:01:01:01,200,800," - "8,100,0,7,0,1,1,,\n"; + "8,100,0,7,0,1,1,,,1\n"; LeaseFileIO previous_file(getLeaseFilePath("leasefile6_0.csv.2")); previous_file.writeFile(previous_file_contents); @@ -536,7 +536,7 @@ TEST_F(MemfileLeaseMgrTest, leaseFileCleanup6) { std::string update_file_contents = new_file_contents + "3000::1,00:00:00:00:00:00:00:00:00:00:00:00:00,400," - "400,2,300,0,123,128,0,0,,\n"; + "400,2,300,0,123,128,0,0,,,1\n"; EXPECT_EQ(update_file_contents, current_file.readFile()); // This string contains the contents of the lease file we @@ -544,9 +544,9 @@ TEST_F(MemfileLeaseMgrTest, leaseFileCleanup6) { // entry each. std::string result_file_contents = new_file_contents + "2001:db8:1::1,00:01:02:03:04:05:06:0a:0b:0c:0d:0e:0f,200,800," - "8,100,0,7,0,1,1,,\n" + "8,100,0,7,0,1,1,,,1\n" "2001:db8:1::2,01:01:01:01:01:01:01:01:01:01:01:01:01,200,800," - "8,100,0,7,0,1,1,,\n"; + "8,100,0,7,0,1,1,,,1\n"; // The LFC should have created a file with the two leases and moved it // to leasefile6_0.csv.2 @@ -564,11 +564,11 @@ TEST_F(MemfileLeaseMgrTest, leaseFileCleanupStartFail) { // stored. std::string new_file_contents = "address,hwaddr,client_id,valid_lifetime,expire," - "subnet_id,fqdn_fwd,fqdn_rev,hostname\n"; + "subnet_id,fqdn_fwd,fqdn_rev,hostname,state\n"; // Create the lease file to be used by the backend. std::string current_file_contents = new_file_contents + - "192.0.2.2,02:02:02:02:02:02,,200,200,8,1,1,,\n"; + "192.0.2.2,02:02:02:02:02:02,,200,200,8,1,1,,1\n"; LeaseFileIO current_file(getLeaseFilePath("leasefile4_0.csv")); current_file.writeFile(current_file_contents); @@ -605,15 +605,15 @@ TEST_F(MemfileLeaseMgrTest, leaseFileFinish) { std::string new_file_contents = "address,duid,valid_lifetime,expire,subnet_id," "pref_lifetime,lease_type,iaid,prefix_len,fqdn_fwd," - "fqdn_rev,hostname,hwaddr\n"; + "fqdn_rev,hostname,hwaddr,state\n"; // This string contains the contents of the current lease file. // It should not be moved. std::string current_file_contents = new_file_contents + "2001:db8:1::1,00:01:02:03:04:05:06:0a:0b:0c:0d:0e:0f,200,200," - "8,100,0,7,0,1,1,,\n" + "8,100,0,7,0,1,1,,,1\n" "2001:db8:1::1,00:01:02:03:04:05:06:0a:0b:0c:0d:0e:0f,200,800," - "8,100,0,7,0,1,1,,\n"; + "8,100,0,7,0,1,1,,,1\n"; LeaseFileIO current_file(getLeaseFilePath("leasefile6_0.csv")); current_file.writeFile(current_file_contents); @@ -621,7 +621,7 @@ TEST_F(MemfileLeaseMgrTest, leaseFileFinish) { // be moved to the previous file. std::string finish_file_contents = new_file_contents + "2001:db8:1::2,01:01:01:01:01:01:01:01:01:01:01:01:01,200,800," - "8,100,0,7,0,1,1,,\n"; + "8,100,0,7,0,1,1,,,1\n"; LeaseFileIO finish_file(getLeaseFilePath("leasefile6_0.csv.completed")); finish_file.writeFile(finish_file_contents); @@ -668,15 +668,15 @@ TEST_F(MemfileLeaseMgrTest, leaseFileCopy) { std::string new_file_contents = "address,duid,valid_lifetime,expire,subnet_id," "pref_lifetime,lease_type,iaid,prefix_len,fqdn_fwd," - "fqdn_rev,hostname,hwaddr\n"; + "fqdn_rev,hostname,hwaddr,state\n"; // This string contains the contents of the current lease file. // It should not be moved. std::string current_file_contents = new_file_contents + "2001:db8:1::1,00:01:02:03:04:05:06:0a:0b:0c:0d:0e:0f,200,200," - "8,100,0,7,0,1,1,,\n" + "8,100,0,7,0,1,1,,,1\n" "2001:db8:1::1,00:01:02:03:04:05:06:0a:0b:0c:0d:0e:0f,200,800," - "8,100,0,7,0,1,1,,\n"; + "8,100,0,7,0,1,1,,,1\n"; LeaseFileIO current_file(getLeaseFilePath("leasefile6_0.csv")); current_file.writeFile(current_file_contents); @@ -686,7 +686,7 @@ TEST_F(MemfileLeaseMgrTest, leaseFileCopy) { // the same. std::string input_file_contents = new_file_contents + "2001:db8:1::2,01:01:01:01:01:01:01:01:01:01:01:01:01,200,800," - "8,100,0,7,0,1,1,,\n"; + "8,100,0,7,0,1,1,,,1\n"; LeaseFileIO input_file(getLeaseFilePath("leasefile6_0.csv.1")); input_file.writeFile(input_file_contents); @@ -1011,43 +1011,6 @@ TEST_F(MemfileLeaseMgrTest, testLease6Mac) { testLease6MAC(); } -/// @brief Tests whether memfile is able to work with old CSV file (without mac) -/// -/// Ticket #3555 introduced MAC address support in Lease6. Instead of developing -/// an upgrade script, the code is written in a way that allows reading old CSV -/// (i.e. format that was used in Kea 0.9), hence no upgrade is necessary. -TEST_F(MemfileLeaseMgrTest, testUpgrade0_9_0_to_0_9_1) { - - // Let's write a CSV file without hwaddr column. Sorry about the long - // lines, but nobody was around to whine about 80 columns limit when CSV - // format was invented :). - string csv_nohwaddr = - "address,duid,valid_lifetime,expire,subnet_id,pref_lifetime,lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname\n" - "2001:db8::1,42:42:42:42:42:42:42:42,3677,127133,73,3600,1,42,0,0,1,myhost.example.com.\n" - "2001:db8::2,3a:3a:3a:3a:3a:3a:3a:3a,5412,239979,73,1800,2,89,7,0,0,myhost.example.com.\n" - "2001:db8::3,1f:20:21:22:23:24:25:26,7000,241567,37,7200,0,4294967294,28,1,0,myhost.example.com.\n"; - - ofstream csv(getLeaseFilePath("leasefile6_0.csv").c_str(), ios::out | ios::trunc); - ASSERT_TRUE(csv.is_open()); - csv << csv_nohwaddr; - csv.close(); - - startBackend(V6); - - // None of the leases should have any hardware addresses assigned. - Lease6Ptr stored1 = lmptr_->getLease6(leasetype6_[1], ioaddress6_[1]); - ASSERT_TRUE(stored1); - EXPECT_FALSE(stored1->hwaddr_); - - Lease6Ptr stored2 = lmptr_->getLease6(leasetype6_[2], ioaddress6_[2]); - ASSERT_TRUE(stored2); - EXPECT_FALSE(stored2->hwaddr_); - - Lease6Ptr stored3 = lmptr_->getLease6(leasetype6_[3], ioaddress6_[3]); - ASSERT_TRUE(stored3); - EXPECT_FALSE(stored3->hwaddr_); -} - // Check that memfile reports version correctly. TEST_F(MemfileLeaseMgrTest, versionCheck) { @@ -1069,22 +1032,22 @@ TEST_F(MemfileLeaseMgrTest, versionCheck) { TEST_F(MemfileLeaseMgrTest, load4MultipleLeaseFiles) { LeaseFileIO io2(getLeaseFilePath("leasefile4_0.csv.2")); io2.writeFile("address,hwaddr,client_id,valid_lifetime,expire,subnet_id," - "fqdn_fwd,fqdn_rev,hostname\n" - "192.0.2.2,02:02:02:02:02:02,,200,200,8,1,1,,\n" - "192.0.2.11,bb:bb:bb:bb:bb:bb,,200,200,8,1,1,,\n"); + "fqdn_fwd,fqdn_rev,hostname,state\n" + "192.0.2.2,02:02:02:02:02:02,,200,200,8,1,1,,1\n" + "192.0.2.11,bb:bb:bb:bb:bb:bb,,200,200,8,1,1,,1\n"); LeaseFileIO io1(getLeaseFilePath("leasefile4_0.csv.1")); io1.writeFile("address,hwaddr,client_id,valid_lifetime,expire,subnet_id," - "fqdn_fwd,fqdn_rev,hostname\n" - "192.0.2.1,01:01:01:01:01:01,,200,200,8,1,1,,\n" - "192.0.2.11,bb:bb:bb:bb:bb:bb,,200,400,8,1,1,,\n" - "192.0.2.12,cc:cc:cc:cc:cc:cc,,200,200,8,1,1,,\n"); + "fqdn_fwd,fqdn_rev,hostname,state\n" + "192.0.2.1,01:01:01:01:01:01,,200,200,8,1,1,,1\n" + "192.0.2.11,bb:bb:bb:bb:bb:bb,,200,400,8,1,1,,1\n" + "192.0.2.12,cc:cc:cc:cc:cc:cc,,200,200,8,1,1,,1\n"); LeaseFileIO io(getLeaseFilePath("leasefile4_0.csv")); io.writeFile("address,hwaddr,client_id,valid_lifetime,expire,subnet_id," - "fqdn_fwd,fqdn_rev,hostname\n" - "192.0.2.10,0a:0a:0a:0a:0a:0a,,200,200,8,1,1,,\n" - "192.0.2.12,cc:cc:cc:cc:cc:cc,,200,400,8,1,1,,\n"); + "fqdn_fwd,fqdn_rev,hostname,state\n" + "192.0.2.10,0a:0a:0a:0a:0a:0a,,200,200,8,1,1,,1\n" + "192.0.2.12,cc:cc:cc:cc:cc:cc,,200,400,8,1,1,,1\n"); startBackend(V4); @@ -1127,27 +1090,27 @@ TEST_F(MemfileLeaseMgrTest, load4MultipleLeaseFiles) { TEST_F(MemfileLeaseMgrTest, load4CompletedFile) { LeaseFileIO io2(getLeaseFilePath("leasefile4_0.csv.2")); io2.writeFile("address,hwaddr,client_id,valid_lifetime,expire,subnet_id," - "fqdn_fwd,fqdn_rev,hostname\n" - "192.0.2.2,02:02:02:02:02:02,,200,200,8,1,1,,\n" - "192.0.2.11,bb:bb:bb:bb:bb:bb,,200,200,8,1,1,,\n"); + "fqdn_fwd,fqdn_rev,hostname,state\n" + "192.0.2.2,02:02:02:02:02:02,,200,200,8,1,1,,1\n" + "192.0.2.11,bb:bb:bb:bb:bb:bb,,200,200,8,1,1,,1\n"); LeaseFileIO io1(getLeaseFilePath("leasefile4_0.csv.1")); io1.writeFile("address,hwaddr,client_id,valid_lifetime,expire,subnet_id," - "fqdn_fwd,fqdn_rev,hostname\n" - "192.0.2.1,01:01:01:01:01:01,,200,200,8,1,1,,\n" - "192.0.2.11,bb:bb:bb:bb:bb:bb,,200,400,8,1,1,,\n" - "192.0.2.12,cc:cc:cc:cc:cc:cc,,200,200,8,1,1,,\n"); + "fqdn_fwd,fqdn_rev,hostname,state\n" + "192.0.2.1,01:01:01:01:01:01,,200,200,8,1,1,,1\n" + "192.0.2.11,bb:bb:bb:bb:bb:bb,,200,400,8,1,1,,1\n" + "192.0.2.12,cc:cc:cc:cc:cc:cc,,200,200,8,1,1,,1\n"); LeaseFileIO io(getLeaseFilePath("leasefile4_0.csv")); io.writeFile("address,hwaddr,client_id,valid_lifetime,expire,subnet_id," - "fqdn_fwd,fqdn_rev,hostname\n" - "192.0.2.10,0a:0a:0a:0a:0a:0a,,200,200,8,1,1,,\n" - "192.0.2.12,cc:cc:cc:cc:cc:cc,,200,400,8,1,1,,\n"); + "fqdn_fwd,fqdn_rev,hostname,state\n" + "192.0.2.10,0a:0a:0a:0a:0a:0a,,200,200,8,1,1,,1\n" + "192.0.2.12,cc:cc:cc:cc:cc:cc,,200,400,8,1,1,,1\n"); LeaseFileIO ioc(getLeaseFilePath("leasefile4_0.csv.completed")); ioc.writeFile("address,hwaddr,client_id,valid_lifetime,expire,subnet_id," - "fqdn_fwd,fqdn_rev,hostname\n" - "192.0.2.13,ff:ff:ff:ff:ff:ff,,200,200,8,1,1,,\n"); + "fqdn_fwd,fqdn_rev,hostname,state\n" + "192.0.2.13,ff:ff:ff:ff:ff:ff,,200,200,8,1,1,,1\n"); startBackend(V4); @@ -1203,29 +1166,32 @@ TEST_F(MemfileLeaseMgrTest, load4LFCInProgress) { TEST_F(MemfileLeaseMgrTest, load6MultipleLeaseFiles) { LeaseFileIO io2(getLeaseFilePath("leasefile6_0.csv.2")); io2.writeFile("address,duid,valid_lifetime,expire,subnet_id,pref_lifetime," - "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr\n" + "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr," + "state\n" "2001:db8:1::1,01:01:01:01:01:01:01:01:01:01:01:01:01," - "200,200,8,100,0,7,0,1,1,,\n" + "200,200,8,100,0,7,0,1,1,,,1\n" "2001:db8:1::2,02:02:02:02:02:02:02:02:02:02:02:02:02," - "200,200,8,100,0,7,0,1,1,,\n"); + "200,200,8,100,0,7,0,1,1,,,1\n"); LeaseFileIO io1(getLeaseFilePath("leasefile6_0.csv.1")); io1.writeFile("address,duid,valid_lifetime,expire,subnet_id,pref_lifetime," - "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr\n" + "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr," + "state\n" "2001:db8:1::3,03:03:03:03:03:03:03:03:03:03:03:03:03," - "200,200,8,100,0,7,0,1,1,,\n" + "200,200,8,100,0,7,0,1,1,,,1\n" "2001:db8:1::2,02:02:02:02:02:02:02:02:02:02:02:02:02," - "300,800,8,100,0,7,0,1,1,,\n" + "300,800,8,100,0,7,0,1,1,,,1\n" "2001:db8:1::4,04:04:04:04:04:04:04:04:04:04:04:04:04," - "200,200,8,100,0,7,0,1,1,,\n"); + "200,200,8,100,0,7,0,1,1,,,1\n"); LeaseFileIO io(getLeaseFilePath("leasefile6_0.csv")); io.writeFile("address,duid,valid_lifetime,expire,subnet_id,pref_lifetime," - "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr\n" + "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr," + "state\n" "2001:db8:1::4,04:04:04:04:04:04:04:04:04:04:04:04:04," - "400,1000,8,100,0,7,0,1,1,,\n" + "400,1000,8,100,0,7,0,1,1,,,1\n" "2001:db8:1::5,05:05:05:05:05:05:05:05:05:05:05:05:05," - "200,200,8,100,0,7,0,1,1,,\n"); + "200,200,8,100,0,7,0,1,1,,,1\n"); startBackend(V6); @@ -1266,21 +1232,23 @@ TEST_F(MemfileLeaseMgrTest, load6MultipleLeaseFiles) { TEST_F(MemfileLeaseMgrTest, load6MultipleNoSecondFile) { LeaseFileIO io1(getLeaseFilePath("leasefile6_0.csv.1")); io1.writeFile("address,duid,valid_lifetime,expire,subnet_id,pref_lifetime," - "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr\n" + "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr," + "state\n" "2001:db8:1::3,03:03:03:03:03:03:03:03:03:03:03:03:03," - "200,200,8,100,0,7,0,1,1,,\n" + "200,200,8,100,0,7,0,1,1,,,1\n" "2001:db8:1::2,02:02:02:02:02:02:02:02:02:02:02:02:02," - "300,800,8,100,0,7,0,1,1,,\n" + "300,800,8,100,0,7,0,1,1,,,1\n" "2001:db8:1::4,04:04:04:04:04:04:04:04:04:04:04:04:04," - "200,200,8,100,0,7,0,1,1,,\n"); + "200,200,8,100,0,7,0,1,1,,,1\n"); LeaseFileIO io(getLeaseFilePath("leasefile6_0.csv")); io.writeFile("address,duid,valid_lifetime,expire,subnet_id,pref_lifetime," - "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr\n" + "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr," + "state\n" "2001:db8:1::4,04:04:04:04:04:04:04:04:04:04:04:04:04," - "400,1000,8,100,0,7,0,1,1,,\n" + "400,1000,8,100,0,7,0,1,1,,,1\n" "2001:db8:1::5,05:05:05:05:05:05:05:05:05:05:05:05:05," - "200,200,8,100,0,7,0,1,1,,\n"); + "200,200,8,100,0,7,0,1,1,,,1\n"); startBackend(V6); @@ -1312,19 +1280,21 @@ TEST_F(MemfileLeaseMgrTest, load6MultipleNoSecondFile) { TEST_F(MemfileLeaseMgrTest, load6MultipleNoFirstFile) { LeaseFileIO io2(getLeaseFilePath("leasefile6_0.csv.2")); io2.writeFile("address,duid,valid_lifetime,expire,subnet_id,pref_lifetime," - "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr\n" + "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr," + "state\n" "2001:db8:1::1,01:01:01:01:01:01:01:01:01:01:01:01:01," - "200,200,8,100,0,7,0,1,1,,\n" + "200,200,8,100,0,7,0,1,1,,,1\n" "2001:db8:1::2,02:02:02:02:02:02:02:02:02:02:02:02:02," - "200,200,8,100,0,7,0,1,1,,\n"); + "200,200,8,100,0,7,0,1,1,,,1\n"); LeaseFileIO io(getLeaseFilePath("leasefile6_0.csv")); io.writeFile("address,duid,valid_lifetime,expire,subnet_id,pref_lifetime," - "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr\n" + "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr," + "state\n" "2001:db8:1::4,04:04:04:04:04:04:04:04:04:04:04:04:04," - "400,1000,8,100,0,7,0,1,1,,\n" + "400,1000,8,100,0,7,0,1,1,,,1\n" "2001:db8:1::5,05:05:05:05:05:05:05:05:05:05:05:05:05," - "200,200,8,100,0,7,0,1,1,,\n"); + "200,200,8,100,0,7,0,1,1,,,1\n"); startBackend(V6); @@ -1358,35 +1328,39 @@ TEST_F(MemfileLeaseMgrTest, load6MultipleNoFirstFile) { TEST_F(MemfileLeaseMgrTest, load6CompletedFile) { LeaseFileIO io2(getLeaseFilePath("leasefile6_0.csv.2")); io2.writeFile("address,duid,valid_lifetime,expire,subnet_id,pref_lifetime," - "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr\n" + "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr," + "state\n" "2001:db8:1::1,01:01:01:01:01:01:01:01:01:01:01:01:01," - "200,200,8,100,0,7,0,1,1,,\n" + "200,200,8,100,0,7,0,1,1,,,1\n" "2001:db8:1::2,02:02:02:02:02:02:02:02:02:02:02:02:02," - "200,200,8,100,0,7,0,1,1,,\n"); + "200,200,8,100,0,7,0,1,1,,,1\n"); LeaseFileIO io1(getLeaseFilePath("leasefile6_0.csv.1")); io1.writeFile("address,duid,valid_lifetime,expire,subnet_id,pref_lifetime," - "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr\n" + "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr," + "state\n" "2001:db8:1::3,03:03:03:03:03:03:03:03:03:03:03:03:03," - "200,200,8,100,0,7,0,1,1,,\n" + "200,200,8,100,0,7,0,1,1,,,1\n" "2001:db8:1::2,02:02:02:02:02:02:02:02:02:02:02:02:02," - "300,800,8,100,0,7,0,1,1,,\n" + "300,800,8,100,0,7,0,1,1,,,1\n" "2001:db8:1::4,04:04:04:04:04:04:04:04:04:04:04:04:04," - "200,200,8,100,0,7,0,1,1,,\n"); + "200,200,8,100,0,7,0,1,1,,,1\n"); LeaseFileIO io(getLeaseFilePath("leasefile6_0.csv")); io.writeFile("address,duid,valid_lifetime,expire,subnet_id,pref_lifetime," - "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr\n" + "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr," + "state\n" "2001:db8:1::4,04:04:04:04:04:04:04:04:04:04:04:04:04," - "400,1000,8,100,0,7,0,1,1,,\n" + "400,1000,8,100,0,7,0,1,1,,,1\n" "2001:db8:1::5,05:05:05:05:05:05:05:05:05:05:05:05:05," - "200,200,8,100,0,7,0,1,1,,\n"); + "200,200,8,100,0,7,0,1,1,,,1\n"); LeaseFileIO ioc(getLeaseFilePath("leasefile6_0.csv.completed")); ioc.writeFile("address,duid,valid_lifetime,expire,subnet_id,pref_lifetime," - "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr\n" + "lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr," + "state\n" "2001:db8:1::125,ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff," - "400,1000,8,100,0,7,0,1,1,,\n"); + "400,1000,8,100,0,7,0,1,1,,,1\n"); startBackend(V6); |