Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
use strict;
use warnings;
use strict;
use warnings;
-use Test::More tests => 24;
+use Test::More tests => 27;
BEGIN { use_ok('IPSet') };
#########################
BEGIN { use_ok('IPSet') };
#########################
$data = &IPSet::get_set_data($session, $portset{'name'});
ok($data->{entries} eq scalar(@ports), "All ports added successfully to the set");
$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'});
# Destroy the port set.
&IPSet::delete_set($session, $portset{'name'});