Skip to content
Merged
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
32 changes: 30 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,33 @@ jobs:
with:
distribution: 'temurin'
java-version: '21'
- name: Install
run: cd learner; ./install.sh
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install TCP-Fuzzer
run: ./install.sh

Linux_basic:
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
runs-on: ubuntu-24.04
strategy:
fail-fast: true
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install TCP-Fuzzer
run: ./install.sh
- name: Test Ubuntu 24.04
run: |
./run.sh -alphabet config/basic.xml -output output/ubuntu -eqvQueries 100
./diff_hyps.sh experiments/models/linux-6.17.0_basic output/ubuntu 3
5 changes: 5 additions & 0 deletions config/basic.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<alphabet>
<TCPInput name="S"/>
<TCPInput name="A"/>
<TCPInput name="FA"/>
</alphabet>
File renamed without changes.
10 changes: 7 additions & 3 deletions config/learner_args
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ localhost:18200
-tcpMapperAddress
localhost:18200
-alphabet
${fuzzer.dir}/config/alphabet.xml
-memQueryRuns
3
${fuzzer.dir}/config/full_data.xml
#-memQueryRuns
#3
-command
python3 ${fuzzer.dir}/sutadapter/serverAdapter.py --port 9000
-startWait
50
26 changes: 26 additions & 0 deletions diff_hyps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

dir1=$1
dir2=$2
num_rounds=$3

