Skip to content

Commit

Permalink
merge: final-touch-pr into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinicius Guimaraes committed Sep 19, 2022
2 parents 31e9e06 + ae7a872 commit c3a61f8
Show file tree
Hide file tree
Showing 44 changed files with 275 additions and 177 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
name: Build

on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
branches:
- 'main'
Expand All @@ -49,15 +46,8 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- go: 1.13
os: ubuntu-20.04
- go: 1.14
os: ubuntu-20.04
- go: 1.15
os: ubuntu-20.04
- go: 1.13
os: macos-10.15
go: [ 1.17, 1.18 ]
os: [ ubuntu-20.04, macos-11 ]
steps:
- uses: actions/setup-go@v1
with:
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
name: Develop

on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
branches:
- 'main'
Expand All @@ -44,16 +41,16 @@ jobs:
if: "github.ref != 'refs/heads/main'"

develop:
name: Develop (Go${{ matrix.go }},Py${{matrix.python-version}},${{ matrix.os }})
name: Develop (Go${{ matrix.go }},${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
HOMEBREW_NO_AUTO_UPDATE: 1
strategy:
fail-fast: false
matrix:
go: [1.13, 1.15]
python-version: [3.6, 3.8]
os: [ubuntu-20.04, macos-10.15]
go: [1.17, 1.18]
python-version: [3.7]
os: [ubuntu-20.04]
steps:
- uses: actions/setup-go@v1
with:
Expand All @@ -64,6 +61,6 @@ jobs:
- uses: actions/checkout@v2
- name: Build
run: |
./script/setup-dev
./script/pack-web
go get ./cmd/otns
docker build -t otns-env -f etc/docker/environment/Dockerfile .
docker run -t -v$PWD:/otns otns-env -c "./script/pack-web"
git diff --quiet
17 changes: 10 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
name: Docker

on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
branches:
- 'main'
Expand All @@ -43,9 +40,15 @@ jobs:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "github.ref != 'refs/heads/main'"

buildx-playground:
name: buildx-playground
buildx:
name: buildx-${{ matrix.version }}
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
version:
- "environment"
- "playground"
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
Expand All @@ -54,9 +57,9 @@ jobs:
id: prepare
run: |
DOCKER_IMAGE=openthread/otns
DOCKER_FILE=etc/docker/playground/Dockerfile
DOCKER_FILE=etc/docker/${{ matrix.version }}/Dockerfile
DOCKER_PLATFORMS=linux/amd64
VERSION=playground
VERSION=${{ matrix.version }}
TAGS="--tag ${DOCKER_IMAGE}:${VERSION}"
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
name: Lint

on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
branches:
- 'main'
Expand All @@ -51,7 +48,7 @@ jobs:
steps:
- uses: actions/setup-go@v1
with:
go-version: 1.14
go-version: 1.18
- uses: actions/checkout@v2
- name: Check pretty
run: |
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/stress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
name: Stress

on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
branches:
- 'main'
Expand All @@ -48,18 +45,17 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
go-version: [1.14]
python-version: [3.7]
go-version: [1.18]
suite: ["network-forming", "commissioning", "connectivity", "network-latency", "multicast-performance", "otns-performance", "network-limits"]
runs-on: ubuntu-20.04
env:
HOMEBREW_NO_AUTO_UPDATE: 1
VIRTUAL_TIME_UART: 1
steps:
- uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
Expand Down
42 changes: 16 additions & 26 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
name: Test

on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
branches:
- 'main'
Expand All @@ -49,14 +46,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-10.15]
os: [ubuntu-20.04, macos-11]
env:
VIRTUAL_TIME_UART: 1
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
- uses: actions/setup-go@v1
with:
go-version: 1.13
go-version: 1.18
- uses: actions/checkout@v2
- name: Test
run: |
Expand All @@ -65,22 +61,20 @@ jobs:
uses: codecov/codecov-action@v1

py-unittests:
name: Unittests (Py${{ matrix.python-version }}, ${{ matrix.os }}, VIRTUAL_TIME_UART=${{ matrix.VIRTUAL_TIME_UART }})
name: Unittests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.6]
os: [ubuntu-20.04, macos-10.15]
VIRTUAL_TIME_UART: [0, 1]
python-version: [3.7]
os: [ubuntu-20.04, macos-11]
env:
VIRTUAL_TIME_UART: ${{ matrix.VIRTUAL_TIME_UART }}
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
- uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Set up Python ${{ matrix.python-version }}
go-version: 1.18
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -90,22 +84,20 @@ jobs:
./script/test py-unittests
py-examples:
name: Examples (Py${{ matrix.python-version }}, ${{ matrix.os }}, VIRTUAL_TIME_UART=${{ matrix.VIRTUAL_TIME_UART }})
name: Examples (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.6]
os: [ubuntu-20.04, macos-10.15]
VIRTUAL_TIME_UART: [0, 1]
python-version: [3.7]
os: [ubuntu-20.04, macos-11]
env:
VIRTUAL_TIME_UART: ${{ matrix.VIRTUAL_TIME_UART }}
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
- uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Set up Python ${{ matrix.python-version }}
go-version: 1.18
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -115,21 +107,19 @@ jobs:
./script/test py-examples
signals:
name: Signals (Py${{ matrix.python-version }}, ${{ matrix.os }}, VIRTUAL_TIME_UART=${{ matrix.VIRTUAL_TIME_UART }})
name: Signals (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.6]
os: [ubuntu-20.04, macos-10.15]
VIRTUAL_TIME_UART: [0, 1]
python-version: [3.7]
os: [ubuntu-20.04, macos-11]
env:
VIRTUAL_TIME_UART: ${{ matrix.VIRTUAL_TIME_UART }}
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
- uses: actions/setup-go@v1
with:
go-version: 1.13
go-version: 1.18
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Install Go

