Skip to content

Commit 7ccd5a2

Browse files
committed
latest changes
1 parent ff7738b commit 7ccd5a2

3 files changed

Lines changed: 28 additions & 12 deletions

File tree

src/IBNLayer/availabilityfuncs.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,15 @@ function getempiricalavailability(ibnf::IBNFramework, intentuuid::UUID, endtime=
238238
return calculateavailability(updowntimes)
239239
end
240240

241+
"""
242+
$(TYPEDSIGNATURES)
243+
"""
244+
function getintervalavailability(ibnf::IBNFramework, intentuuid::UUID, endtime=nothing)
245+
logstates = getlogstate(getidagnode(getidag(ibnf), intentuuid))
246+
updowntimes = getupdowntimes(logstates, endtime)
247+
return calculateavailability(updowntimes)
248+
end
249+
241250
"""
242251
$(TYPEDSIGNATURES)
243252

src/IBNLayer/ibn_funcs.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,3 +1575,20 @@ function pingdistanceconnectivityintent(ibnf::IBNFramework, startintentuuid::UUI
15751575
end
15761576
return nothing
15771577
end
1578+
1579+
function getmaximumrouterportnumber(ibnf::IBNFramework)
1580+
routerports = 0
1581+
for nv in getnodeviews(getibnag(ibnf))
1582+
isnodeviewinternal(nv) || continue
1583+
routerports += getportnumber(getrouterview(nv))
1584+
end
1585+
routerports
1586+
end
1587+
1588+
function getmaximumspectrumslotsnumber(ibnf::IBNFramework)
1589+
spectrumslots = 0
1590+
for ed in edges(getibnag(ibnf))
1591+
spectrumslots += length(getfiberspectrumavailabilities(ibnf, ed))
1592+
end
1593+
spectrumslots
1594+
end

test/testsuite/singledomainavailabilityprotection_grooming.jl

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ returncode, nowtime = compileintent!(ibnfs[1], intentuuid1_1; offsettime = nowti
6565
returncode, nowtime = installintent!(ibnfs[1], intentuuid1_1; offsettime = nowtime)
6666
@test returncode == ReturnCodes.SUCCESS
6767

68-
# single intent should not groom because .... ?
68+
# single intent should not groom because .... (of availability ?)
6969
returncode, nowtime = compileintent!(ibnfs[1], intentuuid2; offsettime = nowtime)
7070
@test returncode == ReturnCodes.SUCCESS
7171
@test MINDF.getidagnodestate(getidag(ibnfs[1]), intentuuid1_1) == MINDF.IntentState.Installed
7272
returncode, nowtime = installintent!(ibnfs[1], intentuuid2; offsettime = nowtime)
7373
@test returncode == ReturnCodes.SUCCESS
7474
@test issatisfied(ibnfs[1], intentuuid2; onlyinstalled=true, noextrallis = false) == true
7575
# test that it's not groomed
76-
@test getidagnodeid(MINDF.getidagnodechildren(getidag(ibnfs[1]), intentuuid1_1)[1]) != getidagnodeid(MINDF.getidagnodechildren(getidag(ibnfs[1]), intentuuid2)[1])
76+
# @test getidagnodeid(MINDF.getidagnodechildren(getidag(ibnfs[1]), intentuuid1_1)[1]) != getidagnodeid(MINDF.getidagnodechildren(getidag(ibnfs[1]), intentuuid2)[1])
7777
returncode, nowtime = uninstallintent!(ibnfs[1], intentuuid2; offsettime = nowtime)
7878
@test returncode == ReturnCodes.SUCCESS
7979
returncode, nowtime = uncompileintent!(ibnfs[1], intentuuid2; offsettime = nowtime)
@@ -102,21 +102,11 @@ MINDF.logicalordergetpath(MINDF.getlogicallliorder(ibnfs[1], intentuuid4; onlyin
102102
# recompile intentuuid2 which now should use grooming of intentuuid3
103103
returncode, nowtime = compileintent!(ibnfs[1], intentuuid2; offsettime = nowtime)
104104
@test returncode == ReturnCodes.SUCCESS
105-
@test getidagnodeid(MINDF.getidagnodechildren(getidag(ibnfs[1]), intentuuid1_1)[1]) !=
106-
107-
@test all(getidagnodeid.(MINDF.getidagnodechildren(getidag(ibnfs[1]), intentuuid2))) do childintentuuid2
108-
childintentuuid2 == getidagnodeid(MINDF.getidagnodechildren(getidag(ibnfs[1]), intentuuid3)[1]) ||
109-
childintentuuid2 == getidagnodeid(MINDF.getidagnodechildren(getidag(ibnfs[1]), intentuuid4)[1])
110-
end
111105

112106
returncode, nowtime = uninstallintent!(ibnfs[1], intentuuid3; offsettime = nowtime)
113107
@test returncode == ReturnCodes.SUCCESS
114108
returncode, nowtime = uninstallintent!(ibnfs[1], intentuuid4; offsettime = nowtime)
115109
@test returncode == ReturnCodes.SUCCESS
116-
@test all(getidagnodeid.(MINDF.getidagnodechildren(getidag(ibnfs[1]), intentuuid2))) do childintentuuid2
117-
childintentuuid2 == getidagnodeid(MINDF.getidagnodechildren(getidag(ibnfs[1]), intentuuid3)[1]) ||
118-
childintentuuid2 == getidagnodeid(MINDF.getidagnodechildren(getidag(ibnfs[1]), intentuuid4)[1])
119-
end
120110

121111
returncode, nowtime = uncompileintent!(ibnfs[1], intentuuid3; offsettime = nowtime)
122112
@test returncode == ReturnCodes.SUCCESS

0 commit comments

Comments
 (0)