Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
connectivity-selftest
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
stustanet
connectivity-selftest
Commits
c5e555c2
Commit
c5e555c2
authored
May 04, 2019
by
Julien Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
continue with other tests if one fails
parent
4fa765b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
38 deletions
+59
-38
public/js/selftest.js
public/js/selftest.js
+59
-38
No files found.
public/js/selftest.js
View file @
c5e555c2
...
...
@@ -236,7 +236,7 @@ function sleep(ms) {
});
}
function
runTest
(
index
,
testFunc
)
{
function
runTest
(
index
,
testFunc
,
fatal
=
false
)
{
const
status
=
getStatusColumn
(
index
);
return
new
Promise
(
function
(
resolve
,
reject
)
{
markRunning
(
status
);
...
...
@@ -247,8 +247,12 @@ function runTest(index, testFunc) {
resolve
(
res
);
},
function
(
err
)
{
markFailed
(
status
);
skipRemainingTests
(
index
);
reject
(
err
);
if
(
fatal
)
{
skipRemainingTests
(
index
);
reject
(
false
);
}
else
{
resolve
(
false
);
}
})
});
});
...
...
@@ -328,41 +332,58 @@ function skipRemainingTests(index) {
});
}
sleep
(
500
).
then
(
function
(
res
)
{
document
.
getElementById
(
'
status
'
).
innerHTML
=
"
Performing Tests ...
"
;
log
(
"
===== StuStaNet Connectivity Selftest =====
"
);
log
(
"
Date:
"
+
Date
().
toString
());
log
(
"
User Agent:
"
+
window
.
navigator
.
userAgent
);
function
()
{
let
failed
=
false
;
if
(
isIncompatibleBrowser
()
)
{
showBox
(
'
error-browser
'
)
;
skipRemainingTests
(
-
1
);
return
Promise
.
reject
(
'
UNSUPPORTED
'
);
}
sleep
(
500
).
then
(
function
(
res
)
{
document
.
getElementById
(
'
status
'
).
innerHTML
=
"
Performing Tests ...
"
;
log
(
"
===== StuStaNet Connectivity Selftest =====
"
);
log
(
"
Date:
"
+
Date
().
toString
()
);
log
(
"
User Agent:
"
+
window
.
navigator
.
userAgent
);
return
runTest
(
0
,
function
()
{
return
getIPInfo
();
});
}).
then
(
function
(
res
)
{
return
runTest
(
1
,
function
()
{
return
checkStatus
(
httpTestURL
);
});
}).
then
(
function
(
res
)
{
return
runTest
(
2
,
function
()
{
return
checkStatus
(
httpsTestURL
);
});
}).
then
(
function
(
res
)
{
return
runTest
(
3
,
function
()
{
return
checkNAT
();
if
(
isIncompatibleBrowser
())
{
showBox
(
'
error-browser
'
);
skipRemainingTests
(
-
1
);
return
Promise
.
reject
(
'
UNSUPPORTED
'
);
}
return
runTest
(
0
,
function
()
{
return
getIPInfo
();
},
true
);
}).
then
(
function
(
res
)
{
if
(
res
===
false
)
{
failed
=
true
;
}
return
runTest
(
1
,
function
()
{
return
checkStatus
(
httpTestURL
);
});
}).
then
(
function
(
res
)
{
if
(
res
===
false
)
{
failed
=
true
;
}
return
runTest
(
2
,
function
()
{
return
checkStatus
(
httpsTestURL
);
});
}).
then
(
function
(
res
)
{
if
(
res
===
false
)
{
failed
=
true
;
}
return
runTest
(
3
,
function
()
{
return
checkNAT
();
});
}).
finally
(
function
(
res
)
{
if
(
res
===
false
)
{
failed
=
true
;
}
log
(
"
----------
"
);
if
(
failed
)
{
log
(
"
Test failed.
"
);
showLogButton
();
document
.
getElementById
(
'
status
'
).
innerHTML
=
"
Problems detected!
"
}
else
{
log
(
"
No problems detected.
"
);
showLogButton
();
markSuccess
(
document
.
getElementById
(
'
status
'
));
}
});
}).
then
(
function
(
res
)
{
log
(
"
----------
"
);
log
(
"
No problems detected.
"
);
showLogButton
();
markSuccess
(
document
.
getElementById
(
'
status
'
));
}).
catch
(
function
(
err
)
{
log
(
"
----------
"
);
log
(
"
Test failed.
"
);
showLogButton
();
document
.
getElementById
(
'
status
'
).
innerHTML
=
"
Problems detected!
"
});
}()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment