It seems your attack_map doesn’t contain all necessary classes to replace all targets from the test set.
The attack_map contains the replacement map for:
{'back': 'dos',
 'buffer_overflow': 'u2r',
 'ftp_write': 'r2l',
 'guess_passwd': 'r2l',
 'imap': 'r2l',
 'ipsweep': 'probe',
 'land': 'dos',
 'loadmodule': 'u2r',
 'multihop': 'r2l',
 'neptune': 'dos',
 'nmap': 'probe',
 'perl': 'u2r',
 'phf': 'r2l',
 'pod': 'dos',
 'portsweep': 'probe',
 'rootkit': 'u2r',
 'satan': 'probe',
 'smurf': 'dos',
 'spy': 'r2l',
 'teardrop': 'dos',
 'warezclient': 'r2l',
 'warezmaster': 'r2l'}

which should work for the training set, which contains kdd['class'].unique():
 array(['normal', 'neptune', 'warezclient', 'ipsweep', 'portsweep',
       'teardrop', 'nmap', 'satan', 'smurf', 'pod', 'back',
       'guess_passwd', 'ftp_write', 'multihop', 'rootkit',
       'buffer_overflow', 'imap', 'warezmaster', 'phf', 'land',
       'loadmodule', 'spy', 'perl'], dtype=object)

such that after calling kdd['class'] = kdd['class'].replace(attack_map) it will contain:
array(['normal', 'dos', 'r2l', 'probe', 'u2r'], dtype=object)

However, the test set seems to contain more unique classes:
array(['neptune', 'normal', 'saint', 'mscan', 'guess_passwd', 'smurf',
       'apache2', 'satan', 'buffer_overflow', 'back', 'warezmaster',
       'snmpgetattack', 'processtable', 'pod', 'httptunnel', 'nmap', 'ps',
       'snmpguess', 'ipsweep', 'mailbomb', 'portsweep', 'multihop',
       'named', 'sendmail', 'loadmodule', 'xterm', 'worm', 'teardrop',
       'rootkit', 'xlock', 'perl', 'land', 'xsnoop', 'sqlattack',
       'ftp_write', 'imap', 'udpstorm', 'phf'], dtype=object)

so you end up with:
kdd_t['class'] = kdd_t['class'].replace(attack_map)
print(kdd_y['class'].unique())
> ['dos' 'normal' 'saint' 'mscan' 'r2l' 'apache2' 'probe' 'u2r'
 'snmpgetattack' 'processtable' 'httptunnel' 'ps' 'snmpguess' 'mailbomb'
 'named' 'sendmail' 'xterm' 'worm' 'xlock' 'xsnoop' 'sqlattack' 'udpstorm']

PS: It’s easier to debug, if you wrap the code into three backticks ```