Skip to content

Commit

Permalink
XXX debug
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpitt committed Nov 13, 2024
1 parent f50d3e4 commit cb30518
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 39 deletions.
34 changes: 0 additions & 34 deletions packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,40 +23,6 @@ srpm_build_deps:
# use the nicely formatted release NEWS from our upstream release, instead of git shortlog
copy_upstream_release_description: true
jobs:
- job: tests
identifier: self
trigger: pull_request
targets:
- fedora-40
- fedora-41
- fedora-latest-stable-aarch64
- fedora-rawhide
- centos-stream-9-x86_64
- centos-stream-9-aarch64
- centos-stream-10

# current Fedora runs reverse dependency testing against https://copr.fedorainfracloud.org/coprs/g/cockpit/main-builds/
- job: tests
identifier: revdeps
trigger: pull_request
targets:
- fedora-latest-stable
tf_extra_params:
environments:
- artifacts:
- type: repository-file
id: https://copr.fedorainfracloud.org/coprs/g/cockpit/main-builds/repo/fedora-$releasever/group_cockpit-main-builds-fedora-$releasever.repo
tmt:
context:
revdeps: "yes"

# run build/unit tests on some interesting architectures
- job: copr_build
trigger: pull_request
targets:
# big-endian
- fedora-development-s390x

# for cross-project testing
- job: copr_build
trigger: commit
Expand Down
9 changes: 6 additions & 3 deletions src/session/session-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ read_authorize_response (const char *what)
debug ("EOF reading %s authorize message", what);
exit (0);
}
debug ("XXX read_authorize_response: '%s'", message);
return (char *)message;
}

Expand All @@ -77,7 +78,7 @@ char *get_authorize_key (const char *json, const char *key, bool required)
* whitespace, everything is a string, and no escaped ".
*/
if (json == NULL || json[0] != '\n' || json[1] != '{')
errx (EX, "authorize message doesn't start with \\n{");
errx (EX, "authorize message doesn't start with \\n{: '%s'", json);

char *key_match;
int key_match_len = asprintfx (&key_match, "\"%s\":\"", key);
Expand All @@ -88,7 +89,7 @@ char *get_authorize_key (const char *json, const char *key, bool required)
{
if (required)
errx (EX, "authorize message missing required key %s", key);
debug ("authorize message missing optional key %s", key);
debug ("authorize message '%s' missing optional key %s", json, key);
return NULL;
}

Expand All @@ -98,7 +99,9 @@ char *get_authorize_key (const char *json, const char *key, bool required)
size_t value_len = strcspn (match, "\"");
if (match[value_len] != '"')
errx (EX, "syntax error, expected closing quote");
return strndup (match, value_len);
char *res = strndup (match, value_len);
debug ("XXX get_authorize_key: %s found in '%s': '%s'", key, json, res);
return res;
}

void
Expand Down
2 changes: 1 addition & 1 deletion src/session/session-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "common/cockpitauthorize.h"
#include "common/cockpitmemory.h"

#define DEBUG_SESSION 0
#define DEBUG_SESSION 1

#if DEBUG_SESSION
#define debug(fmt, ...) (fprintf (stderr, "%s: " fmt "\n", program_name, ##__VA_ARGS__))
Expand Down
4 changes: 3 additions & 1 deletion test/run
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PREPARE_OPTS=""
RUN_OPTS=""
ALL_TESTS="$(test/common/run-tests --test-dir test/verify -l)"

RE_NETWORKING='Networking|Bonding|Connection|TestBridge|WireGuard|Firewall|Team|IPA|AD|Kerberos'
RE_NETWORKING='IPA|AD'
RE_STORAGE='Storage'
RE_EXPENSIVE='HostSwitching|MultiMachine|Updates|Superuser|Kdump|Pages'

Expand Down Expand Up @@ -78,5 +78,7 @@ if [ -n "$TEST_SCENARIO" ] && [ -z "$RUN_OPTS" ]; then
exit 1
fi
export TEST_ALLOW_JOURNAL_MESSAGES=".*"
test/image-prepare --verbose ${PREPARE_OPTS} "$TEST_OS"
test/common/run-tests --jobs ${TEST_JOBS:-1} --test-dir test/verify --track-naughties ${RUN_OPTS}

0 comments on commit cb30518

Please sign in to comment.