toride-ssh-config 0.1.0

SSH config file parsing, editing, and host resolution via a lossless AST
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
use super::*;
use crate::ast::{ConfigAst, parse as parse_ast};

fn make_ast(input: &str) -> ConfigAst {
    parse_ast(input)
}

#[test]
fn get_directive_finds_hostname() {
    let ast = make_ast(
        "\
Host example
    HostName example.com
    User alice
",
    );
    let val = get_directive(&ast, "example", "HostName");
    assert_eq!(val, Some("example.com".to_owned()));
}

#[test]
fn get_directive_case_insensitive_key() {
    let ast = make_ast(
        "\
Host example
    hostname example.com
",
    );
    let val = get_directive(&ast, "example", "HOSTNAME");
    assert_eq!(val, Some("example.com".to_owned()));
}

#[test]
fn get_directive_wildcard_match() {
    let ast = make_ast(
        "\
Host *
    User default
",
    );
    let val = get_directive(&ast, "anything", "User");
    assert_eq!(val, Some("default".to_owned()));
}

#[test]
fn get_directive_negation() {
    let ast = make_ast(
        "\
Host * !badhost
    User default
",
    );
    let val = get_directive(&ast, "goodhost", "User");
    assert_eq!(val, Some("default".to_owned()));

    let val = get_directive(&ast, "badhost", "User");
    assert_eq!(val, None);
}

#[test]
fn glob_matches_works() {
    assert!(glob_matches("example.com", "example.com"));
    assert!(glob_matches("anything", "*"));
    assert!(glob_matches("foo.example.com", "*.example.com"));
    assert!(glob_matches("a", "?"));
    assert!(!glob_matches("example.com", "other.com"));
    assert!(!glob_matches("example.com", "*.org"));
}

#[test]
fn glob_wildcard_excludes_bare_domain() {
    assert!(!glob_matches("example.com", "*.example.com"));
    assert!(glob_matches("sub.example.com", "*.example.com"));
}

#[test]
fn glob_matches_case_insensitive() {
    assert!(host_matches_patterns(
        "Example.COM",
        &["example.com".to_owned()]
    ));
}

#[test]
fn accumulative_directives_collected_across_blocks() {
    let ast = make_ast(
        "\
Host myhost
    IdentityFile ~/.ssh/id_ed25519

Host *
    IdentityFile ~/.ssh/id_rsa
",
    );
    let vals = get_accumulative_directive(&ast, "myhost", "IdentityFile");
    assert_eq!(vals.len(), 2);
    assert_eq!(vals[0], "~/.ssh/id_ed25519");
    assert_eq!(vals[1], "~/.ssh/id_rsa");
}

#[test]
fn is_accumulative_known_directives() {
    assert!(is_accumulative("identityfile"));
    assert!(is_accumulative("certificatefile"));
    // ProxyJump uses first-match-wins per OpenSSH ssh_config(5), NOT accumulative.
    assert!(!is_accumulative("proxyjump"));
    // ForwardAgent is first-match-wins per OpenSSH ssh_config(5).
    assert!(!is_accumulative("forwardagent"));
    assert!(!is_accumulative("hostname"));
    assert!(!is_accumulative("user"));
    assert!(!is_accumulative("port"));
    // First-match-wins: identityagent, addkeystoagent, usekeychain,
    // controlmaster, controlpath, controlpersist.
    assert!(!is_accumulative("identityagent"));
    assert!(!is_accumulative("addkeystoagent"));
    assert!(!is_accumulative("usekeychain"));
    assert!(!is_accumulative("controlmaster"));
    assert!(!is_accumulative("controlpath"));
    assert!(!is_accumulative("controlpersist"));
    // Accumulative forwarding directives.
    assert!(is_accumulative("localforward"));
    assert!(is_accumulative("remoteforward"));
    assert!(is_accumulative("dynamicforward"));
}

// ---------------------------------------------------------------------------
// Edge-case tests for glob and pattern matching
// ---------------------------------------------------------------------------

#[test]
fn glob_matches_empty_text_and_pattern() {
    assert!(glob_matches("", ""));
    assert!(glob_matches("", "*"));
    assert!(!glob_matches("", "?"));
    assert!(!glob_matches("", "a"));
}

#[test]
fn glob_matches_question_mark_edge_cases() {
    assert!(glob_matches("a", "?"));
    assert!(!glob_matches("", "?"));
    assert!(glob_matches("ab", "??"));
    assert!(!glob_matches("a", "??"));
}

