diff options
author | onefang | 2019-11-05 00:09:10 +1000 |
---|---|---|
committer | onefang | 2019-11-05 00:09:10 +1000 |
commit | 03b0b5288022bd24a13f431de21d321a7483001c (patch) | |
tree | 22464f79915a56ae8cae696d44f5b332712acfd7 | |
parent | Gather the IPs and stuff them into mirrors.lua before forking. (diff) | |
download | apt-panopticon-03b0b5288022bd24a13f431de21d321a7483001c.zip apt-panopticon-03b0b5288022bd24a13f431de21d321a7483001c.tar.gz apt-panopticon-03b0b5288022bd24a13f431de21d321a7483001c.tar.bz2 apt-panopticon-03b0b5288022bd24a13f431de21d321a7483001c.tar.xz |
Add the round robin stuff to the mirrors.lua, and jiggle the code that loops through mirrors.
Diffstat (limited to '')
-rw-r--r-- | README.md | 8 | ||||
-rwxr-xr-x | mirror-checker.lua | 13 |
2 files changed, 11 insertions, 10 deletions
@@ -195,12 +195,10 @@ table. Add the round robin domain name. Resolve all the IPs and add | |||
195 | them to this table. Write this table to results/mirrors.lua so that the | 195 | them to this table. Write this table to results/mirrors.lua so that the |
196 | forked tests can read it. | 196 | forked tests can read it. |
197 | 197 | ||
198 | Remove the mirror site from the mirrors table, then checkHost() it | 198 | checkHost() the referenece site first. |
199 | first. | ||
200 | 199 | ||
201 | checkHost() deb.devuan.org, the DNS RR. | 200 | Loop through the mirrors table, and checkHost() each one, skipping the |
202 | 201 | reference site. | |
203 | Loop through the mirrors table, and checkHost() each one. | ||
204 | 202 | ||
205 | Wait for all forked tests to finish. | 203 | Wait for all forked tests to finish. |
206 | 204 | ||
diff --git a/mirror-checker.lua b/mirror-checker.lua index 6580190..3da8bc6 100755 --- a/mirror-checker.lua +++ b/mirror-checker.lua | |||
@@ -443,6 +443,9 @@ local getMirrors = function () | |||
443 | mirrors[host] = m | 443 | mirrors[host] = m |
444 | end | 444 | end |
445 | end | 445 | end |
446 | mirrors[options.roundRobin.value] = { ["Protocols"] = { ["http"] = true; ["https"] = true; }; ["FQDN"] = 'deb.devuan.org'; ["Active"] = 'yes'; ["BaseURL"] = 'deb.devuan.org'; } | ||
447 | gatherIPs(options.roundRobin.value) | ||
448 | mirrors[options.roundRobin.value].IPs = IP[options.roundRobin.value] | ||
446 | local file, e = io.open("results/mirrors.lua", "w+") | 449 | local file, e = io.open("results/mirrors.lua", "w+") |
447 | if nil == file then C("opening mirrors file - " .. e) else | 450 | if nil == file then C("opening mirrors file - " .. e) else |
448 | file:write(dumpTable(mirrors, "", "mirrors") .. "\nreturn mirrors\n") | 451 | file:write(dumpTable(mirrors, "", "mirrors") .. "\nreturn mirrors\n") |
@@ -575,9 +578,7 @@ else | |||
575 | I("Starting tests " .. table.concat(options.tests.value, ", ")) | 578 | I("Starting tests " .. table.concat(options.tests.value, ", ")) |
576 | execute("mkdir -p results") | 579 | execute("mkdir -p results") |
577 | mirrors = getMirrors() | 580 | mirrors = getMirrors() |
578 | mirrors[options.referenceSite.value] = nil | ||
579 | checkHost(options.referenceSite.value) | 581 | checkHost(options.referenceSite.value) |
580 | checkHost("deb.devuan.org") | ||
581 | for k, m in pairs(mirrors) do | 582 | for k, m in pairs(mirrors) do |
582 | if "/" == m.BaseURL:sub(-1, -1) then | 583 | if "/" == m.BaseURL:sub(-1, -1) then |
583 | W("slash at end of BaseURL in mirror_list.txt! " .. m.BaseURL) | 584 | W("slash at end of BaseURL in mirror_list.txt! " .. m.BaseURL) |
@@ -588,9 +589,11 @@ else | |||
588 | m.BaseURL = m.BaseURL:sub(1, -2) | 589 | m.BaseURL = m.BaseURL:sub(1, -2) |
589 | end | 590 | end |
590 | local pu = url.parse("http://" .. m.BaseURL) | 591 | local pu = url.parse("http://" .. m.BaseURL) |
591 | checkHost(m.BaseURL) | 592 | if options.referenceSite.value ~= pu.host then |
592 | checkExes("mirror-checker.lua " .. sendArgs) | 593 | checkHost(m.BaseURL) |
593 | if testing("Integrity") or testing("Updated") then checkExes(downloadLock) end | 594 | checkExes("mirror-checker.lua " .. sendArgs) |
595 | if testing("Integrity") or testing("Updated") then checkExes(downloadLock) end | ||
596 | end | ||
594 | end | 597 | end |
595 | while 1 <= checkExes("mirror-checker.lua " .. sendArgs) do os.execute("sleep 10") end | 598 | while 1 <= checkExes("mirror-checker.lua " .. sendArgs) do os.execute("sleep 10") end |
596 | if testing("Integrity") or testing("Updated") then | 599 | if testing("Integrity") or testing("Updated") then |