]> git.ipfire.org Git - people/stevee/perl-ipset.git/commitdiff
Add test to remove ports from a set master
authorStefan Schantl <stefan.schantl@ipfire.org>
Mon, 17 Apr 2023 13:23:26 +0000 (15:23 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Mon, 17 Apr 2023 13:23:26 +0000 (15:23 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
t/IPSet.t

index 8705c013c457d1fda6dc3dce46e403343a39e68c..e3f003bf9a13b07ecb84afa51f76671547dc5025 100644 (file)
--- a/t/IPSet.t
+++ b/t/IPSet.t
@@ -8,7 +8,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 24;
+use Test::More tests => 27;
 BEGIN { use_ok('IPSet') };
 
 #########################
@@ -129,6 +129,15 @@ foreach my $port (@ports) {
 $data = &IPSet::get_set_data($session, $portset{'name'});
 ok($data->{entries} eq scalar(@ports), "All ports added successfully to the set");
 
+# Remove a port from the set.
+$remove = &IPSet::remove_port($session, $portset{'name'}, $ports[0]);
+ok($remove, "Successfully removed $ports[0] from $portset{'name'}");
+
+# Grab set data from portset once again.
+$data = &IPSet::get_set_data($session, $portset{'name'});
+ok($data->{entries} lt scalar(@ports), "Less entries in the set than at the ports array");
+ok($data->{entries} gt 0, "At least one entry on the portset");
+
 # Destroy the port set.
 &IPSet::delete_set($session, $portset{'name'});