#[test]
fn glob_matches_multiple_stars() {
    assert!(glob_matches("anything", "**"));
    assert!(glob_matches("anything", "***"));
    assert!(glob_matches("a.b.c", "*.*.*"));
    assert!(!glob_matches("ab", "*.*.*"));
}

#[test]
fn glob_matches_star_at_start() {
    assert!(glob_matches("example.com", "*.com"));
    assert!(!glob_matches("com", "*.com"));
}

#[test]
fn glob_matches_star_in_middle() {
    assert!(glob_matches("sub.example.com", "sub.*.com"));
    assert!(!glob_matches("sub.example.org", "sub.*.com"));
}

#[test]
fn host_matches_patterns_empty_patterns() {
    assert!(!host_matches_patterns("example.com", &[] as &[&str]));
}

#[test]
fn host_matches_patterns_only_negation() {
    // Only negation patterns with no positive match should return false
    let patterns = vec!["!badhost".to_string()];
    assert!(!host_matches_patterns("goodhost", &patterns));
    assert!(!host_matches_patterns("badhost", &patterns));
}

#[test]
fn host_matches_patterns_negation_overrides_positive() {
    let patterns = vec!["*".to_string(), "!badhost".to_string()];
    assert!(host_matches_patterns("goodhost", &patterns));
    assert!(!host_matches_patterns("badhost", &patterns));
}

#[test]
fn host_matches_patterns_case_insensitive() {
    assert!(host_matches_patterns(
        "EXAMPLE.COM",
        &["example.com".to_string()]
    ));
    assert!(host_matches_patterns(
        "example.com",
        &["EXAMPLE.COM".to_string()]
    ));
}

#[test]
fn host_matches_patterns_wildcard_all() {
    let patterns = vec!["*".to_string()];
    assert!(host_matches_patterns("anything", &patterns));
    assert!(host_matches_patterns("", &patterns));
}

#[test]
fn host_matches_patterns_empty_host() {
    assert!(host_matches_patterns("", &["*".to_string()]));
    assert!(!host_matches_patterns("", &["example.com".to_string()]));
}

#[test]
fn get_directive_no_matching_host() {
    let ast = make_ast("Host other\n    User alice\n");
    let val = get_directive(&ast, "example", "User");
    assert_eq!(val, None);
}

#[test]
fn get_directive_empty_ast() {
    let ast = make_ast("");
    let val = get_directive(&ast, "example", "User");
    assert_eq!(val, None);
}

#[test]
fn get_directive_first_match_wins() {
    let ast = make_ast(
        "\
Host *
    User first

Host *
    User second
",
    );
    let val = get_directive(&ast, "anything", "User");
    assert_eq!(val, Some("first".to_owned()));
}

#[test]
fn get_accumulative_directive_no_match() {
    let ast = make_ast("Host other\n    IdentityFile ~/.ssh/id_rsa\n");
    let vals = get_accumulative_directive(&ast, "example", "IdentityFile");
    assert_eq!(vals, Vec::<String>::new());
}

#[test]
fn set_directive_creates_new_block() {
    let mut ast = make_ast("Host example\n    User alice\n");
    set_directive(&mut ast, "example", "HostName", "example.com").unwrap();
    let val = get_directive(&ast, "example", "HostName");
    assert_eq!(val, Some("example.com".to_owned()));
}

#[test]
fn set_directive_updates_existing() {
    let mut ast = make_ast("Host example\n    HostName old.com\n");
    set_directive(&mut ast, "example", "HostName", "new.com").unwrap();
    let val = get_directive(&ast, "example", "HostName");
    assert_eq!(val, Some("new.com".to_owned()));
}

#[test]
fn set_directive_host_not_found() {
    let mut ast = make_ast("");
    assert!(set_directive(&mut ast, "missing", "User", "alice").is_err());
}

// ---------------------------------------------------------------------------
// Weird edge-case tests for glob and pattern matching
// ---------------------------------------------------------------------------

#[test]
fn glob_matches_consecutive_stars() {
    // ** should match anything (same as *)
    assert!(glob_matches("anything", "**"));
    assert!(glob_matches("", "**"));
    assert!(glob_matches("a.b.c", "**"));
}

#[test]
fn glob_matches_star_at_end() {
    assert!(glob_matches("prefix", "prefix*"));
    assert!(glob_matches("prefix-extra", "prefix*"));
    assert!(!glob_matches("pre", "prefix*"));
}

