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

Fix 'ovsdb-client needs-conversion' to access remote server #347

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions ovsdb/ovsdb-client.c
Expand Up @@ -1664,14 +1664,15 @@ static void
do_needs_conversion(struct jsonrpc *rpc, const char *database_ OVS_UNUSED,
int argc OVS_UNUSED, char *argv[])
{
const char *schema_file_name = argv[argc - 1];
struct ovsdb_schema *schema1;
check_ovsdb_error(ovsdb_schema_from_file(argv[0], &schema1));
check_ovsdb_error(ovsdb_schema_from_file(schema_file_name, &schema1));

char *database = schema1->name;
open_rpc(1, NEED_DATABASE, argc, argv, &rpc, &database);

if (is_database_clustered(rpc, database)) {
ovsdb_schema_persist_ephemeral_columns(schema1, argv[0]);
ovsdb_schema_persist_ephemeral_columns(schema1, schema_file_name);
}

struct ovsdb_schema *schema2 = fetch_schema(rpc, schema1->name);
Expand Down
24 changes: 24 additions & 0 deletions tests/ovsdb-client.at
Expand Up @@ -12,6 +12,30 @@ AT_CHECK([ovsdb-client get-schema-cksum unix:socket ordinals], [0], [12345678 9
OVSDB_SERVER_SHUTDOWN
AT_CLEANUP

AT_SETUP([ovsdb-client needs-conversion (no conversion needed)])
AT_KEYWORDS([ovsdb file positive])
ordinal_schema > schema
touch .db.~lock~
AT_CHECK([ovsdb-tool create db schema], [0], [], [ignore])
AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db], [0], [ignore], [ignore])
AT_CHECK([ovsdb-client needs-conversion unix:socket schema], [0], [no
])
OVSDB_SERVER_SHUTDOWN
AT_CLEANUP
roytman marked this conversation as resolved.
Show resolved Hide resolved

AT_SETUP([ovsdb-client needs-conversion (conversion needed)])
AT_KEYWORDS([ovsdb file positive])
ordinal_schema > schema
touch .db.~lock~
AT_CHECK([ovsdb-tool create db schema], [0], [], [ignore])
AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db], [0], [ignore], [ignore])
sed 's/5\.1\.3/5.1.4/' < schema > schema2
AT_CHECK([diff schema schema2], [1], [ignore])
AT_CHECK([ovsdb-client needs-conversion unix:socket schema2], [0], [yes
])
OVSDB_SERVER_SHUTDOWN
AT_CLEANUP

AT_SETUP([ovsdb-client backup and restore])
AT_KEYWORDS([ovsdb client positive])

Expand Down