Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development update tests scripts to have mycelium #3512

Merged
merged 5 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/grid_client_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ jobs:
sudo sed -i -- 's/Peers\: \[\]/Peers: [\n'"$PEERS"']/g' /etc/yggdrasil/yggdrasil.conf
sudo systemctl stop yggdrasil
sudo systemctl start yggdrasil
- name: Install Mycelium
run: |
sudo apt-get update
wget https://github.com/threefoldtech/mycelium/releases/download/v0.5.6/mycelium-x86_64-unknown-linux-musl.tar.gz
tar -xvf mycelium-x86_64-unknown-linux-musl.tar.gz
mv mycelium /usr/local/bin
sudo mycelium --peers tcp://188.40.132.242:9651 quic://185.69.166.8:9651 --tun-name utun9 &
- name: Generate SSH Key
run: |
ssh-keygen -t ed25519 -N '' -f ~/.ssh/id_ed25519
Expand Down
2 changes: 2 additions & 0 deletions packages/grid_client/tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ yarn test --runInBand
> `--coverage`: Collect and report coverage.
> `--colors`: Force colorful output.
> `--forceExit`: Force the process to exit after tests complete.
>
> **Note:** Some tests are using Mycelium for the SSH connection, which is why it is important for Mycelium to be running.
19 changes: 11 additions & 8 deletions packages/grid_client/tests/modules/kubernetes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ test("TC1231 - Kubernetes: Deploy a Kubernetes Cluster", async () => {
public_ip: masterPublicIp,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
},
],
workers: [
Expand All @@ -173,7 +173,7 @@ test("TC1231 - Kubernetes: Deploy a Kubernetes Cluster", async () => {
public_ip: workerPublicIp,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
},
],
metadata: metadata,
Expand All @@ -196,6 +196,7 @@ test("TC1231 - Kubernetes: Deploy a Kubernetes Cluster", async () => {
expect(result.masters[0].nodeId).toBe(masterNodeId);
expect(result.masters[0].status).toBe("ok");
expect(result.masters[0].planetary).toBeDefined();
expect(result.masters[0].myceliumIP).toBeDefined();
expect(result.masters[0].publicIP).toBeNull();
expect(result.masters[0].interfaces[0]["network"]).toBe(networkName);
expect(result.masters[0].interfaces[0]["ip"]).toContain(splitIP(ipRange));
Expand All @@ -211,6 +212,7 @@ test("TC1231 - Kubernetes: Deploy a Kubernetes Cluster", async () => {
expect(result.workers[0].nodeId).toBe(workerNodeId);
expect(result.workers[0].status).toBe("ok");
expect(result.workers[0].planetary).toBeDefined();
expect(result.workers[0].myceliumIP).toBeDefined();
expect(result.workers[0].publicIP).toBeNull();
expect(result.workers[0].interfaces[0]["network"]).toBe(networkName);
expect(result.workers[0].interfaces[0]["ip"]).toContain(splitIP(ipRange));
Expand Down Expand Up @@ -285,7 +287,7 @@ test("TC1231 - Kubernetes: Deploy a Kubernetes Cluster", async () => {
}
});

test("TC1232 - Kubernetes: Add Worker", async () => {
test.skip("TC1232 - Kubernetes: Add Worker", async () => {
/**********************************************
Test Suite: Grid3_Client_TS (Automated)
Test Cases: TC1232 - Kubernetes: Add Worker
Expand Down Expand Up @@ -425,7 +427,7 @@ test("TC1232 - Kubernetes: Add Worker", async () => {
public_ip: masterPublicIp,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
},
],
workers: [
Expand All @@ -439,7 +441,7 @@ test("TC1232 - Kubernetes: Add Worker", async () => {
public_ip: workerPublicIp,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
},
],
metadata: metadata,
Expand All @@ -459,7 +461,7 @@ test("TC1232 - Kubernetes: Add Worker", async () => {
public_ip: workerPublicIp,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
};

const res = await gridClient.k8s.deploy(k8s);
Expand Down Expand Up @@ -491,6 +493,7 @@ test("TC1232 - Kubernetes: Add Worker", async () => {
expect(newResult.workers[1].nodeId).toBe(workerNodeId);
expect(newResult.workers[1].status).toBe("ok");
expect(newResult.workers[1].planetary).toBeDefined();
expect(newResult.workers[1].myceliumIP).toBeDefined();
expect(newResult.workers[1].publicIP).toBeNull();
expect(newResult.workers[1].interfaces[0]["network"]).toBe(networkName);
expect(newResult.workers[1].interfaces[0]["ip"]).toContain(splitIP(ipRange));
Expand Down Expand Up @@ -679,7 +682,7 @@ test("TC1233 - Kubernetes: Delete Worker", async () => {
public_ip: masterPublicIp,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
},
],
workers: [
Expand All @@ -693,7 +696,7 @@ test("TC1233 - Kubernetes: Delete Worker", async () => {
public_ip: workerPublicIp,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
},
],
metadata: metadata,
Expand Down
15 changes: 9 additions & 6 deletions packages/grid_client/tests/modules/qsfs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ test("TC1234 - QSFS: Deploy QSFS underneath a VM", async () => {
entrypoint: "/sbin/zinit init",
public_ip: publicIP,
planetary: true,
mycelium: false,
mycelium: true,
qsfs_disks: [
{
qsfs_zdbs_name: qsfsZdbName,
Expand Down Expand Up @@ -250,6 +250,7 @@ test("TC1234 - QSFS: Deploy QSFS underneath a VM", async () => {
expect(result[0].capacity["cpu"]).toBe(cpu);
expect(result[0].capacity["memory"]).toBe(memory);
expect(result[0].planetary).toBeDefined();
expect(result[0].myceliumIP).toBeDefined();
expect(result[0].publicIP).toBeNull();
expect(result[0].description).toBe(description);

Expand Down Expand Up @@ -537,7 +538,7 @@ test("TC1235 - QSFS: Deploy QSFS Underneath a Kubernetes Cluster", async () => {
public_ip: masterPublicIp,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
qsfs_disks: qsfsDisk,
},
],
Expand All @@ -552,7 +553,7 @@ test("TC1235 - QSFS: Deploy QSFS Underneath a Kubernetes Cluster", async () => {
public_ip: workerPublicIp,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
},
],
metadata: metadata,
Expand All @@ -575,6 +576,7 @@ test("TC1235 - QSFS: Deploy QSFS Underneath a Kubernetes Cluster", async () => {
expect(result.masters[0].nodeId).toBe(masterNodeId);
expect(result.masters[0].status).toBe("ok");
expect(result.masters[0].planetary).toBeDefined();
expect(result.masters[0].myceliumIP).toBeDefined();
expect(result.masters[0].publicIP).toBeNull();
expect(result.masters[0].interfaces[0]["network"]).toBe(networkName);
expect(result.masters[0].interfaces[0]["ip"]).toContain(splitIP(ipRange));
Expand All @@ -599,6 +601,7 @@ test("TC1235 - QSFS: Deploy QSFS Underneath a Kubernetes Cluster", async () => {
expect(result.workers[0].nodeId).toBe(workerNodeId);
expect(result.workers[0].status).toBe("ok");
expect(result.workers[0].planetary).toBeDefined();
expect(result.workers[0].myceliumIP).toBeDefined();
expect(result.workers[0].publicIP).toBeNull();
expect(result.workers[0].interfaces[0]["network"]).toBe(networkName);
expect(result.workers[0].interfaces[0]["ip"]).toContain(splitIP(ipRange));
Expand Down Expand Up @@ -648,9 +651,9 @@ test("TC1235 - QSFS: Deploy QSFS Underneath a Kubernetes Cluster", async () => {
await masterSSH.execCommand("df -h").then(async function (result) {
const splittedRes = result.stdout.split("\n");
log(result.stdout);
log(splittedRes[6]);
expect(splittedRes[6]).toContain(qsfsName);
expect(splittedRes[6]).toContain(qsfsMountPoint);
log(splittedRes[5]);
expect(splittedRes[5]).toContain(qsfsName);
expect(splittedRes[5]).toContain(qsfsMountPoint);
});
} finally {
//Disconnect from the master
Expand Down
Loading
Loading