OTNS requires [Go 1.13+](https://golang.org/dl/) to build:
OTNS requires [Go 1.17+](https://golang.org/dl/) to build:

- Install Go from https://golang.org/dl/
- Add `$(go env GOPATH)/bin` (normally `$HOME/go/bin`) to `$PATH`.
Expand Down
2 changes: 1 addition & 1 deletion cli/CmdRunner.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020, The OTNS Authors.
// Copyright (c) 2022, The OTNS Authors.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion cli/ast.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020, The OTNS Authors.
// Copyright (c) 2022, The OTNS Authors.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion cmd/otns-replay/grpc_service.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020, The OTNS Authors.
// Copyright (c) 2022, The OTNS Authors.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion cmd/otns-replay/otns_replay.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020, The OTNS Authors.
// Copyright (c) 2022, The OTNS Authors.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down
12 changes: 4 additions & 8 deletions dispatcher/Node.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020, The OTNS Authors.
// Copyright (c) 2022, The OTNS Authors.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -79,8 +79,8 @@ type Node struct {
RadioState RadioStates
RadioChannel uint8
radioLockState bool
isInvalidReception []bool
rxBusyUntil []uint64
isInvalidReception []bool
isWaitingAck bool
waitAckSN uint8

Expand Down Expand Up @@ -113,7 +113,7 @@ func newNode(d *Dispatcher, nodeid NodeId, x, y int, radioRange int) *Node {
joinerState: OtJoinerStateIdle,
RadioChannel: minChannel,
radioLockState: false,
isInvalidReception: make([]bool, maxChannel-minChannel+1), // 1 for each channel (11-26)
isInvalidReception: make([]bool, maxChannel-minChannel+1), // one for each channel (11-26)
rxBusyUntil: make([]uint64, maxChannel-minChannel+1),
isWaitingAck: false,
}
Expand All @@ -130,11 +130,7 @@ func (node *Node) String() string {
func (node *Node) Send(elapsed uint64, data []byte) {
msg := make([]byte, len(data)+11)
binary.LittleEndian.PutUint64(msg[:8], elapsed)
if node.D.IsCollisionAware {
msg[8] = eventTypeRadioComm
} else {
msg[8] = eventTypeRadioReceived
}
msg[8] = eventTypeRadioComm

binary.LittleEndian.PutUint16(msg[9:11], uint16(len(data)))
n := copy(msg[11:], data)
Expand Down
Loading

0 comments on commit c3a61f8

Please sign in to comment.