-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First bit of combined testbed file. #1410
- Loading branch information
1 parent
94ecb13
commit dbd3159
Showing
5 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# | ||
# Makefile for Testbed | ||
# | ||
|
||
PRODUCT := testbed.json | ||
|
||
# Each subdirectory's Makefile produces a file called "output.json" | ||
SUBDIRS := \ | ||
schedules | ||
|
||
|
||
default: build | ||
|
||
$(PRODUCT): Makefile | ||
@for SUBDIR in $(SUBDIRS) ; \ | ||
do \ | ||
printf "\n#\n# Building $$SUBDIR\n#\n\n" ; \ | ||
$(MAKE) -C "$${SUBDIR}" ; \ | ||
done | ||
printf "\n#\n# Merging results\n#\n\n" | ||
jq -s add $(SUBDIRS:%=%/output.json) > "$@" | ||
TO_CLEAN += $(PRODUCT) | ||
|
||
|
||
build: $(PRODUCT) | ||
|
||
|
||
clean: | ||
@for SUBDIR in $(SUBDIRS) ; \ | ||
do \ | ||
$(MAKE) -C "$${SUBDIR}" "$@" ; \ | ||
done | ||
rm -rf $(TO_CLEAN) *~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# pScheduler Test Bed Configuration | ||
|
||
Scattered throughout the sources for the pScheduler plugins are files named `psconfig-testbed`. | ||
|
||
|
||
|
||
# Tes | ||
|
||
``` | ||
{ | ||
"_meta": { | ||
}, | ||
"addresses": {}, | ||
"archives": { | ||
}, | ||
"groups": { | ||
}, | ||
"schedules": { | ||
"PT5M" { | ||
"repeat": "PT5M", | ||
"slip": "PT2M30S", | ||
"sliprand": true | ||
} | ||
}, | ||
"tasks": { | ||
}, | ||
"tests": { | ||
} | ||
} | ||
## Naming | ||
Anything added by a plugin package should be prefixed with its name, | ||
e.g. `pscheduler-tool-iperf3-udp`. | ||
## Schedules | ||
Standard schedules are available | ||
* `PT30S` | ||
* `PT1M` | ||
* `PT5M` | ||
* `PT10M` | ||
* `PT15M` | ||
* `PT30M` | ||
* `PT1H` | ||
* `PT4H` | ||
* `PT6H` | ||
* `PT12H` | ||
* `P1D` | ||
A plugin may define its own schedules | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# Makefile for Testbed Schedules | ||
# | ||
|
||
PRODUCT := output.json | ||
|
||
INTERVALS := intervals | ||
|
||
|
||
default: build | ||
|
||
|
||
BUILDER := ./build-schedules | ||
$(PRODUCT): Makefile $(BUILDER) $(INTERVALS) | ||
$(BUILDER) $(BUILDER_ARGS) < $(INTERVALS) > "$@" | ||
TO_CLEAN += $(PRODUCT) | ||
|
||
|
||
build: $(PRODUCT) | ||
|
||
|
||
clean: | ||
rm -rf $(TO_CLEAN) *~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Generate pSConfig schedules for all ISO 8601 durations listed on stdin | ||
|
||
import isodate | ||
import json | ||
import re | ||
import sys | ||
|
||
schedules = {} | ||
|
||
for line in sys.stdin: | ||
# TODO: Chop comments and extra whitespace | ||
duration = re.sub(r'\s*[#].*$', '', line[:-1]) | ||
if not duration: | ||
continue | ||
schedules[duration] = { | ||
'repeat': duration, | ||
'slip': isodate.duration_isoformat( | ||
isodate.parse_duration(duration) / 2 | ||
), | ||
'sliprand': True | ||
} | ||
|
||
print(json.dumps( | ||
{ 'schedules': schedules }, | ||
sort_keys=True, | ||
indent=4, | ||
separators=(', ', ': '))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# | ||
# Standard testbed test durations | ||
# | ||
PT30S | ||
PT1M | ||
PT5M | ||
PT10M | ||
PT15M | ||
PT30M | ||
PT1H | ||
PT4H | ||
PT6H | ||
PT12H | ||
P1D |