blob: 93c8f51486186d9d16524a57ba435c1719fd6ce6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/simple.css">
<link rel="stylesheet" href="css/screen.css">
<title>Testing - Documentation</title>
</head>
<body>
<header>
<h1>Documentation</h1>
<p>eduVPN for Linux</p>
<nav>
<a href="index.html">About</a>
<a href="building.html">Building</a>
<a href="testing.html">Testing</a>
<a href="building-client.html">Building a client</a>
<a href="apidocs.html">API Docs</a>
</nav>
</header>
<main>
<aside>
<ul>
<li class="nav-item" data-level="2"><a href="#testing-the-python-code" class="nav-link">Testing the Python code</a>
<ul class="nav flex-column">
</ul>
</li>
</ul>
</aside>
<h1 id="testing">Testing<a class="headerlink" href="#testing" title="Permanent link">#</a></h1>
<p>The Go library right now has various tests defined. E.g. server interaction, oauth, discovery and signature verification tests.</p>
<p>To run the Go test suite, issue the following command in a shell</p>
<pre><code class="language-bash">make test
</code></pre>
<p>Note that this runs the tests without any server interaction (so for now only the signature verification tests). To run the tests with an eduVPN server you need to specify environment variables:</p>
<pre><code class="language-bash">SERVER_URI="eduvpn.example.com" PORTAL_USER="example" PORTAL_PASS="example" make test
</code></pre>
<p>This needs <a href="https://selenium-python.readthedocs.io/">python3-selenium</a> and <a href="https://github.com/mozilla/geckodriver/releases">geckodriver</a> (extract and put in your <code>$PATH</code>). Note that testing with a server assumes it uses a default portal, due to it needing to click on buttons on the web page. You can add your own portal by customizing the <a href="https://codeberg.org/eduVPN/eduvpn-common/src/branch/main/selenium_eduvpn.py">called Selenium script</a>.</p>
<p>There are other environment variables that can be used:</p>
<ul>
<li><code>OAUTH_EXPIRED_TTL</code>: Use this for a server which has a low OAuth access token expiry time, e.g. 10 seconds. You would then set this variable to <code>"10"</code> so that a test is ran which waits for 10 seconds for the OAuth tokens to expire</li>
</ul>
<h2 id="testing-the-python-code">Testing the Python code<a class="headerlink" href="#testing-the-python-code" title="Permanent link">#</a></h2>
<p>To test the Python code, issue the following command in a shell (you will need dependencies for all wrappers if you do this[^1]):</p>
<pre><code class="language-bash">make -C wrappers/python test
</code></pre>
</main>
<footer>
<p>Documentation - eduVPN for Linux</p>
</footer>
</body>
</html>
|