Skip to content

Commit

Permalink
Revert "Test update actions"
Browse files Browse the repository at this point in the history
This reverts commit 701fac1.
  • Loading branch information
doylemark committed Aug 19, 2024
1 parent c832ef7 commit 9f5d3c8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 32 deletions.
1 change: 0 additions & 1 deletion control-plane/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const CONTROL_PLANE_PORT: u16 = 3031;

#[tokio::main]
async fn main() -> Result<()> {
println!("test actions!");
shared::logging::init_env_logger();
print_version!("Control Plane");
log::debug!("Starting control plane on {CONTROL_PLANE_PORT}");
Expand Down
1 change: 0 additions & 1 deletion crates/vsock-proxy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ mod net;
use net::{Address, Error, Listener};

fn main() {
println!("test actions!");
let matches = Command::new("vsock-proxy")
.about("A simple proxy to pipe traffic to/from a vsock connection")
.arg(
Expand Down
1 change: 0 additions & 1 deletion data-plane/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const ENCLAVE_CLOCK_SYNC_INTERVAL: Duration = Duration::from_secs(300);
fn main() {
shared::logging::init_env_logger();
print_version!("Data Plane");
println!("test actions!");

#[cfg(feature = "enclave")]
try_update_fd_limit(ENCLAVE_NOFILE_SOFT_LIMIT, ENCLAVE_NOFILE_HARD_LIMIT);
Expand Down
51 changes: 23 additions & 28 deletions e2e-tests/e2e.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
console.log("test actions!");
const { expect } = require("chai");
const axios = require("axios").default;
const https = require("https");
const { expect } = require('chai');
const axios = require('axios').default;
const https = require('https');
const net = require("net");
const CBOR = require("cbor-sync");

Expand All @@ -17,7 +16,7 @@ describe("POST data to enclave", () => {
.post(
"https://enclave.localhost:443/hello",
{ secret: "ev:123" },
{ headers: { "api-key": "placeholder" } },
{ headers: { "api-key": "placeholder" } }
)
.then((result) => {
console.log("Post request sent to the enclave");
Expand Down Expand Up @@ -64,7 +63,7 @@ describe("POST data to enclave", () => {
})
.catch((err) => {
expect(err.response.data.message).to.deep.equal(
"getaddrinfo EAI_AGAIN evervault.com",
"getaddrinfo EAI_AGAIN evervault.com"
);
});
});
Expand Down Expand Up @@ -92,24 +91,21 @@ describe("POST data to enclave", () => {
const encryptResult = await allowAllCerts.post(
"https://enclave.localhost:443/encrypt",
data,
{ headers: { "api-key": "placeholder" } },
{ headers: { "api-key": "placeholder" } }
);
const decryptResult = await allowAllCerts.post(
"https://enclave.localhost:443/hello",
encryptResult.data,
{ headers: { "api-key": "placeholder" } },
{ headers: { "api-key": "placeholder" } }
);
const { response, ...echoPayload } = decryptResult.data;
expect(echoPayload).to.deep.equal(data);
});

it("returns the injected environment", async () => {
const result = await allowAllCerts.get(
"https://enclave.localhost:443/env",
{
headers: { "api-key": "placeholder" },
},
);
const result = await allowAllCerts.get("https://enclave.localhost:443/env", {
headers: { "api-key": "placeholder" },
});
expect("123").to.deep.equal(result.data.ANOTHER_ENV_VAR);
});

Expand All @@ -118,18 +114,18 @@ describe("POST data to enclave", () => {
.post(
"https://enclave.localhost:443/attestation-doc",
{},
{ headers: { "api-key": "placeholder" }, responseType: "arraybuffer" },
{ headers: { "api-key": "placeholder" }, responseType: "arraybuffer" }
)
.catch((err) => {
console.error(err);
throw err;
});
const result = CBOR.decode(doc.data);
expect(result).to.deep.equal({
pcr0: "000",
pcr1: "000",
pcr2: "000",
pcr8: "000",
pcr0: "000",
pcr1: "000",
pcr2: "000",
pcr8: "000",
});
});

Expand All @@ -138,7 +134,7 @@ describe("POST data to enclave", () => {
.post(
"https://enclave.localhost:443/chunked",
{ secret: "ev:123" },
{ headers: { "api-key": "placeholder" } },
{ headers: { "api-key": "placeholder" } }
)
.then((result) => {
console.log("Post request sent to the enclave");
Expand All @@ -147,7 +143,7 @@ describe("POST data to enclave", () => {
secret: "ev:123",
});
//check transfer-encoding is not set
expect(result.headers["transfer-encoding"]).to.be.undefined;
expect(result.headers['transfer-encoding']).to.be.undefined;
})
.catch((err) => {
console.error(err);
Expand All @@ -171,16 +167,16 @@ describe("Enclave is runnning", () => {
const stats = JSON.parse(result);
const keys = Object.keys(stats);
expect(keys).to.include(
"evervault.enclaves.memory.total;enclave_uuid=enclave_123;app_uuid=app_12345678",
"evervault.enclaves.memory.total;enclave_uuid=enclave_123;app_uuid=app_12345678"
);
expect(keys).to.include(
"evervault.enclaves.memory.avail;enclave_uuid=enclave_123;app_uuid=app_12345678",
"evervault.enclaves.memory.avail;enclave_uuid=enclave_123;app_uuid=app_12345678"
);
expect(keys).to.include(
"evervault.enclaves.cpu.one;enclave_uuid=enclave_123;app_uuid=app_12345678",
"evervault.enclaves.cpu.one;enclave_uuid=enclave_123;app_uuid=app_12345678"
);
expect(keys).to.include(
"evervault.enclaves.cpu.cores;enclave_uuid=enclave_123;app_uuid=app_12345678",
"evervault.enclaves.cpu.cores;enclave_uuid=enclave_123;app_uuid=app_12345678"
);
} finally {
sysClient.destroy();
Expand All @@ -203,13 +199,12 @@ describe("Enclave is runnning", () => {
const keys = Object.keys(stats);

expect(keys).to.include(
"evervault.enclaves.decrypt.count;enclave_uuid=enclave_123;app_uuid=app_12345678",
"evervault.enclaves.decrypt.count;enclave_uuid=enclave_123;app_uuid=app_12345678"
);
} finally {
prodClient.destroy();
done();
}
});
});
});

});
1 change: 0 additions & 1 deletion shared/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pub const ENCLAVE_IP: &str = "172.20.0.7";
#[cfg(not(feature = "enclave"))]
pub const PARENT_IP: &str = "172.20.0.8";

println!("test actions!");
pub mod acme;
pub mod logging;
pub mod rpc;
Expand Down

0 comments on commit 9f5d3c8

Please sign in to comment.