projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
datapath: Change dp_idx to dp_ifindex, the ifindex of the local port.
[openvswitch]
/
tests
/
uuidfilt.pl
diff --git
a/tests/uuidfilt.pl
b/tests/uuidfilt.pl
index 6f003a52eb530c156cde3d267014a09c786f4af5..835f13b5344e02a9316b7bef75e83948016cafab 100755
(executable)
--- a/
tests/uuidfilt.pl
+++ b/
tests/uuidfilt.pl
@@
-13,9
+13,21
@@
sub lookup_uuid {
return "<$uuids{$uuid}>";
}
return "<$uuids{$uuid}>";
}
+sub sort_set {
+ my ($s) = @_;
+ my (@uuids) = sort { $a <=> $b } (grep(/\d+/, split(/(\d+)/, $s)));
+ return '["set",[' . join(',', map('["uuid","<' . $_ . '>"]', @uuids)) . ']]';
+}
+
my $u = '[0-9a-fA-F]';
my $uuid_re = "${u}{8}-${u}{4}-${u}{4}-${u}{4}-${u}{12}";
while (<>) {
s/($uuid_re)/lookup_uuid($1)/eg;
my $u = '[0-9a-fA-F]';
my $uuid_re = "${u}{8}-${u}{4}-${u}{4}-${u}{4}-${u}{12}";
while (<>) {
s/($uuid_re)/lookup_uuid($1)/eg;
+
+ # Sort sets like this:
+ # [["uuid","<1>"],["uuid","<0>"]]
+ # to look like this:
+ # [["uuid","<0>"],["uuid","<1>"]]
+ s/(\["set",\[(,?\["uuid","<\d+>"\])+\]\])/sort_set($1)/ge;
print $_;
}
print $_;
}