#[test]
fn glob_matches_star_at_start_and_end() {
    assert!(glob_matches("middle", "*middle*"));
    assert!(glob_matches("a-middle-b", "*middle*"));
    assert!(!glob_matches("midle", "*middle*"));
}

#[test]
fn glob_matches_question_marks_sequence() {
    assert!(glob_matches("abc", "???"));
    assert!(!glob_matches("ab", "???"));
    assert!(!glob_matches("abcd", "???"));
}

#[test]
fn glob_matches_mixed_wildcards() {
    assert!(glob_matches("test.conf", "test.*"));
    assert!(glob_matches("test.conf", "te?t.*"));
    // t??? matches "test" (t + 3 chars), .* matches ".conf"
    assert!(glob_matches("test.conf", "t???.*"));
}

#[test]
fn host_matches_patterns_leading_dot() {
    // Leading dot is a valid hostname pattern in some contexts
    assert!(host_matches_patterns(
        ".example.com",
        &[".example.com".to_string()]
    ));
}

#[test]
fn host_matches_patterns_trailing_dot() {
    // Trailing dot is valid FQDN notation
    assert!(host_matches_patterns(
        "example.com.",
        &["example.com.".to_string()]
    ));
}

#[test]
fn host_matches_patterns_consecutive_dots() {
    // Unusual but should not panic
    assert!(!host_matches_patterns(
        "example.com",
        &["..example.com".to_string()]
    ));
}

#[test]
fn host_matches_patterns_very_long() {
    let long_host = "a".repeat(256);
    let patterns = vec![long_host.clone()];
    assert!(host_matches_patterns(&long_host, &patterns));
    assert!(!host_matches_patterns("short", &patterns));
}

#[test]
fn host_matches_patterns_unicode() {
    // Unicode hostnames (IDN) - should work with ASCII lowercase
    assert!(host_matches_patterns("höst", &["höst".to_string()]));
}

#[test]
fn get_directive_multiple_hosts_same_name() {
    // Two Host blocks with the same name - first wins
    let ast = make_ast("Host dup\n    User first\nHost dup\n    User second\n");
    let val = get_directive(&ast, "dup", "User");
    assert_eq!(val, Some("first".to_owned()));
}

#[test]
fn get_directive_host_with_equals_separator() {
    let ast = make_ast("Host=example\n    User=alice\n");
    let val = get_directive(&ast, "example", "User");
    // The value includes the = separator
    assert!(val.is_some());
}

#[test]
fn set_directive_preserves_other_directives() {
    let mut ast = make_ast("Host example\n    User alice\n    Port 22\n");
    set_directive(&mut ast, "example", "HostName", "example.com").unwrap();
    let user = get_directive(&ast, "example", "User");
    let port = get_directive(&ast, "example", "Port");
    assert_eq!(user, Some("alice".to_owned()));
    assert_eq!(port, Some("22".to_owned()));
}

#[test]
fn set_directive_overwrites_value() {
    let mut ast = make_ast("Host example\n    HostName old.com\n");
    set_directive(&mut ast, "example", "HostName", "new.com").unwrap();
    set_directive(&mut ast, "example", "HostName", "final.com").unwrap();
    let val = get_directive(&ast, "example", "HostName");
    assert_eq!(val, Some("final.com".to_owned()));
}

// ---------------------------------------------------------------------------
// Production-grade weird edge cases
// ---------------------------------------------------------------------------

#[test]
fn host_matches_patterns_only_negation_multiple() {
    // Multiple negation patterns with no positive match
    let patterns = vec!["!a".to_string(), "!b".to_string(), "!c".to_string()];
    assert!(!host_matches_patterns("d", &patterns));
    assert!(!host_matches_patterns("a", &patterns));
}

#[test]
fn host_matches_patterns_negation_of_wildcard() {
    // * matches everything, !specific negates it
    let patterns = vec!["*".to_string(), "!specific".to_string()];
    assert!(host_matches_patterns("anything", &patterns));
    assert!(!host_matches_patterns("specific", &patterns));
}

#[test]
fn host_matches_patterns_empty_string_patterns() {
    let patterns = vec![String::new()];
    // Empty pattern matches empty host
    assert!(host_matches_patterns("", &patterns));
    assert!(!host_matches_patterns("host", &patterns));
}

#[test]
fn glob_matches_only_question_marks() {
    assert!(glob_matches("abc", "???"));
    assert!(!glob_matches("abcd", "???"));
    assert!(!glob_matches("ab", "???"));
    assert!(!glob_matches("", "???"));
}

