mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 12:28:42 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ac2924733 | ||
|
|
8dacf14278 |
No files matched your search
@@ -399,6 +399,13 @@ struct OPENDHT_PUBLIC Certificate {
|
||||
|
||||
static Certificate generate(const PrivateKey& key, const std::string& name = "dhtnode", Identity ca = {}, bool is_ca = false);
|
||||
|
||||
gnutls_x509_crt_t getRawCopy() const {
|
||||
auto copy = Certificate(getPacked());
|
||||
gnutls_x509_crt_t ret = copy.cert;
|
||||
copy.cert = nullptr;
|
||||
return ret;
|
||||
}
|
||||
|
||||
gnutls_x509_crt_t cert {};
|
||||
std::shared_ptr<Certificate> issuer {};
|
||||
private:
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import unittest
|
||||
import opendht as dht
|
||||
|
||||
class OpenDhtTester(unittest.TestCase):
|
||||
|
||||
# test that DhtRunner can be instatiated and deleted without throwing
|
||||
def test_instance(self):
|
||||
for i in range(10):
|
||||
r = dht.DhtRunner()
|
||||
r.run()
|
||||
del r
|
||||
|
||||
# test that bootstraping works (raw address)
|
||||
def test_bootstrap(self):
|
||||
a = dht.DhtRunner()
|
||||
a.run()
|
||||
b = dht.DhtRunner()
|
||||
b.run()
|
||||
self.assertTrue(b.bootstrap(a.getBound()))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user