Skip to content

Topic/bz/master #1035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 16 additions & 25 deletions bin/inet_diffingerprints
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,49 @@ import sys
import re

def computeUniqueFingerprints(fingerprints):
i = 0
uniqueFingerprints = list()
while i < len(fingerprints):
fingerprint = fingerprints[i]
j = i
while (j < len(fingerprints)) and (fingerprint == fingerprints[j]):
j = j + 1
uniqueFingerprints.append([j-1, fingerprint])
i = j
for i in range(1, len(fingerprints)):
fingerprint = fingerprints[i-1]
if (fingerprints[i][1] != fingerprint[1]):
uniqueFingerprints.append(fingerprint)
if fingerprints:
uniqueFingerprints.append(fingerprints[-1])
return uniqueFingerprints

def readFingerprints1(eventlogFile):
"RegExp version"
regExp = re.compile(r"^E # ([0-9]+) t ((?:[0-9]*\.)?[0-9]+) m [0-9]+ ce [0-9]+ msg [0-9]+ f (?:\"([^\"]*)\"|(\S+))$")
regExp = re.compile(r"^E # ([0-9]+) t ((?:[0-9]*\.)?[0-9]+) m [0-9]+ ce -?[0-9]+ msg -?[0-9]+ f (?:\"([^\"]*)\"|(\S+))$")
fingerprints = list()
for line in eventlogFile:
match = regExp.match(line)
if match:
fingerprint = match.group(3) if match.group(3) else match.group(4)
fingerprints.append(fingerprint)
fingerprints.append([match.group(1), fingerprint])
return fingerprints

def isNewEvent(line):
return len(line) >= 4 and line[0:4] == "E # "

def getFingerprint(line):
n = len(line) - 1
return line[(n-14):(n-5)]

def readFingerprints2(eventlogFile):
fingerprints = list()
eventlogFile.readline() # skip the first line
for line in eventlogFile:
if isNewEvent(line):
fingerprint = getFingerprint(line)
fingerprints.append(fingerprint)
return fingerprints

def diffingerprint(elog1Fingerprints, elog2Fingerprints):
minSize = min(len(elog1Fingerprints), len(elog2Fingerprints)) - 1
minSize = min(len(elog1Fingerprints), len(elog2Fingerprints))
for i in range(0,minSize):
elog1Fingerprint = elog1Fingerprints[i]
elog2Fingerprint = elog2Fingerprints[i]
if elog1Fingerprint[1] != elog2Fingerprint[1]:
return "Diff elog1: " + str(elog1Fingerprint[0]) + " fingerprint = " + elog1Fingerprint[1] + ", elog2: " + str(elog2Fingerprint[0]) + " fingerprint = " + elog2Fingerprint[1]
if len(elog1Fingerprints) > minSize:
elog1Fingerprint = elog1Fingerprints[i]
return "The elog1 fingerprint list longer than elog2, last equals: elog1: " + str(elog1Fingerprint[0]) + " fingerprint = " + elog1Fingerprint[1] + ", elog2: " + str(elog2Fingerprint[0]) + " fingerprint = " + elog2Fingerprint[1]
elif len(elog2Fingerprints) > minSize:
elog2Fingerprint = elog2Fingerprints[i]
return "The elog2 fingerprint list longer than elog1, last equals: elog1: " + str(elog1Fingerprint[0]) + " fingerprint = " + elog1Fingerprint[1] + ", elog2: " + str(elog2Fingerprint[0]) + " fingerprint = " + elog2Fingerprint[1]
return "No differences"


elog1FilePath = sys.argv[1]
elog2FilePath = sys.argv[2]

print(elog1FilePath)
elog1File = open(elog1FilePath)
elog2File = open(elog2FilePath)
uniqueElog1Fingerprints = computeUniqueFingerprints(readFingerprints1(elog1File))
Expand All @@ -62,4 +54,3 @@ print(diffingerprint(uniqueElog1Fingerprints, uniqueElog2Fingerprints))

elog1File.close()
elog2File.close()

3 changes: 2 additions & 1 deletion bin/inet_fingerprinttest
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ writeOutfile = True
useColors = sys.stdout.isatty()

defaultFingerprintCalculator = 'inet::FingerprintCalculator'
defaultExecutable = "inet"