#[test]
fn glob_matches_star_matches_empty() {
    // * should match empty string
    assert!(glob_matches("", "*"));
    assert!(glob_matches("", "**"));
    assert!(glob_matches("", "***"));
}

#[test]
fn glob_matches_pattern_longer_than_text() {
    assert!(!glob_matches("ab", "abcde"));
    assert!(!glob_matches("a", "ab*"));
}

#[test]
fn glob_matches_text_with_special_chars() {
    // Text containing glob characters
    assert!(glob_matches("test*file", "test*file"));
    assert!(glob_matches("test?file", "test?file"));
}

#[test]
fn get_directive_from_match_block() {
    let ast = make_ast("Match host web\n    User admin\n");
    // get_directive only looks at Host blocks, not Match blocks
    let val = get_directive(&ast, "web", "User");
    assert_eq!(val, None);
}

#[test]
fn get_all_directives_empty_ast() {
    let ast = make_ast("");
    let dirs = get_all_directives(&ast, "host");
    assert_eq!(dirs, [] as [(std::string::String, std::string::String); 0]);
}

#[test]
fn get_all_directives_no_match() {
    let ast = make_ast("Host other\n    User alice\n");
    let dirs = get_all_directives(&ast, "host");
    assert_eq!(dirs, [] as [(std::string::String, std::string::String); 0]);
}

#[test]
fn set_directive_on_wildcard_host() {
    let mut ast = make_ast("Host *\n    User alice\n");
    set_directive(&mut ast, "anything", "Port", "22").unwrap();
    let val = get_directive(&ast, "anything", "Port");
    assert_eq!(val, Some("22".to_owned()));
}

#[test]
fn get_directive_with_empty_value() {
    let ast = make_ast("Host example\n    HostName\n");
    let val = get_directive(&ast, "example", "HostName");
    assert_eq!(val, Some(String::new()));
}

// ---------------------------------------------------------------------------
// Workflow-discovered edge cases
// ---------------------------------------------------------------------------

#[test]
fn crlf_in_host_pattern_breaks_matching() {
    let input = "Host example\r\n    User alice\r\n";
    let ast = crate::ast::parse(input);
    let val = get_directive(&ast, "example", "User");
    // CRLF \r should be stripped by trim(), so host matching should work
    assert!(val.is_some(), "CRLF should not break host matching");
    assert_eq!(val.unwrap(), "alice");
}

#[test]
fn crlf_in_directive_value_clean() {
    let input = "Host example\r\n    HostName myhost.com\r\n";
    let ast = crate::ast::parse(input);
    let val = get_directive(&ast, "example", "HostName");
    if let Some(ref v) = val {
        assert!(!v.contains('\r'), "\\r leaked into value: {v:?}");
    }
    assert_eq!(val.as_deref(), Some("myhost.com"));
}

// ---------------------------------------------------------------------------
// Config typed directives: certificate_files, identity_agent, etc.
// ---------------------------------------------------------------------------

#[test]
fn certificate_file_accumulated_across_blocks() {
    let ast = make_ast(
        "\
Host myhost
    CertificateFile ~/.ssh/id_ed25519-cert.pub

Host *
    CertificateFile ~/.ssh/id_rsa-cert.pub
",
    );
    let vals = get_accumulative_directive(&ast, "myhost", "CertificateFile");
    assert_eq!(vals.len(), 2);
    assert_eq!(vals[0], "~/.ssh/id_ed25519-cert.pub");
    assert_eq!(vals[1], "~/.ssh/id_rsa-cert.pub");
}

#[test]
fn identity_agent_directive_found() {
    let ast = make_ast(
        "\
Host myhost
    IdentityAgent /run/user/1000/ssh-agent.sock
",
    );
    let val = get_directive(&ast, "myhost", "IdentityAgent");
    assert_eq!(val, Some("/run/user/1000/ssh-agent.sock".into()));
}

#[test]
fn identity_agent_from_wildcard() {
    let ast = make_ast(
        "\
Host *
    IdentityAgent /tmp/agent.sock
",
    );
    let val = get_directive(&ast, "anything", "IdentityAgent");
    assert_eq!(val, Some("/tmp/agent.sock".into()));
}

#[test]
fn proxy_jump_accumulated_across_blocks() {
    let ast = make_ast(
        "\
Host target
    ProxyJump jump1

Host *
    ProxyJump jump2
",
    );
    let vals = get_accumulative_directive(&ast, "target", "ProxyJump");
    assert_eq!(vals.len(), 2);
    assert_eq!(vals[0], "jump1");
    assert_eq!(vals[1], "jump2");
}

