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

Improve all #32

Merged
merged 4 commits into from
Sep 29, 2023
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
2 changes: 1 addition & 1 deletion COGNAC
Submodule COGNAC updated 3 files
+11 −22 construct_data.c.sh
+8 −2 helper.sh
+4 −0 lib.c
20 changes: 11 additions & 9 deletions local-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@ fi

alias oapi-cli=$oapi_cli

if [ ! -d "osc-ricochet-2" ]; then
git clone https://github.com/outscale-mgo/osc-ricochet-2
fi
if [ "$#" -lt 2 ]; then
if [ ! -d "osc-ricochet-2" ]; then
git clone https://github.com/outscale-mgo/osc-ricochet-2
fi

cd osc-ricochet-2
pkill ricochet
cd osc-ricochet-2
pkill ricochet

cargo build
cargo run -- ./ricochet-oapi-cli.json > /dev/null &
cargo build
cargo run -- ./ricochet-oapi-cli.json > /dev/null &

sleep 5
sleep 5

cd ..
cd ..
fi

export OSC_ENDPOINT_API="127.0.0.1:3000"

Expand Down
8 changes: 4 additions & 4 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11984,7 +11984,7 @@ int main(int ac, char **av)
incr = 1;
}
TRY(!aa, "ExpirationDate argument missing\n");
s->expiration_date = aa; // string string string
s->expiration_date = aa; // string string

} else
if ((aret = argcmp(next_a, "State")) == 0 || aret == '=' ) {
Expand Down Expand Up @@ -18217,7 +18217,7 @@ int main(int ac, char **av)
incr = 1;
}
TRY(!aa, "FromDate argument missing\n");
s->from_date = aa; // string string string
s->from_date = aa; // string string

} else
if ((aret = argcmp(next_a, "Overall")) == 0 || aret == '=' ) {
Expand All @@ -18244,7 +18244,7 @@ int main(int ac, char **av)
incr = 1;
}
TRY(!aa, "ToDate argument missing\n");
s->to_date = aa; // string string string
s->to_date = aa; // string string

} else
{
Expand Down Expand Up @@ -29761,7 +29761,7 @@ int main(int ac, char **av)
incr = 1;
}
TRY(!aa, "ExpirationDate argument missing\n");
s->expiration_date = aa; // string string string
s->expiration_date = aa; // string string

} else
if ((aret = argcmp(next_a, "UserName")) == 0 || aret == '=' ) {
Expand Down
2 changes: 1 addition & 1 deletion osc-sdk-C
Submodule osc-sdk-C updated 4 files
+1 −1 COGNAC
+12 −11 local-tests.sh
+2,306 −4,398 osc_sdk.c
+4 −4 osc_sdk.h
6,704 changes: 2,306 additions & 4,398 deletions osc_sdk.c

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions osc_sdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -7144,7 +7144,7 @@ struct osc_update_access_key_arg {
* or `2020-06-14`). If not specified, the access key is set to not
* expire.
*/
char *expiration_date; /* string string */
char *expiration_date; /* string */
/*
* The new state for the access key (`ACTIVE` \\| `INACTIVE`). When set
* to `ACTIVE`, the access key is enabled and can be used to send
Expand Down Expand Up @@ -8862,7 +8862,7 @@ struct osc_read_consumption_account_arg {
* only with a time set to midnight (for example,
* `2020-06-14T00:00:00.000Z`).
*/
char *from_date; /* string string */
char *from_date; /* string */
/*
* By default or if false, returns only the consumption of the specific
* account that sends this request. If true, returns either the overall
Expand All @@ -8877,7 +8877,7 @@ struct osc_read_consumption_account_arg {
* `2020-06-30`). The date-time format is also accepted, but only with a
* time set to midnight (for example, `2020-06-30T00:00:00.000Z`).
*/
char *to_date; /* string string */
char *to_date; /* string */
};

struct osc_read_console_output_arg {
Expand Down Expand Up @@ -11750,7 +11750,7 @@ struct osc_create_access_key_arg {
* or `2020-06-14`). To remove an existing expiration date, use the
* method without specifying this parameter.
*/
char *expiration_date; /* string string */
char *expiration_date; /* string */
/*
* The name of the EIM user that owns the key to be created. If you do
* not specify a user name, this action creates an access key for the
Expand Down
38 changes: 38 additions & 0 deletions tests-lot-arg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh

./oapi-cli ReadVms --DryRun true --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true \
--DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true \
ReadVms --DryRun true --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false \
--DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun false --DryRun true --DryRun true --DryRun true \
--DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true \
--DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true \
--DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true \
--DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true \
--DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true --DryRun true \
--DryRun true --DryRun true
8 changes: 8 additions & 0 deletions tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@ trap "echo [$MSG_BASE DeleteTags --Tags.0.Key k0 ..Value v0 --Tags.1.Key k1 ..Va
# this doesn't check that the call work, as for that we would require to set ResourceIds
./oapi-cli DeleteTags --Tags.0.Key k0 ..Value v0 --Tags.1.Key k1 ..Value v1 | grep RequestId > /dev/null
echo "[$MSG_BASE --Tags.0.Key k0 ..Value v0 --Tags.1.Key k1 ..Value v1 OK]"

trap "echo [$MSG_BASE Lot of Arguments FAIL]" ERR
./tests-lot-arg.sh | grep RequestId > /dev/null
echo "[$MSG_BASE Lot of Arguments OK]"

trap "echo [$MSG_BASE ReadConsumptionAccount --FromDate $(date -d "yesterday" '+%F') --ToDate $(date "+%F") FAIL]" ERR
./oapi-cli ReadConsumptionAccount --FromDate $(date -d "yesterday" '+%F') --ToDate $(date "+%F") | grep Operation > /dev/null
echo "[$MSG_BASE ReadConsumptionAccount --FromDate $(date -d "yesterday" '+%F') --ToDate $(date "+%F") OK]"
Loading