This repository was archived by the owner on Mar 12, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -ex
4+
5+ export KMS_CLI_FORMAT=json
6+ SEED=" 11223344556677889900AABBCCDDEEFF11223344556677889900AABBCCDDEEFF"
7+ COSMIAN=" cargo run --bin cosmian --"
8+
9+ # Create the key encryption key
10+ kek_id=$( $COSMIAN kms sym keys create | jq -r ' .unique_identifier' )
11+ echo " kek_id: $kek_id "
12+
13+ # Create the index ID
14+ index_id=$( $COSMIAN findex-server permissions create | sed ' s/Created Index ID: //' )
15+ echo " index_id: $index_id "
16+
17+ # Encrypt and index the data
18+ $COSMIAN findex-server encrypt-and-index --seed $SEED --index-id " $index_id " --kek-id " $kek_id " --csv test_data/datasets/smallpop.csv
19+
20+ # Search and decrypt the data
21+ expected_line=$( $COSMIAN findex-server search-and-decrypt --seed $SEED --index-id " $index_id " --kek-id " $kek_id " --keyword " Southborough" | sed ' s/Decrypted records: //' )
22+ echo " expected_line: $expected_line "
23+
24+ # Check the result
25+ if [[ " $expected_line " != " [\" SouthboroughMAUnited States9686\" ]" ]]; then
26+ echo " Test failed: unexpected result"
27+ exit 1
28+ else
29+ echo " Test passed"
30+ exit 0
31+ fi
Original file line number Diff line number Diff line change @@ -32,23 +32,23 @@ jobs:
3232 target : x86_64-unknown-linux-gnu
3333 prerequisites : |
3434 sudo apt-get update
35- sudo apt-get install -qq librust-atk-sys-dev librust-gdk-sys-dev pkg-config
35+ sudo apt-get install -qq librust-atk-sys-dev librust-gdk-sys-dev pkg-config jq
3636 docker_compose : true
3737
3838 - distribution : ubuntu-22.04
3939 archive-name : ubuntu_22_04
4040 target : x86_64-unknown-linux-gnu
4141 prerequisites : |
4242 sudo apt-get update
43- sudo apt-get install -qq librust-atk-sys-dev librust-gdk-sys-dev pkg-config
43+ sudo apt-get install -qq librust-atk-sys-dev librust-gdk-sys-dev pkg-config jq
4444 docker_compose : true
4545
4646 - distribution : ubuntu-24.04
4747 archive-name : ubuntu_24_04
4848 target : x86_64-unknown-linux-gnu
4949 prerequisites : |
5050 sudo apt-get update
51- sudo apt-get install -qq libgtk-3-dev libglib2.0-dev pkg-config
51+ sudo apt-get install -qq libgtk-3-dev libglib2.0-dev pkg-config jq
5252 docker_compose : true
5353
5454 - distribution : macos-13
Original file line number Diff line number Diff line change 8686 run : |
8787 bash .github/scripts/cargo_build.sh
8888
89+ - name : Cosmian tests
90+ if : contains(runner.os, 'Linux')
91+ run : |
92+ set -ex
93+ bash .github/scripts/cosmian_tests.sh
94+
8995 - name : Remove large files before saving cache
9096 run : |
9197 find target/ -type f -size +100M -delete
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use cosmian_config_utils::{location, ConfigUtils};
44use cosmian_findex_cli:: reexports:: cosmian_findex_client:: FindexClientConfig ;
55use cosmian_kms_cli:: reexport:: cosmian_kms_client:: KmsClientConfig ;
66use serde:: { Deserialize , Serialize } ;
7+ use tracing:: debug;
78
89use crate :: error:: CosmianError ;
910
@@ -48,7 +49,7 @@ impl ClientConf {
4849 /// not a valid toml file.
4950 pub fn load ( conf_path : Option < PathBuf > ) -> Result < Self , CosmianError > {
5051 let conf_path_buf = Self :: location ( conf_path) ?;
51- println ! ( "Loading configuration from: {conf_path_buf:?}" ) ;
52+ debug ! ( "Loading configuration from: {conf_path_buf:?}" ) ;
5253
5354 Ok ( Self :: from_toml ( conf_path_buf. to_str ( ) . ok_or_else (
5455 || {
You can’t perform that action at this time.
0 commit comments