Skip to content

Commit

Permalink
First bit of combined testbed file. #1410
Browse files Browse the repository at this point in the history
  • Loading branch information
mfeit-internet2 committed Mar 5, 2024
1 parent 94ecb13 commit dbd3159
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 0 deletions.
33 changes: 33 additions & 0 deletions testbed/Makefile
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) *~
53 changes: 53 additions & 0 deletions testbed/README.md
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
23 changes: 23 additions & 0 deletions testbed/schedules/Makefile
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) *~
29 changes: 29 additions & 0 deletions testbed/schedules/build-schedules
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=(', ', ': ')))
14 changes: 14 additions & 0 deletions testbed/schedules/intervals
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

0 comments on commit dbd3159

Please sign in to comment.