#[test]
fn forward_agent_accumulated() {
    let ast = make_ast(
        "\
Host myhost
    ForwardAgent yes
",
    );
    let vals = get_accumulative_directive(&ast, "myhost", "ForwardAgent");
    assert_eq!(vals, vec!["yes"]);
}

#[test]
fn send_env_accumulated() {
    let ast = make_ast(
        "\
Host myhost
    SendEnv LANG
    SendEnv LC_*
",
    );
    let vals = get_accumulative_directive(&ast, "myhost", "SendEnv");
    assert_eq!(vals.len(), 2);
    assert_eq!(vals[0], "LANG");
    assert_eq!(vals[1], "LC_*");
}

#[test]
fn set_env_accumulated() {
    let ast = make_ast(
        "\
Host myhost
    SetEnv FOO=bar
    SetEnv BAZ=qux
",
    );
    let vals = get_accumulative_directive(&ast, "myhost", "SetEnv");
    assert_eq!(vals.len(), 2);
    assert_eq!(vals[0], "FOO=bar");
    assert_eq!(vals[1], "BAZ=qux");
}

#[test]
fn is_accumulative_certificate_file() {
    assert!(is_accumulative("certificatefile"));
}

#[test]
fn is_accumulative_identity_agent_not_accumulative() {
    // IdentityAgent is NOT accumulative (first-match-wins).
    assert!(!is_accumulative("identityagent"));
}

#[test]
fn get_all_directives_mixed_accumulative_and_first_match() {
    let ast = make_ast(
        "\
Host myhost
    HostName example.com
    User alice
    IdentityFile ~/.ssh/id_ed25519
    CertificateFile ~/.ssh/id_ed25519-cert.pub
",
    );
    let dirs = get_all_directives(&ast, "myhost");
    let keys: Vec<&str> = dirs.iter().map(|(k, _)| k.as_str()).collect();
    assert!(keys.contains(&"HostName"));
    assert!(keys.contains(&"User"));
    assert!(keys.contains(&"IdentityFile"));
    assert!(keys.contains(&"CertificateFile"));
}

#[test]
fn get_all_directives_first_match_wins_for_non_accumulative() {
    let ast = make_ast(
        "\
Host *
    User default

Host myhost
    User specific
",
    );
    let dirs = get_all_directives(&ast, "myhost");
    // First-match-wins: "default" from Host * is seen first and kept.
    let user_vals: Vec<&str> = dirs
        .iter()
        .filter(|(k, _)| k == "User")
        .map(|(_, v)| v.as_str())
        .collect();
    assert_eq!(user_vals, vec!["default"]);
}

#[test]
fn get_all_directives_forward_agent_first_match_wins() {
    let ast = make_ast(
        "\
Host *
    ForwardAgent no

Host myhost
    ForwardAgent yes
",
    );
    let dirs = get_all_directives(&ast, "myhost");
    let fa_vals: Vec<&str> = dirs
        .iter()
        .filter(|(k, _)| k == "ForwardAgent")
        .map(|(_, v)| v.as_str())
        .collect();
    assert_eq!(
        fa_vals,
        vec!["no"],
        "ForwardAgent should use first-match-wins"
    );
}

#[test]
fn get_all_directives_forwarding_accumulated() {
    let ast = make_ast(
        "\
Host myhost
    LocalForward 8080 localhost:80
    RemoteForward 9090 localhost:90
    DynamicForward 1080
",
    );
    let dirs = get_all_directives(&ast, "myhost");
    let keys: Vec<&str> = dirs.iter().map(|(k, _)| k.as_str()).collect();
    assert!(keys.contains(&"LocalForward"));
    assert!(keys.contains(&"RemoteForward"));
    assert!(keys.contains(&"DynamicForward"));
}

#[test]
fn is_accumulative_forwarding_directives() {
    assert!(is_accumulative("localforward"));
    assert!(is_accumulative("remoteforward"));
    assert!(is_accumulative("dynamicforward"));
    assert!(is_accumulative("identityfile"));
    assert!(is_accumulative("certificatefile"));
}

#[test]
fn is_accumulative_first_match_wins_directives() {
    assert!(!is_accumulative("identityagent"));
    assert!(!is_accumulative("forwardagent"));
    assert!(!is_accumulative("addkeystoagent"));
    assert!(!is_accumulative("usekeychain"));
    assert!(!is_accumulative("controlmaster"));
    assert!(!is_accumulative("controlpath"));
    assert!(!is_accumulative("controlpersist"));
}