txtPASS = "PASS"
txtPASS_unexpected = "PASS (unexpected)"
Expand Down Expand Up @@ -798,7 +799,7 @@ if __name__ == "__main__":
parser.add_argument('-x', '--exclude', action='append', metavar='regex', help='Negative line filter: a line (more precisely, workingdir+SPACE+args) must NOT match any of the regular expressions in order for that test case to be run')
parser.add_argument('-t', '--threads', type=int, default=defaultNumThreads, help='number of parallel threads (default: number of CPUs, currently '+str(defaultNumThreads)+')')
parser.add_argument('-r', '--repeat', type=int, default=1, help='number of repeating each test (default: 1)')
parser.add_argument('-e', '--executable', default='inet', help='Determines which binary to execute (e.g. opp_run_dbg, opp_run_release) if the command column in the CSV file does not specify one.')
parser.add_argument('-e', '--executable', default=defaultExecutable, help='Determines which binary to execute (e.g. opp_run_dbg, opp_run_release) if the command column in the CSV file does not specify one.')
parser.add_argument('-C', '--directory', help='Change to DIRECTORY before executing the tests. Working dirs in the CSV files are relative to this.')
parser.add_argument('-d', '--debug', action='store_true', help='Run debug executables: use the debug version of the executable (appends _dbg to the executable name)')
parser.add_argument('-s', '--release', action='store_true', help='Run release executables: use the release version of the executable (appends _release to the executable name)')
Expand Down
2 changes: 1 addition & 1 deletion src/inet/common/INETDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ using namespace omnetpp;
# error At least OMNeT++/OMNEST version 6.0 required
#endif

#define INET_VERSION 0x0405
#define INET_VERSION 0x0406
#define INET_PATCH_LEVEL 0x00

#if defined(INET_EXPORT)
Expand Down
9 changes: 9 additions & 0 deletions src/inet/linklayer/ethernet/base/EthernetModes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ const EthernetModes::EthernetMode EthernetModes::ethernetModes[NUM_OF_ETHERNETMO
B(0),
0,
0
},
{
EIGHTHUNDRED_GIGABIT_ETHERNET_TXRATE,
0,
B(0),
B(-1), // half-duplex is not supported
B(0),
0,
0
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/inet/linklayer/ethernet/base/EthernetModes.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class INET_API EthernetModes

protected:
enum {
NUM_OF_ETHERNETMODES = 11
NUM_OF_ETHERNETMODES = 12
};

// MAC constants for bitrates and modes
Expand Down
1 change: 1 addition & 0 deletions src/inet/linklayer/ethernet/common/Ethernet.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const b INTERFRAME_GAP_BITS = b(96);
#define HUNDRED_GIGABIT_ETHERNET_TXRATE 100000000000.0 /* 100 Gbit/sec (in bit/s) */
#define TWOHUNDRED_GIGABIT_ETHERNET_TXRATE 200000000000.0 /* 200 Gbit/sec (in bit/s) */
#define FOURHUNDRED_GIGABIT_ETHERNET_TXRATE 400000000000.0 /* 400 Gbit/sec (in bit/s) */
#define EIGHTHUNDRED_GIGABIT_ETHERNET_TXRATE 800000000000.0 /* 800 Gbit/sec (in bit/s) */

#define MAX_ATTEMPTS 16
#define BACKOFF_RANGE_LIMIT 10
Expand Down
15 changes: 5 additions & 10 deletions tests/fingerprint/gen_runallexamples.pl
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,13 @@
#print "-",join("-\n-",keys(%skiplist)),"-\n";
#die();

$DN = `dirname $0`;
chomp $DN;
#print "DN='$DN'\n";
$PROJECT_ROOT=$ENV{'INET_ROOT'};
chomp $PROJECT_ROOT;
#print "INETROOT='$PROJECT_ROOT'\n";

chdir "$DN/../..";
chdir "$PROJECT_ROOT";

$INETROOT=`pwd`;
chomp $INETROOT;
#print "INETROOT='$INETROOT'\n";


@inifiles = sort `find examples -name '*.ini'`;
@inifiles = sort `find examples -name '*.ini' -type f`;

die("Not found ini files\n") if ($#inifiles lt 0);

Expand Down