Skip to content

Commit

Permalink
tests: add or_slot flexible tests
Browse files Browse the repository at this point in the history
Problem: there are no tests for or_slots

Add tests
  • Loading branch information
zekemorton committed Sep 17, 2024
1 parent fdfd8e6 commit 1ea9d1a
Show file tree
Hide file tree
Showing 22 changed files with 702 additions and 0 deletions.
1 change: 1 addition & 0 deletions t/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ set(ALL_TESTS
t3034-resource-pconstraints.t
t3035-resource-remove.t
t3036-rq2.t
t3037-resource-flexible.t
t3300-system-dontblock.t
t3301-system-latestart.t
t4000-match-params.t
Expand Down
10 changes: 10 additions & 0 deletions t/data/resource/commands/flexible/cmds01.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
match allocate @TEST_SRCDIR@/data/resource/jobspecs/flexible/test001.yaml
match allocate @TEST_SRCDIR@/data/resource/jobspecs/flexible/test001.yaml
match allocate @TEST_SRCDIR@/data/resource/jobspecs/flexible/test001.yaml
match allocate @TEST_SRCDIR@/data/resource/jobspecs/flexible/test001.yaml
match allocate @TEST_SRCDIR@/data/resource/jobspecs/flexible/test001.yaml
match allocate @TEST_SRCDIR@/data/resource/jobspecs/flexible/test001.yaml
match allocate @TEST_SRCDIR@/data/resource/jobspecs/flexible/test001.yaml
match allocate @TEST_SRCDIR@/data/resource/jobspecs/flexible/test001.yaml
match allocate @TEST_SRCDIR@/data/resource/jobspecs/flexible/test001.yaml
quit
6 changes: 6 additions & 0 deletions t/data/resource/commands/flexible/cmds02.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
match allocate @TEST_SRCDIR@/data/resource/jobspecs/flexible/test002.yaml
match allocate @TEST_SRCDIR@/data/resource/jobspecs/flexible/test002.yaml
match allocate @TEST_SRCDIR@/data/resource/jobspecs/flexible/test002.yaml
match allocate @TEST_SRCDIR@/data/resource/jobspecs/flexible/test002.yaml
match allocate @TEST_SRCDIR@/data/resource/jobspecs/flexible/test002.yaml
quit
152 changes: 152 additions & 0 deletions t/data/resource/expected/flexible/001.R.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
---------------core28[1:x]
---------------core29[1:x]
---------------core30[1:x]
---------------core31[1:x]
---------------core32[1:x]
---------------core33[1:x]
---------------core34[1:x]
---------------core35[1:x]
---------------gpu1[1:x]
------------socket1[1:s]
---------node1[1:s]
------rack0[1:s]
---tiny0[1:s]
INFO: =============================
INFO: JOBID=1
INFO: RESOURCES=ALLOCATED
INFO: SCHEDULED AT=Now
INFO: =============================
---------------core18[1:x]
---------------core19[1:x]
---------------core20[1:x]
---------------core21[1:x]
---------------core22[1:x]
---------------core23[1:x]
---------------core24[1:x]
---------------core25[1:x]
---------------core26[1:x]
---------------core27[1:x]
------------socket1[1:s]
---------node1[1:s]
------rack0[1:s]
---tiny0[1:s]
INFO: =============================
INFO: JOBID=2
INFO: RESOURCES=ALLOCATED
INFO: SCHEDULED AT=Now
INFO: =============================
---------------core10[1:x]
---------------core11[1:x]
---------------core12[1:x]
---------------core13[1:x]
---------------core14[1:x]
---------------core15[1:x]
---------------core16[1:x]
---------------core17[1:x]
---------------gpu0[1:x]
------------socket0[1:s]
---------node1[1:s]
------rack0[1:s]
---tiny0[1:s]
INFO: =============================
INFO: JOBID=3
INFO: RESOURCES=ALLOCATED
INFO: SCHEDULED AT=Now
INFO: =============================
---------------core0[1:x]
---------------core1[1:x]
---------------core2[1:x]
---------------core3[1:x]
---------------core4[1:x]
---------------core5[1:x]
---------------core6[1:x]
---------------core7[1:x]
---------------core8[1:x]
---------------core9[1:x]
------------socket0[1:s]
---------node1[1:s]
------rack0[1:s]
---tiny0[1:s]
INFO: =============================
INFO: JOBID=4
INFO: RESOURCES=ALLOCATED
INFO: SCHEDULED AT=Now
INFO: =============================
---------------core28[1:x]
---------------core29[1:x]
---------------core30[1:x]
---------------core31[1:x]
---------------core32[1:x]
---------------core33[1:x]
---------------core34[1:x]
---------------core35[1:x]
---------------gpu1[1:x]
------------socket1[1:s]
---------node0[1:s]
------rack0[1:s]
---tiny0[1:s]
INFO: =============================
INFO: JOBID=5
INFO: RESOURCES=ALLOCATED
INFO: SCHEDULED AT=Now
INFO: =============================
---------------core18[1:x]
---------------core19[1:x]
---------------core20[1:x]
---------------core21[1:x]
---------------core22[1:x]
---------------core23[1:x]
---------------core24[1:x]
---------------core25[1:x]
---------------core26[1:x]
---------------core27[1:x]
------------socket1[1:s]
---------node0[1:s]
------rack0[1:s]
---tiny0[1:s]
INFO: =============================
INFO: JOBID=6
INFO: RESOURCES=ALLOCATED
INFO: SCHEDULED AT=Now
INFO: =============================
---------------core10[1:x]
---------------core11[1:x]
---------------core12[1:x]
---------------core13[1:x]
---------------core14[1:x]
---------------core15[1:x]
---------------core16[1:x]
---------------core17[1:x]
---------------gpu0[1:x]
------------socket0[1:s]
---------node0[1:s]
------rack0[1:s]
---tiny0[1:s]
INFO: =============================
INFO: JOBID=7
INFO: RESOURCES=ALLOCATED
INFO: SCHEDULED AT=Now
INFO: =============================
---------------core0[1:x]
---------------core1[1:x]
---------------core2[1:x]
---------------core3[1:x]
---------------core4[1:x]
---------------core5[1:x]
---------------core6[1:x]
---------------core7[1:x]
---------------core8[1:x]
---------------core9[1:x]
------------socket0[1:s]
---------node0[1:s]
------rack0[1:s]
---tiny0[1:s]
INFO: =============================
INFO: JOBID=8
INFO: RESOURCES=ALLOCATED
INFO: SCHEDULED AT=Now
INFO: =============================
INFO: =============================
INFO: No matching resources found
INFO: JOBID=9
INFO: =============================
76 changes: 76 additions & 0 deletions t/data/resource/expected/flexible/002.R.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---------------core28[1:x]
---------------core29[1:x]
---------------core30[1:x]
---------------core31[1:x]
---------------core32[1:x]
---------------core33[1:x]
---------------core34[1:x]
---------------core35[1:x]
---------------gpu1[1:x]
------------socket1[1:s]
---------node1[1:s]
------rack0[1:s]
---tiny0[1:s]
INFO: =============================
INFO: JOBID=1
INFO: RESOURCES=ALLOCATED
INFO: SCHEDULED AT=Now
INFO: =============================
---------------core10[1:x]
---------------core11[1:x]
---------------core12[1:x]
---------------core13[1:x]
---------------core14[1:x]
---------------core15[1:x]
---------------core16[1:x]
---------------core17[1:x]
---------------gpu0[1:x]
------------socket0[1:s]
---------node1[1:s]
------rack0[1:s]
---tiny0[1:s]
INFO: =============================
INFO: JOBID=2
INFO: RESOURCES=ALLOCATED
INFO: SCHEDULED AT=Now
INFO: =============================
---------------core28[1:x]
---------------core29[1:x]
---------------core30[1:x]
---------------core31[1:x]
---------------core32[1:x]
---------------core33[1:x]
---------------core34[1:x]
---------------core35[1:x]
---------------gpu1[1:x]
------------socket1[1:s]
---------node0[1:s]
------rack0[1:s]
---tiny0[1:s]
INFO: =============================
INFO: JOBID=3
INFO: RESOURCES=ALLOCATED
INFO: SCHEDULED AT=Now
INFO: =============================
---------------core10[1:x]
---------------core11[1:x]
---------------core12[1:x]
---------------core13[1:x]
---------------core14[1:x]
---------------core15[1:x]
---------------core16[1:x]
---------------core17[1:x]
---------------gpu0[1:x]
------------socket0[1:s]
---------node0[1:s]
------rack0[1:s]
---tiny0[1:s]
INFO: =============================
INFO: JOBID=4
INFO: RESOURCES=ALLOCATED
INFO: SCHEDULED AT=Now
INFO: =============================
INFO: =============================
INFO: No matching resources found
INFO: JOBID=5
INFO: =============================
30 changes: 30 additions & 0 deletions t/data/resource/jobspecs/flexible/bad.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 9999
resources:
- type: cluster
` count: 1
with:
- type: rack
count: 1
with:
- type: node
count: 1
with:
- type: slot
count: 1
label: default
with:
- type: socket
count: 1
with:
- type: core
count: 1
# a comment
attributes:
system:
duration: 3600
tasks:
- command: [ "app" ]
slot: default
count:
per_slot: 1

38 changes: 38 additions & 0 deletions t/data/resource/jobspecs/flexible/test001.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
version: 9999
resources:
- type: cluster
count: 1
with:
- type: rack
count: 1
with:
- type: node
count: 1
with:
- type: socket
count: 1
with:
- type: or_slot
count: 1
label: small
with:
- type: core
count: 8
- type: gpu
count: 1
- type: or_slot
count: 1
label: big
with:
- type: core
count: 10
# a comment
attributes:
system:
duration: 3600
tasks:
- command: [ "app" ]
slot: default
count:
per_slot: 1

37 changes: 37 additions & 0 deletions t/data/resource/jobspecs/flexible/test002.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: 9999
resources:
- type: cluster
count: 1
with:
- type: rack
count: 1
with:
- type: node
count: 1
with:
- type: socket
count: 1
with:
- type: or_slot
count: 1
label: small
with:
- type: core
count: 8
- type: gpu
count: 1
- type: or_slot
count: 1
label: big
with:
- type: core
count: 36
# a comment
attributes:
system:
duration: 3600
tasks:
- command: [ "app" ]
slot: default
count:
per_slot: 1
28 changes: 28 additions & 0 deletions t/data/resource/jobspecs/flexible/test003.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: 9999
resources:
- type: slot
count: 2
label: default
with:
- type: node
count: 1
with:
- type: socket
count: 2
with:
- type: core
count: 5
- type: gpu
count: 1
- type: memory
count: 6

# a comment
attributes:
system:
duration: 3600
tasks:
- command: [ "app" ]
slot: default
count:
per_slot: 1
Loading

0 comments on commit 1ea9d1a

Please sign in to comment.