Skip to content

Commit

Permalink
CI: Temporarily set download links to CDNs (minio.drakvuf.cert.pl is …
Browse files Browse the repository at this point in the history
…no longer a thing) (#803)
  • Loading branch information
psrok1 authored Aug 7, 2023
1 parent a1e6564 commit 3a899db
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion drakcore/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build:
cp drakcore/config.dist.ini drakcore/config.ini
cp drakcore/uwsgi.dist.ini drakcore/uwsgi.ini
# Download minio
if [ ! -f drakcore/systemd/minio ] ; then wget -O drakcore/systemd/minio https://minio.drakvuf.cert.pl/static/minio ; fi
if [ ! -f drakcore/systemd/minio ] ; then wget -O drakcore/systemd/minio https://dl.min.io/server/minio/release/linux-amd64/archive/minio.RELEASE.2021-08-05T22-01-19Z ; fi
chmod +x drakcore/systemd/minio

override_dh_virtualenv:
Expand Down
2 changes: 1 addition & 1 deletion drakrun/package/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN apt-get update && \
RUN echo -ne '#!/bin/sh\nexit 0\n' > /bin/systemctl && chmod +x /bin/systemctl

# Install drakvuf bundle for libvmi headers
RUN wget -O drakvuf.deb "https://minio.drakvuf.cert.pl/static/bundle/$(lsb_release -cs)/drakvuf-bundle-0.8-git20210807130654+d74df17-1-generic.deb" && \
RUN wget -O drakvuf.deb "https://github.com/tklengyel/drakvuf/releases/download/1.0/debian_10-slim_drakvuf-bundle-1.0-git20221220221439+068b10f-1-generic.deb" && \
dpkg -i ./drakvuf.deb && \
cd /opt && \
git clone https://xenbits.xen.org/git-http/xtf.git && \
Expand Down
9 changes: 3 additions & 6 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def drakmon_setup():
logging.info(f"VM {drakvuf_vm.identity} created.")

logging.info("Waiting for VM to be alive...")
while not drakvuf_vm.is_alive():
time.sleep(0.5)
drakvuf_vm.wait_alive()

with drakvuf_vm.connect_ssh() as ssh:
for deb in (drakvuf_sandbox_debs + drakvuf_debs):
Expand All @@ -136,13 +135,11 @@ def drakmon_setup():
logging.info("Rebooting...")

# Wait until VM reboots
while drakvuf_vm.is_alive():
time.sleep(0.5)
drakvuf_vm.wait_alive()

logging.info("VM went down")

while not drakvuf_vm.is_alive():
time.sleep(0.5)
drakvuf_vm.wait_alive()

logging.info("VM back up")

Expand Down
17 changes: 10 additions & 7 deletions test/vm-runner-client/vm_runner_client/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import logging
import os
import re
import time
import uuid

import requests
Expand Down Expand Up @@ -73,13 +75,14 @@ def destroy(self):
})
response.raise_for_status()

def is_alive(self):
try:
# I'm not sure how we should close that
self.connect_tcp(22)
return True
except (OSError, ProxyError):
return False
def wait_alive(self):
for tries in range(30):
try:
self.connect_tcp(22).close()
return True
except (OSError, ProxyError) as e:
logging.info(f"Try [{tries+1}/30]: {str(e)}")
time.sleep(1)

@staticmethod
def get_vm_identity():
Expand Down

0 comments on commit 3a899db

Please sign in to comment.