if [[ $# != 3 ]]; then
echo "Usage: ${0##*/} dir1 dir2 num_rounds"
echo "Diffs the first num_rounds hypotheses stored in two dirs"
exit 1
fi

if [[ ! -d ${dir1} ]]; then
echo "${dir1}"": No such directory"
exit 1
fi
if [[ ! -d ${dir2} ]]; then
echo "${dir2}"": No such directory"
exit 1
fi

for ((i = 1 ; i <= num_rounds ; i++)); do
if ! diff --unified=0 "${dir1}"/hyp"${i}".dot "${dir2}"/hyp"${i}".dot; then
exit 1
fi
done
5 changes: 5 additions & 0 deletions experiments/models/linux-6.17.0_basic/alphabet.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<alphabet>
<TCPInput name="S"/>
<TCPInput name="A"/>
<TCPInput name="FA"/>
</alphabet>
17 changes: 17 additions & 0 deletions experiments/models/linux-6.17.0_basic/command.args
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
state-fuzzer-server
-connect
localhost:18200
-tcpMapperAddress
localhost:18200
-alphabet
${fuzzer.dir}/config/alphabet.xml
#-memQueryRuns
#3
-command
python3 ${fuzzer.dir}/sutadapter/serverAdapter.py --port 9000
-startWait
50
-alphabet
/home/pfg666/GitHub/tools/TCP-Fuzzer/config/basic.xml
-eqvQueries
100
11 changes: 11 additions & 0 deletions experiments/models/linux-6.17.0_basic/hyp1.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
digraph g {

s0 [shape="circle" label="s0"];
s0 -> s0 [label="S / SA"];
s0 -> s0 [label="A / timeout"];
s0 -> s0 [label="FA / timeout"];

__start0 [label="" shape="none" width="0" height="0"];
__start0 -> s0;

}
23 changes: 23 additions & 0 deletions experiments/models/linux-6.17.0_basic/hyp2.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
digraph g {

s0 [shape="circle" label="s0"];
s1 [shape="circle" label="s1"];
s2 [shape="circle" label="s2"];
s3 [shape="circle" label="s3"];
s0 -> s1 [label="S / SA"];
s0 -> s0 [label="A / timeout"];
s0 -> s0 [label="FA / timeout"];
s1 -> s0 [label="S / timeout"];
s1 -> s3 [label="A / timeout"];
s1 -> s2 [label="FA / FA"];
s2 -> s2 [label="S / SOCKET_CLOSED"];
s2 -> s2 [label="A / SOCKET_CLOSED"];
s2 -> s2 [label="FA / SOCKET_CLOSED"];
s3 -> s1 [label="S / A"];
s3 -> s3 [label="A / timeout"];
s3 -> s2 [label="FA / FA"];

__start0 [label="" shape="none" width="0" height="0"];
__start0 -> s0;

}
27 changes: 27 additions & 0 deletions experiments/models/linux-6.17.0_basic/hyp3.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
digraph g {

s0 [shape="circle" label="s0"];
s1 [shape="circle" label="s1"];
s2 [shape="circle" label="s2"];
s3 [shape="circle" label="s3"];
s4 [shape="circle" label="s4"];
s0 -> s1 [label="S / SA"];
s0 -> s0 [label="A / timeout"];
s0 -> s0 [label="FA / timeout"];
s1 -> s0 [label="S / timeout"];
s1 -> s3 [label="A / timeout"];
s1 -> s2 [label="FA / FA"];
s2 -> s2 [label="S / SOCKET_CLOSED"];
s2 -> s2 [label="A / SOCKET_CLOSED"];
s2 -> s2 [label="FA / SOCKET_CLOSED"];
s3 -> s4 [label="S / A"];
s3 -> s3 [label="A / timeout"];
s3 -> s2 [label="FA / FA"];
s4 -> s3 [label="S / timeout"];
s4 -> s3 [label="A / timeout"];
s4 -> s2 [label="FA / FA"];

__start0 [label="" shape="none" width="0" height="0"];
__start0 -> s0;

}
27 changes: 27 additions & 0 deletions experiments/models/linux-6.17.0_basic/learnedModel.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
digraph g {

s0 [shape="circle" label="s0"];
s1 [shape="circle" label="s1"];
s2 [shape="circle" label="s2"];
s3 [shape="circle" label="s3"];
s4 [shape="circle" label="s4"];
s0 -> s1 [label="S / SA"];
s0 -> s0 [label="A / timeout"];
s0 -> s0 [label="FA / timeout"];
s1 -> s0 [label="S / timeout"];
s1 -> s3 [label="A / timeout"];
s1 -> s2 [label="FA / FA"];
s2 -> s2 [label="S / SOCKET_CLOSED"];
s2 -> s2 [label="A / SOCKET_CLOSED"];
s2 -> s2 [label="FA / SOCKET_CLOSED"];
s3 -> s4 [label="S / A"];
s3 -> s3 [label="A / timeout"];
s3 -> s2 [label="FA / FA"];
s4 -> s3 [label="S / timeout"];
s4 -> s3 [label="A / timeout"];
s4 -> s2 [label="FA / FA"];

__start0 [label="" shape="none" width="0" height="0"];
__start0 -> s0;

}
Binary file not shown.
100 changes: 100 additions & 0 deletions experiments/models/linux-6.17.0_basic/statistics.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
=== RUN DESCRIPTION ===
Alphabet: [S, A, FA]

### StateFuzzerConfigStandard Parameters
# -help
# -debug
# -quiet
-output
output/o_2026-04-30_12-16-06

### LearnerConfigStandard Parameters
-alphabet
/home/pfg666/GitHub/tools/TCP-Fuzzer/config/basic.xml
-learningAlgorithm
TTT
-equivalenceAlgorithms
RANDOM_WP_METHOD
-depth
1
-minLength
5
-maxLength
15
-randLength
5
-eqvQueries
100
-memQueryRuns
1
-memQueryRetries
3
# -logQueries
-probReset
0.0
# -testFile
-seed
0
# -cacheTests
# -ceSanitizationDisable
# -skipNonDetTests
-ceReruns
3
# -probabilisticSanitizationDisable
# -timeLimit
# -testLimit
# -roundLimit
-eqvThreads
1

### SULConfigStandard Parameters
-responseWait
100
# -inputResponseTimeout
-command
python3 /home/pfg666/GitHub/tools/TCP-Fuzzer/sutadapter/serverAdapter.py --port 9000
# -terminateCommand
# -processDir
# -redirectOutputStreams
-processTrigger
NEW_TEST
-startWait
50

### SULServerConfigStandard Parameters
-connect
localhost:18200

### MapperConfigStandard Parameters
# -mapperConnectionConfig
# -repeatingOutputs
# -socketClosedAsTimeout
# -disabledAsTimeout
# -dontMergeRepeating

### SULAdapterConfigStandard Parameters
# -adapterPort
-adapterAddress
localhost

=== STATISTICS ===
Learning finished: true
Size of the input alphabet: 3
Number of states: 5
Number of hypotheses: 3
Number of inputs: 1120
Number of tests: 109
Number of learning inputs: 89
Number of learning tests: 27
Number of inputs up to last hypothesis: 239
Number of tests up to last hypothesis: 41
Time (ms) to learn model: 302925
Counterexamples:
CE 1:Query[ε|A A FA FA FA S FA FA S A FA / timeout timeout timeout timeout timeout SA FA SOCKET_CLOSED SOCKET_CLOSED SOCKET_CLOSED SOCKET_CLOSED]
CE 2:Query[ε|S A A S S A A FA S FA S S / SA timeout timeout A timeout timeout timeout FA SOCKET_CLOSED SOCKET_CLOSED SOCKET_CLOSED SOCKET_CLOSED]
Number of inputs when hypothesis was generated: [3, 95, 239]
Number of tests when hypothesis was generated: [3, 23, 41]
Time (ms) when hypothesis was generated: [2799, 43975, 95216]
Number of inputs when counterexample was found: [47, 201]
Number of tests when counterexample was found: [7, 33]
Time (ms) when counterexample was found: [16834, 74894]
16 changes: 8 additions & 8 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,27 @@ function install_learner() {

if [[ $? -ne 0 ]]; then
echo "Failed to install Learner"
exit
exit 1
else
echo "Learner installed successfully"
fi
}

function install_mapper_env() {
echo "Installing Mapper environment"
function install_mapper() {
echo "Installing Mapper"
(
cd ${MAPPER_DIR};
./install_env.sh
./install.sh
)
if [[ $? -ne 0 ]]; then
echo "Failed to install Mapper environment"
exit
echo "Failed to install Mapper"
exit 1
else
echo "Mapper environment installed successfully"
echo "Mapper installed successfully"
fi
}

# Installing learner and mapper components
install_learner
install_mapper_env
install_mapper

8 changes: 7 additions & 1 deletion mapper/install_env.sh → mapper/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ MAPPER_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && p
readonly MAPPER_SCRIPT_DIR
readonly ENV_DIR=${MAPPER_SCRIPT_DIR}/.venv

# Installing dependencies
echo "Installing dependencies where necessary."
sudo apt-get update
sudo apt-get install -y libpcap-dev tcpdump || (echo "Failed to install libraries"; exit 1)

if [[ -d ${ENV_DIR} ]]
then
echo "Detected Python virtual environment. Skipping Python environment creation."
Expand All @@ -10,7 +15,8 @@ else
python3 -m venv $ENV_DIR
source $ENV_DIR/bin/activate
echo "Installing required libraries"
pip install -r requirements.txt
pip install --upgrade pip
pip install -r ${MAPPER_SCRIPT_DIR}/requirements.txt || (echo "Fail to install required Python packages"; exit 1)
fi

# If the script is being sourced, activate the environment
Expand Down
Loading
Loading